Files
simple-object-server/testing
Your Name 8ab6028597
Some checks failed
Build-Test-Publish / build (linux/amd64) (push) Failing after 22s
Build-Test-Publish / build (linux/arm64) (push) Failing after 32s
Build-Test-Publish / create-manifest (push) Has been skipped
test: Add 8 and update 14 files
2025-08-10 21:18:40 +12:00
..
2025-08-10 21:18:40 +12:00
2025-08-10 15:55:36 +12:00
2025-08-10 21:18:40 +12:00
2025-08-10 21:18:40 +12:00
2025-08-10 21:18:40 +12:00
2025-08-10 21:18:40 +12:00
2025-08-10 21:18:40 +12:00

Testing Documentation

Security Note

Authentication tokens are now generated dynamically for each test run to prevent hardcoded credentials in the repository.

Configuration

Automatic Token Generation

The test scripts automatically generate secure random tokens before each test run using generate_test_config.sh. This ensures:

  • No hardcoded tokens in version control
  • Different tokens for each test run
  • Cryptographically secure random token generation

Manual Configuration

If you need to manually create a configuration:

  1. Copy the example template:

    cp sos_config.json.example sos_config.json
    
  2. Replace the placeholder tokens with secure values:

    # Generate secure tokens
    openssl rand -base64 32
    
  3. Update the sos_config.json file with your generated tokens

Test Scripts

  • test.sh - Main integration test suite (randomly selects from available tokens)
  • test_1GB_file_upload.sh - Large file upload test (randomly selects from available tokens)
  • test-docker.sh - Docker-based test runner (generates config automatically)
  • generate_test_config.sh - Generates test configuration with random tokens

Token Selection

Test scripts randomly select one of the available tokens for each test run, ensuring all tokens are exercised during testing.

Running Tests

Local Testing

./test.sh http://localhost:7703

Docker Testing

./test-docker.sh

The Docker test automatically:

  1. Builds the application
  2. Generates random test tokens
  3. Runs the full test suite
  4. Cleans up containers

Security Best Practices

  1. Never commit sos_config.json - It's in .gitignore for security
  2. Use strong tokens in production - At least 32 characters of random data
  3. Rotate tokens regularly - Generate new tokens periodically
  4. Store tokens securely - Use environment variables or secure vaults in production