diff options
Diffstat (limited to 'test/apiv2')
-rw-r--r-- | test/apiv2/12-imagesMore.at | 18 | ||||
-rw-r--r-- | test/apiv2/rest_api/test_rest_v2_0_0.py | 8 |
2 files changed, 26 insertions, 0 deletions
diff --git a/test/apiv2/12-imagesMore.at b/test/apiv2/12-imagesMore.at index fe6a271ce..4f3ddf925 100644 --- a/test/apiv2/12-imagesMore.at +++ b/test/apiv2/12-imagesMore.at @@ -3,6 +3,9 @@ # Tests for more image-related endpoints # +red='\e[31m' +nc='\e[0m' + podman pull -q $IMAGE t GET libpod/images/json 200 \ @@ -26,6 +29,17 @@ t GET libpod/images/$IMAGE/json 200 \ podman run -d --name registry -p 5000:5000 quay.io/libpod/registry:2.6 /entrypoint.sh /etc/docker/registry/config.yml wait_for_port localhost 5000 +# Push to local registry and check output +while read -r LINE +do + if echo "${LINE}" | jq --exit-status 'select( .status != null) | select ( .status | contains("digest: sha256:"))' &>/dev/null; then + GOT_DIGEST="1" + fi +done < <(curl -sL "http://$HOST:$PORT/images/localhost:5000/myrepo/push?tlsVerify=false&tag=mytag" -XPOST) +if [ -z "${GOT_DIGEST}" ] ; then + echo -e "${red}not ok: did not found digest in output${nc}" 1>&2; +fi + # Push to local registry t POST "images/localhost:5000/myrepo/push?tlsVerify=false&tag=mytag" '' 200 @@ -43,3 +57,7 @@ t DELETE libpod/images/$IMAGE 200 \ .ExitCode=0 t DELETE libpod/images/quay.io/libpod/registry:2.6 200 \ .ExitCode=0 + +if [ -z "${GOT_DIGEST}" ] ; then + exit 1; +fi diff --git a/test/apiv2/rest_api/test_rest_v2_0_0.py b/test/apiv2/rest_api/test_rest_v2_0_0.py index 73db35cc1..05c24f2ea 100644 --- a/test/apiv2/rest_api/test_rest_v2_0_0.py +++ b/test/apiv2/rest_api/test_rest_v2_0_0.py @@ -483,8 +483,16 @@ class TestApi(unittest.TestCase): inspect = requests.get(PODMAN_URL + f"/v1.40/networks/{ident}") self.assertEqual(inspect.status_code, 404, inspect.content) + # network prune + prune_name = "Network_" + "".join(random.choice(string.ascii_letters) for i in range(10)) + prune_create = requests.post(PODMAN_URL + "/v1.40/networks/create", json={"Name": prune_name}) + self.assertEqual(create.status_code, 201, prune_create.content) + prune = requests.post(PODMAN_URL + "/v1.40/networks/prune") self.assertEqual(prune.status_code, 200, prune.content) + obj = json.loads(prune.content) + self.assertTrue(prune_name in obj["NetworksDeleted"]) + def test_volumes_compat(self): name = "Volume_" + "".join(random.choice(string.ascii_letters) for i in range(10)) |