Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bank count validation #136

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions signify-ts-test/test-load.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ parse_args() {
usage
fi

# REG_PILOT_API for local mode
if [[ "$MODE" == "local" ]]; then
echo "INFO: The default API URL for local mode is already set. No need to specify it."
fi

# Check for REG_PILOT_API is required in remote mode
if [[ "$MODE" == "remote" && -z "$REG_PILOT_API" ]]; then
echo "********************************************"
Expand All @@ -97,6 +102,16 @@ parse_args() {
fi
}

check_available_banks() {
local TOTAL_AVAILABLE_BANKS=10

if [[ "$BANK_COUNT" -gt "$TOTAL_AVAILABLE_BANKS" ]]; then
echo "WARNING: You have selected more banks ($BANK_COUNT) than available ($TOTAL_AVAILABLE_BANKS)."
echo "Please reduce the --bank-count value to $TOTAL_AVAILABLE_BANKS or fewer for performing load test."
exit 1
fi
}

# Start services
start_services_local() {
echo "Starting local services..."
Expand Down Expand Up @@ -184,6 +199,7 @@ load_test_banks() {

main() {
parse_args "$@"
check_available_banks

if [[ "$MODE" == "local" ]]; then
start_services_local
Expand Down
Loading