2019-05-24 21:25:53 +01:00
|
|
|
#!/bin/bash
|
|
|
|
set -ueo pipefail
|
|
|
|
|
|
|
|
# Purpose: This script executes uplink upload and download benchmark tests against storj-sim.
|
|
|
|
# Setup: Remove any existing uplink configs.
|
|
|
|
# Usage: from root of storj repo, run
|
|
|
|
# $ storj-sim network test bash ./scripts/test-sim-benchmark.sh
|
|
|
|
# To run and filter out storj-sim logs, run:
|
|
|
|
# $ storj-sim -x network test bash ./scripts/test-sim-benchmark.sh | grep -i "test.out"
|
|
|
|
|
2019-05-28 19:46:58 +01:00
|
|
|
SATELLITE_0_ADDR=${SATELLITE_0_ADDR:-127.0.0.1:10000}
|
2019-05-24 21:25:53 +01:00
|
|
|
|
|
|
|
apiKey=$(storj-sim network env GATEWAY_0_API_KEY)
|
|
|
|
export apiKey=$(storj-sim network env GATEWAY_0_API_KEY)
|
|
|
|
echo "apiKey:"
|
|
|
|
echo "$apiKey"
|
|
|
|
|
2019-05-28 19:46:58 +01:00
|
|
|
# run benchmark tests
|
2019-05-24 21:25:53 +01:00
|
|
|
echo
|
2019-05-28 19:46:58 +01:00
|
|
|
echo "Executing benchmark tests with uplink client against storj-sim..."
|
|
|
|
go test -bench=Uplink -benchmem ./cmd/uplink/cmd/
|
2019-05-24 21:25:53 +01:00
|
|
|
|
|
|
|
# run s3-benchmark with uplink
|
|
|
|
echo
|
2019-05-28 19:46:58 +01:00
|
|
|
echo "Executing s3-benchmark tests with uplink client against storj-sim..."
|
2019-05-24 21:25:53 +01:00
|
|
|
s3-benchmark --client=uplink --satellite="$SATELLITE_0_ADDR" --apikey="$apiKey"
|