summaryrefslogtreecommitdiff
path: root/test/system/160-volumes.bats
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2021-09-28 07:13:51 -0600
committerEd Santiago <santiago@redhat.com>2021-09-30 13:32:51 -0600
commitbf94ebf423931f6cd848126372fe558c8b956dcc (patch)
treedc585c17a1a41a80bd64407042e3a108d06b508e /test/system/160-volumes.bats
parentba72b17d28ff897d6721a227c615fcd511ca2e7a (diff)
downloadpodman-bf94ebf423931f6cd848126372fe558c8b956dcc.tar.gz
podman-bf94ebf423931f6cd848126372fe558c8b956dcc.tar.bz2
podman-bf94ebf423931f6cd848126372fe558c8b956dcc.zip
System tests: tighten 'is' operator
Fix day-one sloppiness: when I first wrote this framework it compared strings using 'expr', not '=', to be more forgiving of extra cruft in output. This was a bad decision. It means that warnings or additional text are ignored: is "all is ok, NOT!" "all is ok" <-- this would pass Solution: tighten up the 'is' check. Use '=' (direct compare) first. If it fails, look for wild cards ('*') or character classes ('[') in the expect string. If so, and only then, use 'expr'. And, thanks to a clever suggestion from Luap99, include '(using expr)' in the error message when we do so; this could make it easier for a developer to understand a string mismatch. This change exposes a lot of instances in which we weren't doing proper comparisons. Fix those. Thankfully, there weren't as many as I'd feared. Also, and completely unrelated, add '-T' flag to bats helper, for showing timing results. (I will open this as a separate PR if requested. I too find it offensive to jumble together unrelated commits.) Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test/system/160-volumes.bats')
-rw-r--r--test/system/160-volumes.bats3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/system/160-volumes.bats b/test/system/160-volumes.bats
index e21be9ea4..b48198a18 100644
--- a/test/system/160-volumes.bats
+++ b/test/system/160-volumes.bats
@@ -261,7 +261,8 @@ EOF
# prune should remove v4
run_podman volume prune --force
- is "$output" "${v[4]}" "volume prune, with 1, 2, 3 in use, deletes only 4"
+ is "$(echo $(sort <<<$output))" "${v[4]} ${v[5]} ${v[6]}" \
+ "volume prune, with 1, 2, 3 in use, deletes only 4, 5, 6"
# Remove the container using v2 and v3. Prune should now remove those.
# The 'echo sort' is to get the output sorted and in one line.