mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-29 01:12:24 +08:00
dockertest -> test/3nodetest
This commit is contained in:
@ -1,8 +0,0 @@
|
|||||||
# 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
|
|
@ -1,5 +1,6 @@
|
|||||||
RANDOMSRC = Godeps/_workspace/src/github.com/jbenet/go-random/random
|
RANDOMSRC = ../../Godeps/_workspace/src/github.com/jbenet/go-random
|
||||||
IMAGE_NAME = ipfs-test-latest
|
IMAGE_NAME = ipfs-test-latest
|
||||||
|
IPFS_ROOT = ../..
|
||||||
|
|
||||||
test: clean setup
|
test: clean setup
|
||||||
./run-test-on-img.sh $(IMAGE_NAME)
|
./run-test-on-img.sh $(IMAGE_NAME)
|
||||||
@ -15,13 +16,13 @@ data/filetiny: Makefile
|
|||||||
data/filerand: bin/random
|
data/filerand: bin/random
|
||||||
./bin/random 50000000 > ./data/filerand
|
./bin/random 50000000 > ./data/filerand
|
||||||
|
|
||||||
bin/random:
|
bin/random: $(RANDOMSRC)/**/*.go
|
||||||
go build -o ./bin/random ../$(RANDOMSRC)
|
go build -o ./bin/random $(RANDOMSRC)/random
|
||||||
|
|
||||||
# just build it every time... this part isn't
|
# just build it every time... this part isn't
|
||||||
# even the lengthy part, and it decreases pain.
|
# even the lengthy part, and it decreases pain.
|
||||||
docker_ipfs_image:
|
docker_ipfs_image:
|
||||||
cd .. && docker build -t $(IMAGE_NAME) .
|
cd $(IPFS_ROOT) && docker build -t $(IMAGE_NAME) .
|
||||||
docker images | grep $(IMAGE_NAME)
|
docker images | grep $(IMAGE_NAME)
|
||||||
|
|
||||||
clean:
|
clean:
|
8
test/3nodetest/bin/save_logs.sh
Normal file
8
test/3nodetest/bin/save_logs.sh
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# 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
|
@ -1,16 +1,16 @@
|
|||||||
ipfs bootstrap add /ip4/$BOOTSTRAP_PORT_4011_TCP_ADDR/tcp/$BOOTSTRAP_PORT_4011_TCP_PORT/QmNXuBh8HFsWq68Fid8dMbGNQTh7eG6hV9rr1fQyfmfomE
|
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 &
|
ipfs daemon &
|
||||||
sleep 3
|
sleep 3
|
||||||
|
|
||||||
while [ ! -f /data/idtiny ]
|
while [ ! -f /data/idtiny ]
|
||||||
do
|
do
|
||||||
echo "dockertest> waiting for server to add the file..."
|
echo "3nodetest> waiting for server to add the file..."
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
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
|
ipfs cat $(cat /data/idtiny) > filetiny
|
||||||
|
|
||||||
@ -25,10 +25,10 @@ fi
|
|||||||
|
|
||||||
while [ ! -f /data/idrand ]
|
while [ ! -f /data/idrand ]
|
||||||
do
|
do
|
||||||
echo "dockertest> waiting for server to add the file..."
|
echo "3nodetest> waiting for server to add the file..."
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
echo "dockertest> client found file with hash:" $(cat /data/idrand)
|
echo "3nodetest> client found file with hash:" $(cat /data/idrand)
|
||||||
|
|
||||||
cat /data/idrand
|
cat /data/idrand
|
||||||
|
|
||||||
@ -46,4 +46,4 @@ if (($? > 0)); then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
# wait for daemon to start/bootstrap
|
||||||
# alternatively use ipfs swarm connect
|
# alternatively use ipfs swarm connect
|
||||||
echo "dockertest> starting server daemon"
|
echo "3nodetest> starting server daemon"
|
||||||
ipfs daemon &
|
ipfs daemon &
|
||||||
sleep 3
|
sleep 3
|
||||||
# TODO instead of bootrapping: ipfs swarm connect /ip4/$BOOTSTRAP_PORT_4011_TCP_ADDR/tcp/$BOOTSTRAP_PORT_4011_TCP_PORT/QmNXuBh8HFsWq68Fid8dMbGNQTh7eG6hV9rr1fQyfmfomE
|
# 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
|
# must mount this volume from data container
|
||||||
ipfs add -q /data/filetiny > tmptiny
|
ipfs add -q /data/filetiny > tmptiny
|
||||||
mv tmptiny /data/idtiny
|
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
|
ipfs add -q /data/filerand > tmprand
|
||||||
mv tmprand /data/idrand
|
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
|
# allow ample time for the client to pull the data
|
||||||
sleep 10000000
|
sleep 10000000
|
13
test/jenkins/network-test.sh
Executable file
13
test/jenkins/network-test.sh
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/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
|
Reference in New Issue
Block a user