From f7bfcd89638b561edb6c7a41944b66be50362f45 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Fri, 27 Nov 2026 00:44:44 +0000 Subject: [PATCH] test: compare rotate output byte for byte The branch dropped the rotate check from the stability test, while COMPAT.md still promises it. rotate prints a fixed summary for this fixture, so the test compares its stdout and stderr with the recorded bytes again. --- tests/golden/stability/rotate.err | 0 tests/golden/stability/rotate.out | 1 + tests/test_output_stability.sh | 7 +++++++ 3 files changed, 8 insertions(+) create mode 100644 tests/golden/stability/rotate.err create mode 100644 tests/golden/stability/rotate.out diff --git a/tests/golden/stability/rotate.err b/tests/golden/stability/rotate.err new file mode 100644 index 0000000..e69de29 diff --git a/tests/golden/stability/rotate.out b/tests/golden/stability/rotate.out new file mode 100644 index 0000000..93be045 --- /dev/null +++ b/tests/golden/stability/rotate.out @@ -0,0 +1 @@ +eb-keep-logs rotate: 1 file compressed, 0 runs deleted under ROOT diff --git a/tests/test_output_stability.sh b/tests/test_output_stability.sh index fad344a..1d5593e 100755 --- a/tests/test_output_stability.sh +++ b/tests/test_output_stability.sh @@ -27,5 +27,12 @@ chmod +x "${work}/bin/eb" PATH="${work}/bin:${PATH}" "${tool}" failed 1 Foo-1.0 "${work}/logs-n" > "${work}/failed-n.out" 2> "${work}/failed-n.err" check "failed kept log byte-identical" "$(cmp -s "${golden}/failed.kept" "${work}/logs-n/Foo-1.0.failed.ebout.log" && echo ok)" "ok" +mkdir -p "${work}/rot-n/20261001_120000" +printf 'log line\n' > "${work}/rot-n/20261001_120000/a.log" +EB_KEEP_LOGS_NOW=1794873600 "${tool}" rotate "${work}/rot-n" --compress-after 5 > "${work}/rot-n.out" 2> "${work}/rot-n.err" +sed "s|${work}/rot-n|ROOT|g" "${work}/rot-n.out" > "${work}/rot-n.norm" +check "rotate stdout byte-identical" "$(cmp -s "${golden}/rotate.out" "${work}/rot-n.norm" && echo ok)" "ok" +check "rotate stderr byte-identical" "$(cmp -s "${golden}/rotate.err" "${work}/rot-n.err" && echo ok)" "ok" + echo "${fails} failed" [ "${fails}" -eq 0 ]