Skip to content

Commit

Permalink
APIv2 test fix: image history
Browse files Browse the repository at this point in the history
I'm assuming this was buildah#5595: the COMMENT field moved around.
Deal with it, and add a few more checks while we're at it.

Signed-off-by: Ed Santiago <[email protected]>
  • Loading branch information
edsantiago committed Oct 11, 2024
1 parent f604593 commit 5fb4046
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
32 changes: 29 additions & 3 deletions test/apiv2/10-images.at
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,45 @@ t GET libpod/images/nonesuch/history 404
for i in $iid ${iid:0:12} $PODMAN_TEST_IMAGE_NAME:$PODMAN_TEST_IMAGE_TAG; do
t GET libpod/images/$i/history 200 \
.[0].Id=$iid \
.[1].Id="<missing>" \
.[2].Id="<missing>" \
.[3].Id="<missing>" \
.[0].Created~[0-9]\\{10\\} \
.[0].Tags[0]="$IMAGE" \
.[0].Size=1024 \
.[0].Comment="FROM localhost/interim-image:latest"
.[1].Size=0 \
.[2].Size=0 \
.[3].Size=0 \
.[0].Comment="" \
.[1].Comment="" \
.[2].Comment="" \
.[3].Comment="FROM localhost/interim-image:latest" \
.[0].CreatedBy~".*/echo.*This container is intended for podman CI testing.*" \
.[1].CreatedBy~".* WORKDIR /home/podman" \
.[2].CreatedBy~".* LABEL created_at=.*" \
.[3].CreatedBy~".* LABEL created_by=test/system/build-testimage"
done

for i in $iid ${iid:0:12} $PODMAN_TEST_IMAGE_NAME:$PODMAN_TEST_IMAGE_TAG; do
t GET images/$i/history 200 \
.[0].Id="sha256:"$iid \
.[0].Id="sha256:$iid" \
.[1].Id="sha256:<missing>" \
.[2].Id="sha256:<missing>" \
.[3].Id="sha256:<missing>" \
.[0].Created~[0-9]\\{10\\} \
.[0].Tags[0]="$IMAGE" \
.[0].Size=1024 \
.[0].Comment="FROM localhost/interim-image:latest"
.[1].Size=0 \
.[2].Size=0 \
.[3].Size=0 \
.[0].Comment="" \
.[1].Comment="" \
.[2].Comment="" \
.[3].Comment="FROM localhost/interim-image:latest" \
.[0].CreatedBy~".*/echo.*This container is intended for podman CI testing.*" \
.[1].CreatedBy~".* WORKDIR /home/podman" \
.[2].CreatedBy~".* LABEL created_at=.*" \
.[3].CreatedBy~".* LABEL created_by=test/system/build-testimage"
done

# compat api pull image unauthorized message error
Expand Down
2 changes: 1 addition & 1 deletion test/apiv2/20-containers.at
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ iid=$(jq -r '.Id' <<<"$output")
t GET libpod/images/$iid/json 200 \
.RepoTags[0]=null \
.Author="" \
.Comment=""
.Comment~"FROM docker\.io/.*"

# Commit a new image w/o tag
cparam="repo=newrepo&comment=foo&author=bob&format=docker"
Expand Down

0 comments on commit 5fb4046

Please sign in to comment.