test: Add 8 and update 14 files
This commit is contained in:
@@ -22,11 +22,24 @@ echo "Original hash: $ORIGINAL_HASH"
|
||||
HOST=$(echo "$CONFIG" | jq -r '.host')
|
||||
PORT=$(echo "$CONFIG" | jq -r '.port')
|
||||
|
||||
# randomly select one of the available write tokens from the config
|
||||
TOKEN_COUNT=$(echo "$CONFIG" | jq -r '.write_tokens | length')
|
||||
RANDOM_INDEX=$((RANDOM % TOKEN_COUNT))
|
||||
WRITE_TOKEN=$(echo "$CONFIG" | jq -r ".write_tokens[$RANDOM_INDEX]")
|
||||
echo "Using token index $RANDOM_INDEX out of $TOKEN_COUNT available tokens"
|
||||
# Use plaintext tokens from environment (set by generate_test_config.sh or manually)
|
||||
# The config file should only contain hashed tokens
|
||||
if [ -n "${TEST_TOKEN1:-}" ] && [ -n "${TEST_TOKEN2:-}" ] && [ -n "${TEST_TOKEN3:-}" ]; then
|
||||
# Use environment tokens (plaintext)
|
||||
TOKENS=("$TEST_TOKEN1" "$TEST_TOKEN2" "$TEST_TOKEN3")
|
||||
TOKEN_COUNT=${#TOKENS[@]}
|
||||
RANDOM_INDEX=$((RANDOM % TOKEN_COUNT))
|
||||
WRITE_TOKEN="${TOKENS[$RANDOM_INDEX]}"
|
||||
echo "Using plaintext token index $RANDOM_INDEX from environment"
|
||||
else
|
||||
# For static test configs, use hardcoded plaintext tokens
|
||||
# These correspond to the hashes in the static sos_config.json
|
||||
TOKENS=("t570H7DmK2VBfCwUmtFaUXyzVklL90E1" "U3x9V39Y7rjXdRK0oxZsCz5lD6jFFDtm" "UhtchhGDEGXlJ37GumimFtPe0imjAvak")
|
||||
TOKEN_COUNT=${#TOKENS[@]}
|
||||
RANDOM_INDEX=$((RANDOM % TOKEN_COUNT))
|
||||
WRITE_TOKEN="${TOKENS[$RANDOM_INDEX]}"
|
||||
echo "Using hardcoded plaintext token index $RANDOM_INDEX (for static config)"
|
||||
fi
|
||||
|
||||
# Upload the file
|
||||
echo "Uploading file..."
|
||||
|
Reference in New Issue
Block a user