2019-01-08 15:24:15 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -ueo pipefail
|
2019-02-06 12:47:00 +00:00
|
|
|
set +x
|
2019-01-08 15:24:15 +00:00
|
|
|
|
|
|
|
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
|
|
|
|
2019-03-20 14:58:07 +00:00
|
|
|
make -C "$SCRIPTDIR"/.. install-sim
|
2019-01-08 15:24:15 +00:00
|
|
|
|
|
|
|
# setup tmpdir for testfiles and cleanup
|
|
|
|
TMP=$(mktemp -d -t tmp.XXXXXXXXXX)
|
|
|
|
cleanup(){
|
|
|
|
rm -rf "$TMP"
|
|
|
|
}
|
|
|
|
trap cleanup EXIT
|
|
|
|
|
2019-02-06 12:47:00 +00:00
|
|
|
export STORJ_NETWORK_DIR=$TMP
|
2019-01-08 15:24:15 +00:00
|
|
|
|
2019-04-22 14:45:53 +01:00
|
|
|
STORJ_NETWORK_HOST4=${STORJ_NETWORK_HOST4:-127.0.0.1}
|
2019-05-14 16:13:18 +01:00
|
|
|
STORJ_SIM_POSTGRES=${STORJ_SIM_POSTGRES:-""}
|
2019-04-22 14:45:53 +01:00
|
|
|
|
2019-01-08 15:24:15 +00:00
|
|
|
# setup the network
|
2019-05-14 16:13:18 +01:00
|
|
|
# if postgres connection string is set as STORJ_SIM_POSTGRES then use that for testing
|
|
|
|
if [ -z ${STORJ_SIM_POSTGRES} ]; then
|
|
|
|
storj-sim -x --satellites 2 --host $STORJ_NETWORK_HOST4 network setup
|
|
|
|
else
|
|
|
|
storj-sim -x --satellites 2 --host $STORJ_NETWORK_HOST4 network --postgres=$STORJ_SIM_POSTGRES setup
|
|
|
|
fi
|
2019-01-08 15:24:15 +00:00
|
|
|
|
|
|
|
# run aws-cli tests
|
2019-05-09 15:39:43 +01:00
|
|
|
storj-sim -x --satellites 2 --host $STORJ_NETWORK_HOST4 network test bash "$SCRIPTDIR"/test-sim-aws.sh
|
|
|
|
storj-sim -x --satellites 2 --host $STORJ_NETWORK_HOST4 network test bash "$SCRIPTDIR"/test-uplink.sh
|
|
|
|
storj-sim -x --satellites 2 --host $STORJ_NETWORK_HOST4 network destroy
|
2019-01-08 15:24:15 +00:00
|
|
|
|
2019-02-06 12:47:00 +00:00
|
|
|
# setup the network with ipv6
|
2019-04-22 14:45:53 +01:00
|
|
|
#storj-sim -x --host "::1" network setup
|
2019-02-06 12:47:00 +00:00
|
|
|
# aws-cli doesn't support gateway with ipv6 address, so change it to use localhost
|
2019-04-22 14:45:53 +01:00
|
|
|
#find "$STORJ_NETWORK_DIR"/gateway -type f -name config.yaml -exec sed -i 's/server.address: "\[::1\]/server.address: "127.0.0.1/' '{}' +
|
2019-02-06 12:47:00 +00:00
|
|
|
# run aws-cli tests using ipv6
|
2019-04-22 14:45:53 +01:00
|
|
|
#storj-sim -x --host "::1" network test bash "$SCRIPTDIR"/test-sim-aws.sh
|
|
|
|
#storj-sim -x network destroy
|