From 7b51acd4c4140c6fe7f262936c0eee8db2f0cacb Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Tue, 14 Dec 2021 13:44:39 -0700 Subject: APIv2 tests: fail on syntax/logic errors (i.e. not test failures, but actual programming bugs). We've had a number of syntax errors creep into this test, usually caused by a missing backslash on a test command. I've long wanted to 'set -e' but that causes other problems. This PR introduces error handling via 'trap', with useful diagnostics on failure. This PR also catches and fixes two previously-unknown bugs that were causing tests to not actually run. And, since /events takes eons on my high-uptime laptop, add /since Signed-off-by: Ed Santiago --- test/apiv2/20-containers.at | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/apiv2/20-containers.at') diff --git a/test/apiv2/20-containers.at b/test/apiv2/20-containers.at index 748a0750f..e931ceebe 100644 --- a/test/apiv2/20-containers.at +++ b/test/apiv2/20-containers.at @@ -97,7 +97,7 @@ t GET libpod/containers/${cid}/json 200 \ t DELETE libpod/containers/$cid 204 CNAME=myfoo -podman run --name $CNAME $IMAGE -td top +podman run -d --name $CNAME $IMAGE top t GET libpod/containers/json?all=true 200 \ .[0].Id~[0-9a-f]\\{64\\} cid=$(jq -r '.[0].Id' <<<"$output") @@ -184,7 +184,7 @@ t GET containers/myctr/json 200 \ t DELETE images/localhost/newrepo:latest?force=true 200 t DELETE images/localhost/newrepo:v1?force=true 200 t DELETE images/localhost/newrepo:v2?force=true 200 -t DELETE libpod/containers/$cid 204 +t DELETE libpod/containers/$cid?force=true 204 t DELETE libpod/containers/myctr 204 t DELETE libpod/containers/bogus 404 -- cgit v1.2.3-54-g00ecf