Skip to content
Merged
Show file tree
Hide file tree
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
36 changes: 36 additions & 0 deletions docs/scanner-usage-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ static/version accounting probes. Metadata-specific probes return
`UNSUPPORTED`; a missing carried/observed sampling window is `BLOCKED`.
The adapter never derives a certificate from `last_update` or collection time.

Every public Admin sample now carries a scanner-cycle observation in the
evidence record. The sample must contain a non-negative `scanner_cycle`; cycle
values may stay equal while a bucket is being polled, but they may never move
backwards. When `scanner_epoch` is exposed, the epoch must remain stable for
the probe. A missing cycle, a malformed epoch, a cycle regression, or an epoch
change is a product failure and cannot be retried into a pass. This binds the
public usage result to a real scanner snapshot without claiming private
frontier or acknowledgement evidence.

Default request timeout is 30 seconds, convergence timeout 600 seconds, and
poll interval 5 seconds. `--objects` defaults to 32 and is bounded at 100000.
These are test deadlines and fixture controls, not RustFS runtime changes.
Expand Down Expand Up @@ -233,3 +242,30 @@ bash test_validation_scanner_usage.sh

The local test doubles verify error handling and assertion gates; their PASS
results are not product or VM acceptance results.

## First-batch ILM branch coverage

The accelerated ILM harness keeps one canonical case per lifecycle behavior
and records the exact version inventory for versioned cases. The first batch
now enforces these additional boundaries:

- Configuration round-trip requires exactly the requested rules, including
status, prefix, and expiration days. Unknown or silently rewritten rules
fail the case.
- Invalid configuration covers negative days, invalid status, missing status,
and duplicate rule identifiers. Each request must be rejected before any
configuration is persisted.
- Tag filtering derives an independent due window for both the matching and
control objects. Early deletion fails, and the control object must remain
readable after the matching object expires.
- Versioned current expiration requires one latest delete marker and exactly
one retained data version. Noncurrent expiration checks the exact retained
IDs, the absence of extra markers, and the retained payload bytes.
- Newer-noncurrent retention checks all retained payloads. Delete-all-versions
and delete-marker expiration require an empty version and marker inventory.
- Incomplete multipart expiration requires the upload to disappear, its parts
to be inaccessible, and no visible object to remain.

Pure inventory checks live in `scripts/validation_ilm/oracles.py` and are
covered by `test_validation_ilm.py`. The live harness writes each inventory
and timing observation as evidence under the selected case directory.
850 changes: 850 additions & 0 deletions docs/source-test-migration-inventory.md

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions docs/validation-heal-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,27 @@ The goal is not only to prove that "GET still works after a disk goes bad", but
4. Objects, historical versions, delete semantics, concurrent successful writes, and persisted responsibility are correct.
5. The raw evidence is complete, temporary faults have been cleared, and the environment can be handed back safely.

### Availability and census invariants

All reusable external-shard cases apply the same availability checks before
and after a fault. The observed node set must remain identical, so a missing
or silently added node cannot hide an unavailable member. Physical repair
checks apply the same membership rule before comparing files, formats,
metadata, sidecars, and rebuilt shards.

Every S3 census validates its object/version identities, object-and-marker
count, logical bytes, version-list page sizes, and current-list page sizes.
Recovery comparisons accept an empty bucket when its counters and pagination
prove that state. A census with missing, inconsistent, duplicated, or
truncated summary evidence cannot authorize a recovery result.

An empty legacy manifest is accepted only when its completeness counters and
pagination summaries prove that the census was actually collected. Version
and current-object page summaries must be present and must equal the complete
manifest totals. Expected ACK-derived manifests use a separate entry-only
comparison so their intentionally changed counters cannot bypass validation of
an observed census.

## Versions and verified product boundaries

Interface references come from the RustFS and rc commits recorded in the source design, and the source links below are retained for traceability. Each execution batch is still governed by the exact source, package, installed-binary digest, and auto-testing/rc digest in the current candidate manifest. A pass for this candidate is not inferred from the validation results of a historical version.
Expand Down
63 changes: 63 additions & 0 deletions docs/validation-migration-map.md
Original file line number Diff line number Diff line change
Expand Up @@ -410,12 +410,54 @@ Together with the earlier four mixed-branch audits, sixteen branch instances now
| Heal | 84 | `rustfs_heal_test.sh`, `rustfs-fault-tolerance-test.sh` | Existing fault flows are useful helpers, but each A-J procedure requires its own fixture, fault, public assertion, and cleanup evidence. |
| Planned | 8 | KMS, Tier/Event/Audit, Security, S3, Storage suites | Existing tests may implement the behavior; compare each source assertion before promoting it. |

The second migration batch adds shared availability gates to the existing Heal
executors. Physical fault and repair snapshots must retain exactly the same
observed node membership. S3 recovery comparisons now validate unique
object/version identities, object-and-marker counts, logical bytes, and both
version-list and current-list pagination summaries. Empty censuses are valid
only when their completeness counters and page summaries prove that state.
Empty legacy manifests are rejected without completeness evidence, truncated
version listings are rejected, and ACK-derived expected manifests use a
separate entry comparison from collected census validation.
The 84-case dispatch table and its source branches remain unchanged.

`s3.basic-object-round-trip` now has a dedicated executor on `single-1disk`.
Its Bash function combines bucket creation/removal, object PUT/HEAD/GET/LIST/
DELETE, payload SHA-256, metadata, ETag, and `NoSuchKey` checks on one fixture.
It has local mock coverage and live PASS evidence in RustFS Actions run
`38042083422`.

The compatibility suite now has a local catalog entry for every existing
`S3C`, `ENC`, and `SNW` procedure in `rustfs-s3-compat-test.sh`. The 105
procedures reuse the existing test functions and are individually dispatchable
through `scripts/run_validation_case.sh` as
`s3.compatibility.<procedure-id>`. Each procedure keeps its own endpoint
admission, candidate provenance, result evidence, and cleanup gate. This local
catalog extension does not change the 158 source-catalog IDs.

The existing storage, security, tier, and key-management suite procedures are
also indexed as 110 local `source-procedure.*` entries. Their original suite
functions remain the execution source, and the dispatcher now selects one
procedure at a time with candidate and endpoint admission. Their live status
still depends on the configured environment and is not inferred from catalog
registration.

The table-catalog suite contributes 7 additional `source-procedure.table.*`
entries, and the upgrade suite contributes 18
`source-procedure.upgrade.*` entries. Both suites select one existing
procedure in dry-run mode and retain the original case-level assertions and
diagnostics. The local catalog therefore contains 260 executable procedure
entries in addition to the 158 canonical source scenarios.

The complete source-audit crosswalk is recorded in
`docs/source-test-migration-inventory.md`. It enumerates all 18 workflows, 17
listed helper entries, 243 test files, and every extracted test or benchmark
identifier. Behavior procedures are linked to canonical or local executors.
Source-native checks, generated serialization tests, and benchmarks supply
assertion ideas and boundary cases to the target procedures without requiring
one-to-one black-box copies. Build or repository automation remains classified
as automation reference material.

`scanner.usage-convergence` has a dedicated executor on `single-4disk`. It
uses the storage suite's deployment and SigV4 Admin client, accelerates the
scanner cycle, records the 20-object fixture, and checks a successful leader
Expand All @@ -429,6 +471,27 @@ scanner runtime settings and requires exactly one leader to finish a new
successful cycle within 120 seconds. Its live candidate run passed in RustFS
Actions run `38044125099`.

The first-batch follow-up also validates the public usage snapshot identity.
Each Admin sample must expose a non-negative scanner cycle, must not regress
within an endpoint, and must keep a stable scanner epoch when one is exposed.
The ILM harness now checks exact version and delete-marker inventories for
current expiration, noncurrent retention, delete-all-versions, and marker
expiration. It also checks strict rule round-trips, four invalid-configuration
branches, independent tag-filter due windows, and incomplete multipart cleanup.
These checks are implemented in `scripts/validation_scanner_usage/cycle.py`,
`scripts/validation_ilm/oracles.py`, and their focused unit tests. They do not
replace the required live candidate evidence.

The third-batch replication follow-up strengthens the existing bucket and site
executors without duplicating their case dispatch. Rejected target-versioning
configuration now proves that no usable rule persisted. Delete-marker,
permanent-version-delete, bidirectional-object, and site-delete cases require
an exact target inventory with no extra versions or markers. Object convergence
also checks the advertised content length, and resync now retains a stable
operation ID through cancellation or a terminal status. The pure inventory
oracle lives in `scripts/validation_replication/oracles.py` with focused
regression tests in `test_validation_replication.py`.

The 14 remaining ILM IDs now dispatch to the source ILM black-box behavior
checks under `scripts/validation_ilm`. The Storage suite deploys the same
two-node/four-disk source topology on current auto-testing nodes with the
Expand Down
23 changes: 20 additions & 3 deletions rustfs-kms-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ VOLUMES=""
KMS_BACKEND="local"
KMS_EXTRA_ENV="${KMS_EXTRA_ENV:-}"
VALIDATION_CASE=""
VALIDATION_SOURCE_CASE_ID=""
SELECTED_CASES=""
VALIDATION_ARTIFACTS_DIR=""
VALIDATION_CANDIDATE_MANIFEST=""
VALIDATION_TESTING_COMMIT=""
Expand Down Expand Up @@ -697,6 +699,12 @@ FAILED_TESTS=()

run_test() {
local id="$1" name="$2" fn="$3" out rc
if [ -n "${SELECTED_CASES:-}" ]; then
case ",${SELECTED_CASES:-}," in
*",${id},"*) ;;
*) return 0 ;;
esac
fi
if [ "${DRY_RUN}" -eq 1 ]; then
printf ' [DRY-RUN] %s %s\n' "${id}" "${name}"
return 0
Expand Down Expand Up @@ -739,7 +747,7 @@ validation_write_result() {
--binary-sha256 "${VALIDATION_BINARY_SHA256}"
--evidence "evidence/${VALIDATION_CASE}/test.log")
fi
if [ "${verdict}" = PASS ]; then
if [ "${verdict}" = PASS ] && [ "${VALIDATION_CASE}" = "kms.sse-kms-round-trip" ]; then
for item in validation-put.json validation-head.json validation-get.json validation-failure.txt validation-missing.txt validation-fixture.json; do
args+=(--evidence "evidence/${VALIDATION_CASE}/${item}")
done
Expand Down Expand Up @@ -2281,6 +2289,7 @@ main() {
--log-file) LOG_FILE="$1"; shift ;;
--dry-run) DRY_RUN=1 ;;
--validation-case) VALIDATION_CASE="$1"; shift ;;
--cases) SELECTED_CASES="${SELECTED_CASES:+${SELECTED_CASES},}$1"; shift ;;
--validation-artifacts-dir) VALIDATION_ARTIFACTS_DIR="$1"; shift ;;
--candidate-manifest) VALIDATION_CANDIDATE_MANIFEST="$1"; shift ;;
--testing-commit) VALIDATION_TESTING_COMMIT="$1"; shift ;;
Expand All @@ -2301,7 +2310,13 @@ main() {
SELECTED_TOPOLOGIES=("${TOPO_SINGLE_SINGLE}" "${TOPO_SINGLE_MULTI}" "${TOPO_MULTI_MULTI}")
fi
if [ -n "${VALIDATION_CASE}" ]; then
[ "${VALIDATION_CASE}" = "kms.sse-kms-round-trip" ] || die "unknown validation case: ${VALIDATION_CASE}"
case "${VALIDATION_CASE}" in
kms.sse-kms-round-trip) ;;
source-procedure.kms.*)
VALIDATION_SOURCE_CASE_ID="$(printf '%s' "${VALIDATION_CASE#source-procedure.kms.}" | tr '[:lower:]' '[:upper:]')"
SELECTED_CASES="${VALIDATION_SOURCE_CASE_ID}" ;;
*) die "unknown validation case: ${VALIDATION_CASE}" ;;
esac
[ "${all}" -eq 0 ] || die "--validation-case cannot be combined with --all-topologies"
[ "${#SELECTED_TOPOLOGIES[@]}" -eq 0 ] || die "--validation-case chooses its own topology"
[ "${KEEP_ENV}" -eq 0 ] || die "--validation-case requires environment teardown"
Expand Down Expand Up @@ -2361,7 +2376,9 @@ main() {
fi
PASS=0; FAIL=0; UNSUPPORTED=0; FAILED_TESTS=()
KMS_KEY_ID=""
if [ -n "${VALIDATION_CASE}" ]; then
if [[ "${VALIDATION_CASE}" == source-procedure.kms.* ]]; then
run_all_tests
elif [ -n "${VALIDATION_CASE}" ]; then
run_test "${VALIDATION_CASE}" "SseKmsRoundTrip" test_validation_kms_sse_kms_round_trip
else
run_all_tests
Expand Down
44 changes: 33 additions & 11 deletions rustfs-s3-compat-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ KEEP_ENV=0
LOG_FILE=""
SELECTED_TOPOLOGIES=()
VALIDATION_CASE=""
VALIDATION_SELECTED_CASE=""
VALIDATION_ARTIFACTS_DIR=""
VALIDATION_CANDIDATE_MANIFEST=""
VALIDATION_TESTING_COMMIT=""
Expand Down Expand Up @@ -472,8 +473,8 @@ SELECTED_CASES=""
# run_test <id> <name> <function>
run_test() {
local id="$1" name="$2" fn="$3" out rc
if [ -n "${SELECTED_CASES}" ]; then
case ",${SELECTED_CASES}," in
if [ -n "${SELECTED_CASES:-}" ]; then
case ",${SELECTED_CASES:-}," in
*",${id},"*) ;;
*) return 0 ;;
esac
Expand Down Expand Up @@ -503,9 +504,11 @@ validation_write_evidence() {
local item
mkdir -p "${evidence_dir}"
cp "${TEST_TMP}/test.out" "${evidence_dir}/test.log"
for item in validation-put.json validation-head.json validation-list.json validation-missing.txt; do
if [ -f "${TEST_TMP}/${item}" ]; then cp "${TEST_TMP}/${item}" "${evidence_dir}/${item}"; fi
done
if [ "${VALIDATION_CASE}" = "s3.basic-object-round-trip" ]; then
for item in validation-put.json validation-head.json validation-list.json validation-missing.txt; do
if [ -f "${TEST_TMP}/${item}" ]; then cp "${TEST_TMP}/${item}" "${evidence_dir}/${item}"; fi
done
fi
}

validation_write_result() {
Expand All @@ -532,10 +535,12 @@ validation_write_result() {
args+=(--evidence "evidence/${VALIDATION_CASE}/test.log")
fi
if [ "${verdict}" = PASS ]; then
local item
for item in validation-put.json validation-head.json validation-list.json validation-missing.txt; do
args+=(--evidence "evidence/${VALIDATION_CASE}/${item}")
done
if [ "${VALIDATION_CASE}" = "s3.basic-object-round-trip" ]; then
local item
for item in validation-put.json validation-head.json validation-list.json validation-missing.txt; do
args+=(--evidence "evidence/${VALIDATION_CASE}/${item}")
done
fi
fi
python3 "${args[@]}"
}
Expand Down Expand Up @@ -3240,7 +3245,14 @@ main() {
SELECTED_TOPOLOGIES=("${TOPO_SINGLE_SINGLE}" "${TOPO_SINGLE_MULTI}" "${TOPO_MULTI_MULTI}")
fi
if [ -n "${VALIDATION_CASE}" ]; then
[ "${VALIDATION_CASE}" = "s3.basic-object-round-trip" ] || die "unknown validation case: ${VALIDATION_CASE}"
case "${VALIDATION_CASE}" in
s3.basic-object-round-trip) ;;
s3.compatibility.*)
VALIDATION_SELECTED_CASE="$(printf '%s' "${VALIDATION_CASE#s3.compatibility.}" | tr '[:lower:]' '[:upper:]')"
[ -n "${VALIDATION_SELECTED_CASE}" ] || die "unknown validation case: ${VALIDATION_CASE}"
;;
*) die "unknown validation case: ${VALIDATION_CASE}" ;;
esac
[ -z "${SELECTED_CASES}" ] || die "--validation-case cannot be combined with --suite or --cases"
[ "${all}" -eq 0 ] || die "--validation-case cannot be combined with --all-topologies"
[ "${#SELECTED_TOPOLOGIES[@]}" -eq 0 ] || die "--validation-case chooses its own topology"
Expand Down Expand Up @@ -3291,13 +3303,23 @@ main() {
if [ -n "${VALIDATION_CASE}" ] && [ "${DRY_RUN}" -eq 0 ]; then
validation_write_result RUNNING "validation case started" PENDING
fi
if [ "${DRY_RUN}" -eq 0 ] && [ -n "${VALIDATION_SELECTED_CASE}" ]; then
case ",${VALIDATION_SELECTED_CASE}," in
*,S3C-213,*|*,S3C-214,*|*,S3C-1306,*|*,S3C-1307,*)
"${S3_BULK_PYTHON}" -c 'import boto3' >/dev/null 2>&1 || die "bulk-delete regressions require Python boto3"
;;
esac
fi
if [ -n "${VALIDATION_SELECTED_CASE}" ]; then
SELECTED_CASES="${VALIDATION_SELECTED_CASE}"
fi
env_setup "${topo}"
if [ -n "${VALIDATION_CASE}" ] && [ "${DRY_RUN}" -eq 0 ]; then
VALIDATION_BINARY_SHA256="$(printf 'sha256sum /usr/bin/rustfs\n' | run_remote "${NODES[0]}" | awk '{print $1}')"
[[ "${VALIDATION_BINARY_SHA256}" =~ ^[0-9a-f]{64}$ ]] || die "installed RustFS binary SHA-256 unavailable"
fi
PASS=0; FAIL=0; UNSUPPORTED=0; SCHEDULED=0; FAILED_TESTS=()
if [ -n "${VALIDATION_CASE}" ]; then
if [ "${VALIDATION_CASE}" = "s3.basic-object-round-trip" ]; then
run_test "${VALIDATION_CASE}" "BasicObjectRoundTrip" test_validation_s3_basic_object_round_trip
else
run_all_tests
Expand Down
Loading