diff --git a/.github/workflows/environment-compatibility-tests.yml b/.github/workflows/environment-compatibility-tests.yml new file mode 100644 index 0000000..bf21500 --- /dev/null +++ b/.github/workflows/environment-compatibility-tests.yml @@ -0,0 +1,71 @@ +name: Environment Compatibility Tests + +on: + pull_request: + paths: + - rustfs-table-test.sh + - rustfs-replication-test.sh + - rustfs-security-test.sh + - rustfs-upgrade-test.sh + - rustfs_performance_test.sh + - scripts/check_execution_environment.py + - scripts/lib/** + - test_check_execution_environment.py + - test_rustfs_table.py + - test_rustfs_performance_testing.py + - test_rustfs_replication.py + - .github/workflows/environment-compatibility-tests.yml + push: + branches: [main] + paths: + - rustfs-table-test.sh + - rustfs-replication-test.sh + - rustfs-security-test.sh + - rustfs-upgrade-test.sh + - rustfs_performance_test.sh + - scripts/check_execution_environment.py + - scripts/lib/** + - test_check_execution_environment.py + - test_rustfs_table.py + - test_rustfs_performance_testing.py + - test_rustfs_replication.py + - .github/workflows/environment-compatibility-tests.yml + +permissions: + contents: read + +jobs: + environment-compatibility: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a + with: + persist-credentials: false + - name: Validate shell syntax + run: | + for script in \ + rustfs-table-test.sh \ + rustfs-replication-test.sh \ + rustfs-security-test.sh \ + rustfs-upgrade-test.sh \ + rustfs_performance_test.sh + do + bash -n "${script}" + done + test -x rustfs-security-test.sh + test -x rustfs-upgrade-test.sh + - name: Test portable execution helpers + run: >- + python3 -B -m unittest -v + test_check_execution_environment.py + test_rustfs_table.py + test_rustfs_performance_testing.py + test_rustfs_replication.py + - name: Test missing HOME + run: env -u HOME bash test_rustfs_pool_expand.sh + - name: Smoke-test environment preflight + run: >- + python3 scripts/check_execution_environment.py + --command bash + --minimum-bash-major 4 diff --git a/README.md b/README.md index faf00fe..04f743a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,31 @@ # auto-testing Auto testing scripts +## Portable execution environments + +The suite defaults and CI topology remain unchanged. Local fleets can run the +read-only compatibility preflight before any mutation: + +```bash +python3 scripts/check_execution_environment.py \ + --command aws --command curl --command jq --command openssl --command ssh \ + --minimum-bash-major 4 \ + --check-aws-list-objects \ + --data-root /data/rustfs --drive-count 4 \ + --minimum-free-gib 40 --require-distinct-devices \ + --require-port 18080 +``` + +The command prints JSON and exits `2` when a requirement is blocked. It does +not create files, install packages, or change test behavior. A local VM that +maps separate data disks to `/data/rustfs1` through `/data/rustfs4` can remove +the root-filesystem disk-check bypass used by ad hoc single-disk deployments. + +The tier webhook receiver is configurable with `RUSTFS_RECEIVER_PORT`; choose a +port that does not conflict with the local package server or another service. +All top-level suite entrypoints are directly executable; `bash