Commit 28cf220d authored by Juan Batiz-Benet's avatar Juan Batiz-Benet

dockertest -> test/3nodetest

parent b479602b
# STRIP strips color from terminal output
STRIP="perl -pe 's/\e\[?.*?[\@-~]//g'"
# TODO use a for loop like a grownup
docker logs dockertest_bootstrap_1 2>&1 | eval $STRIP > ./build/bootstrap.log
docker logs dockertest_client_1 2>&1 | eval $STRIP > ./build/client.log
docker logs dockertest_data_1 2>&1 | eval $STRIP > ./build/data.log
docker logs dockertest_server_1 2>&1 | eval $STRIP > ./build/server.log
RANDOMSRC = Godeps/_workspace/src/github.com/jbenet/go-random/random
RANDOMSRC = ../../Godeps/_workspace/src/github.com/jbenet/go-random
IMAGE_NAME = ipfs-test-latest
IPFS_ROOT = ../..
test: clean setup
./run-test-on-img.sh $(IMAGE_NAME)
......@@ -15,13 +16,13 @@ data/filetiny: Makefile
data/filerand: bin/random
./bin/random 50000000 > ./data/filerand
bin/random:
go build -o ./bin/random ../$(RANDOMSRC)
bin/random: $(RANDOMSRC)/**/*.go
go build -o ./bin/random $(RANDOMSRC)/random
# just build it every time... this part isn't
# even the lengthy part, and it decreases pain.
docker_ipfs_image:
cd .. && docker build -t $(IMAGE_NAME) .
cd $(IPFS_ROOT) && docker build -t $(IMAGE_NAME) .
docker images | grep $(IMAGE_NAME)
clean:
......
# STRIP strips color from terminal output
STRIP="perl -pe 's/\e\[?.*?[\@-~]//g'"
# TODO use a for loop like a grownup
docker logs 3nodetest_bootstrap_1 2>&1 | eval $STRIP > ./build/bootstrap.log
docker logs 3nodetest_client_1 2>&1 | eval $STRIP > ./build/client.log
docker logs 3nodetest_data_1 2>&1 | eval $STRIP > ./build/data.log
docker logs 3nodetest_server_1 2>&1 | eval $STRIP > ./build/server.log
ipfs bootstrap add /ip4/$BOOTSTRAP_PORT_4011_TCP_ADDR/tcp/$BOOTSTRAP_PORT_4011_TCP_PORT/QmNXuBh8HFsWq68Fid8dMbGNQTh7eG6hV9rr1fQyfmfomE
echo "dockertest> starting client daemon"
echo "3nodetest> starting client daemon"
ipfs daemon &
sleep 3
while [ ! -f /data/idtiny ]
do
echo "dockertest> waiting for server to add the file..."
echo "3nodetest> waiting for server to add the file..."
sleep 1
done
echo "dockertest> client found file with hash:" $(cat /data/idtiny)
echo "3nodetest> client found file with hash:" $(cat /data/idtiny)
ipfs cat $(cat /data/idtiny) > filetiny
......@@ -25,10 +25,10 @@ fi
while [ ! -f /data/idrand ]
do
echo "dockertest> waiting for server to add the file..."
echo "3nodetest> waiting for server to add the file..."
sleep 1
done
echo "dockertest> client found file with hash:" $(cat /data/idrand)
echo "3nodetest> client found file with hash:" $(cat /data/idrand)
cat /data/idrand
......@@ -46,4 +46,4 @@ if (($? > 0)); then
exit 1
fi
echo "dockertest> success"
echo "3nodetest> success"
......@@ -3,7 +3,7 @@ ipfs bootstrap add /ip4/$BOOTSTRAP_PORT_4011_TCP_ADDR/tcp/$BOOTSTRAP_PORT_4011_T
# wait for daemon to start/bootstrap
# alternatively use ipfs swarm connect
echo "dockertest> starting server daemon"
echo "3nodetest> starting server daemon"
ipfs daemon &
sleep 3
# TODO instead of bootrapping: ipfs swarm connect /ip4/$BOOTSTRAP_PORT_4011_TCP_ADDR/tcp/$BOOTSTRAP_PORT_4011_TCP_PORT/QmNXuBh8HFsWq68Fid8dMbGNQTh7eG6hV9rr1fQyfmfomE
......@@ -11,11 +11,11 @@ sleep 3
# must mount this volume from data container
ipfs add -q /data/filetiny > tmptiny
mv tmptiny /data/idtiny
echo "dockertest> added tiny file. hash is" $(cat /data/idtiny)
echo "3nodetest> added tiny file. hash is" $(cat /data/idtiny)
ipfs add -q /data/filerand > tmprand
mv tmprand /data/idrand
echo "dockertest> added rand file. hash is" $(cat /data/idrand)
echo "3nodetest> added rand file. hash is" $(cat /data/idrand)
# allow ample time for the client to pull the data
sleep 10000000
#!/bin/sh
export GOPATH=$WORKSPACE
PWD=`pwd`
cd ../3nodetest
make clean
make test
make save_logs
docker cp 3nodetest_server_1:/root/.go-ipfs/logs/events.log $(PWD)/build/server-events.log
docker cp 3nodetest_bootstrap_1:/root/.go-ipfs/logs/events.log $(PWD)/build/bootstrap-events.log
docker cp 3nodetest_client_1:/root/.go-ipfs/logs/events.log $(PWD)/build/client-events.log
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment