Skip to content

Commit

Permalink
Add automated restart test infrastructure (solana-labs#17491)
Browse files Browse the repository at this point in the history
  • Loading branch information
AshwinSekar authored Jun 4, 2021
1 parent 4677e6c commit 7633d0f
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
3 changes: 3 additions & 0 deletions multinode-demo/bootstrap-validator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ while [[ -n $1 ]]; do
elif [[ $1 == --maximum-snapshots-to-retain ]]; then
args+=("$1" "$2")
shift 2
elif [[ $1 == --no-snapshot-fetch ]]; then
args+=("$1")
shift
else
echo "Unknown argument: $1"
$program --help
Expand Down
17 changes: 17 additions & 0 deletions system-test/restart-testcases/restart_gce.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
steps:
- command: "system-test/testnet-automation.sh"
label: "Restart test on GCE"
env:
UPLOAD_RESULTS_TO_SLACK: "false"
CLOUD_PROVIDER: "gce"
ENABLE_GPU: "false"
NUMBER_OF_VALIDATOR_NODES: 4
VALIDATOR_NODE_MACHINE_TYPE: "--machine-type n1-standard-16"
NUMBER_OF_CLIENT_NODES: 1
ADDITIONAL_FLAGS: "--dedicated"
BOOTSTRAP_VALIDATOR_MAX_STAKE_THRESHOLD: 66
SKIP_PERF_RESULTS: "true"
TEST_TYPE: "script"
CUSTOM_SCRIPT: "system-test/restart-testcases/restart_test_automation.sh"
agents:
- "queue=gce-deploy"
40 changes: 40 additions & 0 deletions system-test/restart-testcases/restart_test_automation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env bash

set -ex

# shellcheck disable=SC1090
# shellcheck disable=SC1091
source "$(dirname "$0")"/../automation_utils.sh

RESULT_FILE="$1"

startGpuMode="off"
if [[ -z $ENABLE_GPU ]]; then
ENABLE_GPU=false
fi
if [[ "$ENABLE_GPU" = "true" ]]; then
startGpuMode="on"
fi

declare maybeAsyncNodeInit
if [[ "$ASYNC_NODE_INIT" = "true" ]]; then
maybeAsyncNodeInit="--async-node-init"
fi

declare maybeExtraPrimordialStakes
if [[ -n "$EXTRA_PRIMORDIAL_STAKES" ]]; then
maybeExtraPrimordialStakes="--extra-primordial-stakes $EXTRA_PRIMORDIAL_STAKES"
fi

# Restart the network
"$REPO_ROOT"/net/net.sh stop

sleep 2

# shellcheck disable=SC2086
"$REPO_ROOT"/net/net.sh start --skip-setup --no-snapshot-fetch --no-deploy \
--gpu-mode $startGpuMode $maybeAsyncNodeInit $maybeExtraPrimordialStakes

# TODO add the test here

echo "Restart Test Succeeded" >>"$RESULT_FILE"

0 comments on commit 7633d0f

Please sign in to comment.