diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-04-22 06:30:49 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-22 06:30:49 -0400 |
commit | 82393e256593b9c78e64d2fecf47813b6c6f1b2c (patch) | |
tree | 01b9b47e9d7f55d9f7adb06ae12732a420f3682e /test/system/000-TEMPLATE | |
parent | 26a51b29009e6250f2b52fc7c13fb1b65208754e (diff) | |
parent | 97ee4114655a9442a34130632c47eea5861ca73b (diff) | |
download | podman-82393e256593b9c78e64d2fecf47813b6c6f1b2c.tar.gz podman-82393e256593b9c78e64d2fecf47813b6c6f1b2c.tar.bz2 podman-82393e256593b9c78e64d2fecf47813b6c6f1b2c.zip |
Merge pull request #13935 from edsantiago/bats_assert
system tests: add assert(), and start using it
Diffstat (limited to 'test/system/000-TEMPLATE')
-rw-r--r-- | test/system/000-TEMPLATE | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/system/000-TEMPLATE b/test/system/000-TEMPLATE index 85e25e921..a6a9ca141 100644 --- a/test/system/000-TEMPLATE +++ b/test/system/000-TEMPLATE @@ -10,7 +10,7 @@ load helpers @test "podman subcmd - description of this particular test" { args="some sort of argument list" run_podman subcmd $args - is "$output" "what we expect" "output from 'podman subcmd $args'" + assert "$output" == "what we expect" "output from 'podman subcmd $args'" } # vim: filetype=sh @@ -66,7 +66,7 @@ function teardown() { # FIXME: example of dprint. This will trigger if PODMAN_TEST_DEBUG=FOO # FIXME: ...or anything that matches the name assigned in the @test line. dprint "podman logs $cid -> '$output'" - is "$output" "what are we expecting?" "description of this check" + assert "$output" == "what are we expecting?" "description of this check" # Clean up run_podman rm $cid @@ -90,7 +90,7 @@ size | -\\\?[0-9]\\\+ run_podman history --format json $IMAGE # FIXME: parse_table is what does all the work, giving us test cases. - parse_table "$tests" | while read field expect; do + while read field expect; do # FIXME: this shows a drawback of BATS and bash: we can't include '|' # FIXME: in the table, but we need to because some images don't # FIXME: have a CID. So, yeah, this is ugly -- but rare. @@ -104,10 +104,10 @@ size | -\\\?[0-9]\\\+ # FIXME: please be sure to note the third field! # FIXME: that's the test name. Make it something useful! Include # FIXME: loop variables whenever possible. Don't just say "my test" - is "$actual" "$expect\$" "jq .[$i].$field" + assert "$actual" =~ "$expect\$" "jq .[$i].$field" i=$(expr $i + 1) done - done + done < <(parse_table "$tests") } |