kubo/dockertest/client/run.sh
Brian Tiger Chow f48ad524f8 fix: make the dockertest a bit more robust
clean using script
misc
add another file
misc
good stuff

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-15 06:49:40 -08:00

48 lines
887 B
Bash

ipfs bootstrap add /ip4/$BOOTSTRAP_PORT_4011_TCP_ADDR/tcp/$BOOTSTRAP_PORT_4011_TCP_PORT/QmNXuBh8HFsWq68Fid8dMbGNQTh7eG6hV9rr1fQyfmfomE
ipfs daemon &
sleep 3
while [ ! -f /data/idtiny ]
do
echo waiting for server to add the file...
sleep 1
done
echo client found file with hash: $(cat /data/idtiny)
ipfs cat $(cat /data/idtiny) > filetiny
cat filetiny
diff -u filetiny /data/filetiny
if (($? > 0)); then
printf '%s\n' 'files did not match' >&2
exit 1
fi
while [ ! -f /data/idrand ]
do
echo waiting for server to add the file...
sleep 1
done
echo client found file with hash: $(cat /data/idrand)
cat /data/idrand
ipfs cat $(cat /data/idrand) > filerand
if (($? > 0)); then
printf '%s\n' 'ipfs cat failed' >&2
exit 1
fi
diff -u filerand /data/filerand
if (($? > 0)); then
printf '%s\n' 'files did not match' >&2
exit 1
fi
echo "success"