dockertest -> test/3nodetest
Juan Batiz-Benet committed
Jan 7, 2015 at 07:27 UTC
28cf220de1df9392457dbe831ac02875099805fc
23 files changed
+35
-21
dockertest/bin/save_logs.sh
deleted
-8
@@ -1,8 +0,0 @@
1
-# STRIP strips color from terminal output
2
-STRIP="perl -pe 's/\e\[?.*?[\@-~]//g'"
3
-
4
-# TODO use a for loop like a grownup
5
-docker logs dockertest_bootstrap_1 2>&1 | eval $STRIP > ./build/bootstrap.log
6
-docker logs dockertest_client_1 2>&1 | eval $STRIP > ./build/client.log
7
-docker logs dockertest_data_1 2>&1 | eval $STRIP > ./build/data.log
8
-docker logs dockertest_server_1 2>&1 | eval $STRIP > ./build/server.log
test/3nodetest/Makefile
renamed
+5
-4
@@ -1,5 +1,6 @@
1
-RANDOMSRC = Godeps/_workspace/src/github.com/jbenet/go-random/random
1
+RANDOMSRC = ../../Godeps/_workspace/src/github.com/jbenet/go-random
2
IMAGE_NAME = ipfs-test-latest
3
+IPFS_ROOT = ../..
4
5
test: clean setup
6
./run-test-on-img.sh $(IMAGE_NAME)
@@ -15,13 +16,13 @@ data/filetiny: Makefile
16
data/filerand: bin/random
17
./bin/random 50000000 > ./data/filerand
18
18
-bin/random:
19
- go build -o ./bin/random ../$(RANDOMSRC)
19
+bin/random: $(RANDOMSRC)/**/*.go
20
+ go build -o ./bin/random $(RANDOMSRC)/random
21
22
# just build it every time... this part isn't
23
# even the lengthy part, and it decreases pain.
24
docker_ipfs_image:
24
- cd .. && docker build -t $(IMAGE_NAME) .
25
+ cd $(IPFS_ROOT) && docker build -t $(IMAGE_NAME) .
26
docker images | grep $(IMAGE_NAME)
27
28
clean:
test/3nodetest/README.md
renamed
test/3nodetest/bin/.gitignore
renamed
test/3nodetest/bin/clean.sh
renamed
test/3nodetest/bin/save_logs.sh
new
+8
@@ -0,0 +1,8 @@
1
+# STRIP strips color from terminal output
2
+STRIP="perl -pe 's/\e\[?.*?[\@-~]//g'"
3
+
4
+# TODO use a for loop like a grownup
5
+docker logs 3nodetest_bootstrap_1 2>&1 | eval $STRIP > ./build/bootstrap.log
6
+docker logs 3nodetest_client_1 2>&1 | eval $STRIP > ./build/client.log
7
+docker logs 3nodetest_data_1 2>&1 | eval $STRIP > ./build/data.log
8
+docker logs 3nodetest_server_1 2>&1 | eval $STRIP > ./build/server.log
test/3nodetest/bootstrap/Dockerfile
renamed
test/3nodetest/bootstrap/README.md
renamed
test/3nodetest/bootstrap/config
renamed
test/3nodetest/build/.gitignore
renamed
test/3nodetest/build/.gitkeep
renamed
test/3nodetest/client/Dockerfile
renamed
test/3nodetest/client/config
renamed
test/3nodetest/client/run.sh
renamed
+6
-6
@@ -1,16 +1,16 @@
1
ipfs bootstrap add /ip4/$BOOTSTRAP_PORT_4011_TCP_ADDR/tcp/$BOOTSTRAP_PORT_4011_TCP_PORT/QmNXuBh8HFsWq68Fid8dMbGNQTh7eG6hV9rr1fQyfmfomE
2
3
4
-echo "dockertest> starting client daemon"
4
+echo "3nodetest> starting client daemon"
5
ipfs daemon &
6
sleep 3
7
8
while [ ! -f /data/idtiny ]
9
do
10
- echo "dockertest> waiting for server to add the file..."
10
+ echo "3nodetest> waiting for server to add the file..."
11
sleep 1
12
done
13
-echo "dockertest> client found file with hash:" $(cat /data/idtiny)
13
+echo "3nodetest> client found file with hash:" $(cat /data/idtiny)
14
15
ipfs cat $(cat /data/idtiny) > filetiny
16
@@ -25,10 +25,10 @@ fi
25
26
while [ ! -f /data/idrand ]
27
do
28
- echo "dockertest> waiting for server to add the file..."
28
+ echo "3nodetest> waiting for server to add the file..."
29
sleep 1
30
done
31
-echo "dockertest> client found file with hash:" $(cat /data/idrand)
31
+echo "3nodetest> client found file with hash:" $(cat /data/idrand)
32
33
cat /data/idrand
34
@@ -46,4 +46,4 @@ if (($? > 0)); then
46
exit 1
47
fi
48
49
-echo "dockertest> success"
49
+echo "3nodetest> success"
test/3nodetest/data/.gitignore
renamed
test/3nodetest/data/Dockerfile
renamed
test/3nodetest/fig.yml
renamed
test/3nodetest/run-test-on-img.sh
renamed
test/3nodetest/server/Dockerfile
renamed
test/3nodetest/server/README.md
renamed
test/3nodetest/server/config
renamed
test/3nodetest/server/run.sh
renamed
+3
-3
@@ -3,7 +3,7 @@ ipfs bootstrap add /ip4/$BOOTSTRAP_PORT_4011_TCP_ADDR/tcp/$BOOTSTRAP_PORT_4011_T
3
4
# wait for daemon to start/bootstrap
5
# alternatively use ipfs swarm connect
6
-echo "dockertest> starting server daemon"
6
+echo "3nodetest> starting server daemon"
7
ipfs daemon &
8
sleep 3
9
# 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
11
# must mount this volume from data container
12
ipfs add -q /data/filetiny > tmptiny
13
mv tmptiny /data/idtiny
14
-echo "dockertest> added tiny file. hash is" $(cat /data/idtiny)
14
+echo "3nodetest> added tiny file. hash is" $(cat /data/idtiny)
15
16
ipfs add -q /data/filerand > tmprand
17
mv tmprand /data/idrand
18
-echo "dockertest> added rand file. hash is" $(cat /data/idrand)
18
+echo "3nodetest> added rand file. hash is" $(cat /data/idrand)
19
20
# allow ample time for the client to pull the data
21
sleep 10000000
test/jenkins/network-test.sh
new
+13
@@ -0,0 +1,13 @@
1
+#!/bin/sh
2
+
3
+export GOPATH=$WORKSPACE
4
+
5
+PWD=`pwd`
6
+cd ../3nodetest
7
+make clean
8
+make test
9
+make save_logs
10
+
11
+docker cp 3nodetest_server_1:/root/.go-ipfs/logs/events.log $(PWD)/build/server-events.log
12
+docker cp 3nodetest_bootstrap_1:/root/.go-ipfs/logs/events.log $(PWD)/build/bootstrap-events.log
13
+docker cp 3nodetest_client_1:/root/.go-ipfs/logs/events.log $(PWD)/build/client-events.log