[functional-tests] fix up some tests.

This commit is contained in:
Joe Thornber 2017-09-20 17:13:03 +01:00
parent 5814fea96a
commit 7079b1ec9e
3 changed files with 13 additions and 10 deletions

View File

@ -170,7 +170,7 @@
(with-empty-metadata (md)
(receive (stdout stderr) (run-fail "era_restore" "--quiet" "-i" bad-xml "-o" md)
(assert-eof stdout)
(assert-eof stderr)))))
(assert-starts-with "Couldn't stat file" stderr)))))
(define-scenario (era-restore q-fail)
"No output with --q(failing)"
@ -178,7 +178,7 @@
(with-empty-metadata (md)
(receive (stdout stderr) (run-fail "era_restore" "-q" "-i" bad-xml "-o" md)
(assert-eof stdout)
(assert-eof stderr)))))
(assert-starts-with "Couldn't stat file" stderr)))))
(define-scenario (era-dump restore-is-noop)
"era_dump followed by era_restore is a noop."

View File

@ -49,16 +49,18 @@
(if (pred exit-code)
(values stdout stderr)
(begin
(info (fmt #f (dsp "stdout: ") stdout))
(info (fmt #f (dsp "stderr: ") stderr))
(fail (fmt #f (dsp "unexpected exit code (")
(num exit-code)
(dsp ")")))))))
(let ((msg (fmt #f "unexpected exit code (" exit-code ")")))
(info msg)
(fail msg))))))
(define (run-ok . cmd-and-args)
(run-with-exit-code zero? cmd-and-args))
;; Exit code 139 is a segfault, which is not acceptable
(define (run-fail . cmd-and-args)
(define (not-zero? x) (not (zero? x)))
(define (fails? x) (not
(or (= 139 x)
(zero? x))))
(run-with-exit-code fails? cmd-and-args)))
(run-with-exit-code not-zero? cmd-and-args)))

View File

@ -109,13 +109,14 @@ Options:
{--repair}")
(define cache-metadata-size-help
"Usage: cache_metadata_size [options]
"Usage: cache_metadata_size [options]
Options:
{-h|--help}
{-V|--version}
{--block-size <sectors>}
{--device-size <sectors>}
{--nr-blocks <natural>}
{--max-hint-width <nr bytes>}
These all relate to the size of the fast device (eg, SSD), rather
than the whole cached device.")