From 1932c243dda72bfeb923da597744dd5e638de118 Mon Sep 17 00:00:00 2001 From: Ming-Hung Tsai Date: Tue, 21 Jul 2020 20:39:25 +0800 Subject: [PATCH] [thin_check] Add functional tests for incompatible options --- functional-tests/thin-functional-tests.scm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/functional-tests/thin-functional-tests.scm b/functional-tests/thin-functional-tests.scm index d5e5d00..a771bd7 100644 --- a/functional-tests/thin-functional-tests.scm +++ b/functional-tests/thin-functional-tests.scm @@ -95,6 +95,24 @@ "Unrecognised option should cause failure" (run-fail (thin-check "--hedgehogs-only"))) + (define-scenario (thin-check incompatible-options fix-metadata-leaks) + "Incompatible options should cause failure" + (with-valid-metadata (md) + (run-fail (thin-check "--fix-metadata-leaks" "-m" md)) + (run-fail (thin-check "--fix-metadata-leaks" "--override-mapping-root 123" md)) + (run-fail (thin-check "--fix-metadata-leaks" "--super-block-only" md)) + (run-fail (thin-check "--fix-metadata-leaks" "--skip-mappings" md)) + (run-fail (thin-check "--fix-metadata-leaks" "--ignore-non-fatal-errors" md)))) + + (define-scenario (thin-check incompatible-options clear-needs-check-flag) + "Incompatible options should cause failure" + (with-valid-metadata (md) + (run-fail (thin-check "--clear-needs-check-flag" "-m" md)) + (run-fail (thin-check "--clear-needs-check-flag" "--override-mapping-root 123" md)) + (run-fail (thin-check "--clear-needs-check-flag" "--super-block-only" md)) + (run-fail (thin-check "--clear-needs-check-flag" "--skip-mappings" md)) + (run-fail (thin-check "--clear-needs-check-flag" "--ignore-non-fatal-errors" md)))) + (define-scenario (thin-check superblock-only-valid) "--super-block-only check passes on valid metadata" (with-valid-metadata (md)