mirror of
https://github.com/rustfs/rustfs.git
synced 2026-11-30 20:57:35 +00:00
97d30eaccf
* test(security): add fuzzing, rejection mutants, and obs fault tests Add sigv4_request and notify_xml libFuzzer targets with seed corpora and unit tests, wire fuzz.yml as a workflow_call security-input-gate in CI with trusted changed-path selection, and add fixed rejection-branch mutation verification in isolated workspaces. Verify #[path] coverage attribution with canonical path merging in coverage_per_crate.py, sanitize OTLP startup endpoint logging, and add connect_logs lease/fault regressions, local fake-OTLP 401/500/refused/ timeout/redaction tests, and E2E observability export failure isolation tests. Refs: rustfs/backlog#2677, rustfs/backlog#2679 * fix(ci): stop sending deprecated policy field in s3-tests add-user rustfs/rustfs#9677 hardened /rustfs/admin/v3/add-user to fail closed when a non-empty deprecated policy field is provided. scripts/s3-tests/run.sh was still passing policy=readwrite in the add-user body even though it immediately calls set-user-or-group-policy right after, and awscurl returned exit 0 on XML <Error> responses so provisioning silently failed and broke all alt-user s3-tests. Remove the deprecated policy field from the add-user payload, check awscurl responses for XML <Error> elements in provisioning, and add a regression unit test in scripts/s3-tests/test_runner_tools.py. Refs: rustfs/backlog#1246 * fix(ci): run called validation gates and count wrapped coverage lines * fix(ci): fail S3 user provisioning on HTTP errors without logging responses * fix(iceberg): reject repeated warehouses before validating bucket names * test(ecstore): wait for relaxed writes on the foreground lane * test(quota): isolate concurrent real-disk probes in CI * ci: budget for cold instrumentation builds and validation rebuilds * test(ecstore): scope upload lock identity helper to its Linux test * test(ecstore): isolate namespace lock checks from runner disk latency * test(ecstore): wait for inline source publication before reading a disk * test(connect): isolate the durable receipt integration test
76 lines
2.3 KiB
Bash
76 lines
2.3 KiB
Bash
#!/bin/sh
|
|
# These tests exercise receipts or namespace locks using real ECStore files.
|
|
set -eu
|
|
|
|
self_test=false
|
|
if [ "${1:-}" = --self-test ]; then
|
|
self_test=true
|
|
shift
|
|
fi
|
|
fixture=${1:-receipt}
|
|
case "$fixture" in
|
|
receipt)
|
|
fixture_name="Receipt fixture"
|
|
# Two four-disk pools and 1,001 object/receipt pairs.
|
|
fixture_disk_count=8
|
|
fixture_peak_kib=32768
|
|
;;
|
|
namespace-locks)
|
|
fixture_name="Namespace lock fixture"
|
|
# Three small buckets share one four-disk store.
|
|
fixture_disk_count=4
|
|
fixture_peak_kib=4096
|
|
;;
|
|
*)
|
|
echo "Unknown temporary-directory fixture: $1" >&2
|
|
exit 2
|
|
;;
|
|
esac
|
|
|
|
# Each disk allocates a delete reserve. Leave additional space for metadata.
|
|
delete_reserve_per_disk_kib=8192
|
|
headroom_kib=16384
|
|
minimum_free_kib=$((fixture_peak_kib + fixture_disk_count * delete_reserve_per_disk_kib + headroom_kib))
|
|
|
|
tmpfs_is_eligible() {
|
|
[ "$1" = tmpfs ] && [ "$2" -ge "$minimum_free_kib" ]
|
|
}
|
|
|
|
if [ "$self_test" = true ]; then
|
|
if tmpfs_is_eligible tmpfs "$((minimum_free_kib - 1))"; then
|
|
echo "$fixture_name self-test: insufficient capacity must be rejected" >&2
|
|
exit 1
|
|
fi
|
|
# Hosted runners provision a 64 MiB shared-memory mount.
|
|
if tmpfs_is_eligible tmpfs 65536; then
|
|
[ "$fixture" = namespace-locks ]
|
|
else
|
|
[ "$fixture" = receipt ]
|
|
fi
|
|
tmpfs_is_eligible tmpfs "$minimum_free_kib"
|
|
if tmpfs_is_eligible ext4 "$minimum_free_kib"; then
|
|
echo "$fixture_name self-test: non-tmpfs mount must be rejected" >&2
|
|
exit 1
|
|
fi
|
|
echo "$fixture_name self-test: minimum ${minimum_free_kib} KiB"
|
|
exit 0
|
|
fi
|
|
|
|
if [ "$(uname -s)" != Linux ] || [ ! -d /dev/shm ] || [ ! -w /dev/shm ]; then
|
|
echo "$fixture_name: using the default temporary directory"
|
|
exit 0
|
|
fi
|
|
|
|
fs_type=$(stat -f -c %T /dev/shm 2>/dev/null || true)
|
|
free_kib=$(df -Pk /dev/shm 2>/dev/null | awk 'NR == 2 { print $4 }' || true)
|
|
case "$free_kib" in
|
|
''|*[!0-9]*) free_kib=0 ;;
|
|
esac
|
|
|
|
if tmpfs_is_eligible "$fs_type" "$free_kib"; then
|
|
printf 'TMPDIR=/dev/shm\n' >> "$NEXTEST_ENV"
|
|
echo "$fixture_name: using tmpfs with ${free_kib} KiB free"
|
|
else
|
|
echo "$fixture_name: using the default temporary directory (${free_kib} KiB free, ${minimum_free_kib} KiB required)"
|
|
fi
|