[thin_check] Add functional tests for incompatible options

This commit is contained in:
Ming-Hung Tsai 2020-07-21 20:39:25 +08:00
parent 7b2a18a865
commit 1932c243dd
1 changed files with 18 additions and 0 deletions

View File

@ -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)