2016-12-16 23:34:51 +00:00
|
|
|
#!/usr/bin/env bats
|
|
|
|
|
|
|
|
load helpers
|
|
|
|
|
|
|
|
IMAGE=kubernetes/pause
|
2017-08-10 13:49:07 +00:00
|
|
|
SIGNED_IMAGE=registry.access.redhat.com/rhel7-atomic:latest
|
|
|
|
UNSIGNED_IMAGE=docker.io/library/hello-world:latest
|
2016-12-16 23:34:51 +00:00
|
|
|
|
|
|
|
function teardown() {
|
|
|
|
cleanup_test
|
|
|
|
}
|
|
|
|
|
2017-01-31 15:32:27 +00:00
|
|
|
@test "run container in pod with image ID" {
|
2017-05-12 13:36:15 +00:00
|
|
|
start_crio
|
2018-01-26 02:06:38 +00:00
|
|
|
run crictl runp "$TESTDATA"/sandbox_config.json
|
2017-01-31 15:32:27 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
pod_id="$output"
|
|
|
|
sed -e "s/%VALUE%/$REDIS_IMAGEID/g" "$TESTDATA"/container_config_by_imageid.json > "$TESTDIR"/ctr_by_imageid.json
|
2017-11-15 15:24:20 +00:00
|
|
|
run crictl create "$pod_id" "$TESTDIR"/ctr_by_imageid.json "$TESTDATA"/sandbox_config.json
|
2017-01-31 15:32:27 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
2017-11-14 14:54:53 +00:00
|
|
|
ctr_id="$output"
|
|
|
|
run crictl start "$ctr_id"
|
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
2017-01-31 15:32:27 +00:00
|
|
|
cleanup_ctrs
|
|
|
|
cleanup_pods
|
2017-05-12 13:36:15 +00:00
|
|
|
stop_crio
|
2017-01-31 15:32:27 +00:00
|
|
|
}
|
|
|
|
|
Return image references from the storage package
The image's canonical reference is a name with a digest of the image's
manifest, so in imageService.ImageStatus() and
imageService.ListImages(), divide the image's name list into tagged and
digested values, and if we have names, add canonical versions.
In Server.ContainerStatus(), return the image name as it was given to us
as the image, and the image digested reference as the image reference.
In Server.ListImages(), be sure to only return tagged names in the
RepoTags field. In Server.ImageStatus(), also return canonical
references in the RepoDigests field.
In Server.PullImage(), be sure that we consistently return the same
image reference for an image, whether we ended up pulling it or not.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-07-12 16:41:38 +00:00
|
|
|
@test "container status when created by image ID" {
|
2017-05-20 13:16:58 +00:00
|
|
|
start_crio
|
|
|
|
|
2018-01-26 02:06:38 +00:00
|
|
|
run crictl runp "$TESTDATA"/sandbox_config.json
|
2017-05-20 13:16:58 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
pod_id="$output"
|
|
|
|
|
|
|
|
sed -e "s/%VALUE%/$REDIS_IMAGEID/g" "$TESTDATA"/container_config_by_imageid.json > "$TESTDIR"/ctr_by_imageid.json
|
|
|
|
|
2017-11-15 15:24:20 +00:00
|
|
|
run crictl create "$pod_id" "$TESTDIR"/ctr_by_imageid.json "$TESTDATA"/sandbox_config.json
|
2017-05-20 13:16:58 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
ctr_id="$output"
|
|
|
|
|
2017-11-15 15:24:20 +00:00
|
|
|
run crictl inspect "$ctr_id" --output yaml
|
2017-05-20 13:16:58 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
Return image references from the storage package
The image's canonical reference is a name with a digest of the image's
manifest, so in imageService.ImageStatus() and
imageService.ListImages(), divide the image's name list into tagged and
digested values, and if we have names, add canonical versions.
In Server.ContainerStatus(), return the image name as it was given to us
as the image, and the image digested reference as the image reference.
In Server.ListImages(), be sure to only return tagged names in the
RepoTags field. In Server.ImageStatus(), also return canonical
references in the RepoDigests field.
In Server.PullImage(), be sure that we consistently return the same
image reference for an image, whether we ended up pulling it or not.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-07-12 16:41:38 +00:00
|
|
|
[[ "$output" =~ "image: docker.io/library/redis:alpine" ]]
|
|
|
|
[[ "$output" =~ "imageRef: $REDIS_IMAGEREF" ]]
|
2017-05-20 13:16:58 +00:00
|
|
|
|
|
|
|
cleanup_ctrs
|
|
|
|
cleanup_pods
|
|
|
|
stop_crio
|
|
|
|
}
|
|
|
|
|
Return image references from the storage package
The image's canonical reference is a name with a digest of the image's
manifest, so in imageService.ImageStatus() and
imageService.ListImages(), divide the image's name list into tagged and
digested values, and if we have names, add canonical versions.
In Server.ContainerStatus(), return the image name as it was given to us
as the image, and the image digested reference as the image reference.
In Server.ListImages(), be sure to only return tagged names in the
RepoTags field. In Server.ImageStatus(), also return canonical
references in the RepoDigests field.
In Server.PullImage(), be sure that we consistently return the same
image reference for an image, whether we ended up pulling it or not.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-07-12 16:41:38 +00:00
|
|
|
@test "container status when created by image tagged reference" {
|
|
|
|
start_crio
|
|
|
|
|
2018-01-26 02:06:38 +00:00
|
|
|
run crictl runp "$TESTDATA"/sandbox_config.json
|
Return image references from the storage package
The image's canonical reference is a name with a digest of the image's
manifest, so in imageService.ImageStatus() and
imageService.ListImages(), divide the image's name list into tagged and
digested values, and if we have names, add canonical versions.
In Server.ContainerStatus(), return the image name as it was given to us
as the image, and the image digested reference as the image reference.
In Server.ListImages(), be sure to only return tagged names in the
RepoTags field. In Server.ImageStatus(), also return canonical
references in the RepoDigests field.
In Server.PullImage(), be sure that we consistently return the same
image reference for an image, whether we ended up pulling it or not.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-07-12 16:41:38 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
pod_id="$output"
|
|
|
|
|
|
|
|
sed -e "s/%VALUE%/redis:alpine/g" "$TESTDATA"/container_config_by_imageid.json > "$TESTDIR"/ctr_by_imagetag.json
|
|
|
|
|
|
|
|
run crictl create "$pod_id" "$TESTDIR"/ctr_by_imagetag.json "$TESTDATA"/sandbox_config.json
|
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
ctr_id="$output"
|
2017-11-11 10:55:55 +00:00
|
|
|
|
Return image references from the storage package
The image's canonical reference is a name with a digest of the image's
manifest, so in imageService.ImageStatus() and
imageService.ListImages(), divide the image's name list into tagged and
digested values, and if we have names, add canonical versions.
In Server.ContainerStatus(), return the image name as it was given to us
as the image, and the image digested reference as the image reference.
In Server.ListImages(), be sure to only return tagged names in the
RepoTags field. In Server.ImageStatus(), also return canonical
references in the RepoDigests field.
In Server.PullImage(), be sure that we consistently return the same
image reference for an image, whether we ended up pulling it or not.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-07-12 16:41:38 +00:00
|
|
|
run crictl inspect "$ctr_id" --output yaml
|
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
[[ "$output" =~ "image: docker.io/library/redis:alpine" ]]
|
|
|
|
[[ "$output" =~ "imageRef: $REDIS_IMAGEREF" ]]
|
|
|
|
|
|
|
|
cleanup_ctrs
|
|
|
|
cleanup_pods
|
|
|
|
stop_crio
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "container status when created by image canonical reference" {
|
2017-05-20 15:08:00 +00:00
|
|
|
start_crio
|
|
|
|
|
2018-01-26 02:06:38 +00:00
|
|
|
run crictl runp "$TESTDATA"/sandbox_config.json
|
2017-05-20 15:08:00 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
pod_id="$output"
|
|
|
|
|
Return image references from the storage package
The image's canonical reference is a name with a digest of the image's
manifest, so in imageService.ImageStatus() and
imageService.ListImages(), divide the image's name list into tagged and
digested values, and if we have names, add canonical versions.
In Server.ContainerStatus(), return the image name as it was given to us
as the image, and the image digested reference as the image reference.
In Server.ListImages(), be sure to only return tagged names in the
RepoTags field. In Server.ImageStatus(), also return canonical
references in the RepoDigests field.
In Server.PullImage(), be sure that we consistently return the same
image reference for an image, whether we ended up pulling it or not.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-07-12 16:41:38 +00:00
|
|
|
sed -e "s|%VALUE%|$REDIS_IMAGEREF|g" "$TESTDATA"/container_config_by_imageid.json > "$TESTDIR"/ctr_by_imageref.json
|
2017-05-20 15:08:00 +00:00
|
|
|
|
Return image references from the storage package
The image's canonical reference is a name with a digest of the image's
manifest, so in imageService.ImageStatus() and
imageService.ListImages(), divide the image's name list into tagged and
digested values, and if we have names, add canonical versions.
In Server.ContainerStatus(), return the image name as it was given to us
as the image, and the image digested reference as the image reference.
In Server.ListImages(), be sure to only return tagged names in the
RepoTags field. In Server.ImageStatus(), also return canonical
references in the RepoDigests field.
In Server.PullImage(), be sure that we consistently return the same
image reference for an image, whether we ended up pulling it or not.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-07-12 16:41:38 +00:00
|
|
|
run crictl create "$pod_id" "$TESTDIR"/ctr_by_imageref.json "$TESTDATA"/sandbox_config.json
|
2017-05-20 15:08:00 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
ctr_id="$output"
|
|
|
|
|
2017-11-14 14:54:53 +00:00
|
|
|
run crictl start "$ctr_id"
|
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
|
2017-11-15 15:24:20 +00:00
|
|
|
run crictl inspect "$ctr_id" --output yaml
|
2017-05-20 15:08:00 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
Return image references from the storage package
The image's canonical reference is a name with a digest of the image's
manifest, so in imageService.ImageStatus() and
imageService.ListImages(), divide the image's name list into tagged and
digested values, and if we have names, add canonical versions.
In Server.ContainerStatus(), return the image name as it was given to us
as the image, and the image digested reference as the image reference.
In Server.ListImages(), be sure to only return tagged names in the
RepoTags field. In Server.ImageStatus(), also return canonical
references in the RepoDigests field.
In Server.PullImage(), be sure that we consistently return the same
image reference for an image, whether we ended up pulling it or not.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-07-12 16:41:38 +00:00
|
|
|
[[ "$output" =~ "image: docker.io/library/redis:alpine" ]]
|
|
|
|
[[ "$output" =~ "imageRef: $REDIS_IMAGEREF" ]]
|
2017-05-20 15:08:00 +00:00
|
|
|
|
|
|
|
cleanup_ctrs
|
|
|
|
cleanup_pods
|
|
|
|
stop_crio
|
|
|
|
}
|
|
|
|
|
Return image references from the storage package
The image's canonical reference is a name with a digest of the image's
manifest, so in imageService.ImageStatus() and
imageService.ListImages(), divide the image's name list into tagged and
digested values, and if we have names, add canonical versions.
In Server.ContainerStatus(), return the image name as it was given to us
as the image, and the image digested reference as the image reference.
In Server.ListImages(), be sure to only return tagged names in the
RepoTags field. In Server.ImageStatus(), also return canonical
references in the RepoDigests field.
In Server.PullImage(), be sure that we consistently return the same
image reference for an image, whether we ended up pulling it or not.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-07-12 16:41:38 +00:00
|
|
|
@test "image pull and list" {
|
2017-05-12 13:36:15 +00:00
|
|
|
start_crio "" "" --no-pause-image
|
2017-11-15 15:24:20 +00:00
|
|
|
run crictl pull "$IMAGE"
|
2016-12-16 23:34:51 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
Return image references from the storage package
The image's canonical reference is a name with a digest of the image's
manifest, so in imageService.ImageStatus() and
imageService.ListImages(), divide the image's name list into tagged and
digested values, and if we have names, add canonical versions.
In Server.ContainerStatus(), return the image name as it was given to us
as the image, and the image digested reference as the image reference.
In Server.ListImages(), be sure to only return tagged names in the
RepoTags field. In Server.ImageStatus(), also return canonical
references in the RepoDigests field.
In Server.PullImage(), be sure that we consistently return the same
image reference for an image, whether we ended up pulling it or not.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-07-12 16:41:38 +00:00
|
|
|
|
2017-11-14 14:54:53 +00:00
|
|
|
run crictl images --quiet "$IMAGE"
|
|
|
|
[ "$status" -eq 0 ]
|
2017-11-15 15:24:20 +00:00
|
|
|
echo "$output"
|
2017-11-14 14:54:53 +00:00
|
|
|
[ "$output" != "" ]
|
|
|
|
imageid="$output"
|
|
|
|
|
|
|
|
run crictl images @"$imageid"
|
2017-11-15 15:24:20 +00:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
[[ "$output" =~ "$IMAGE" ]]
|
Return image references from the storage package
The image's canonical reference is a name with a digest of the image's
manifest, so in imageService.ImageStatus() and
imageService.ListImages(), divide the image's name list into tagged and
digested values, and if we have names, add canonical versions.
In Server.ContainerStatus(), return the image name as it was given to us
as the image, and the image digested reference as the image reference.
In Server.ListImages(), be sure to only return tagged names in the
RepoTags field. In Server.ImageStatus(), also return canonical
references in the RepoDigests field.
In Server.PullImage(), be sure that we consistently return the same
image reference for an image, whether we ended up pulling it or not.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-07-12 16:41:38 +00:00
|
|
|
|
2017-11-14 14:54:53 +00:00
|
|
|
run crictl images --quiet "$imageid"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
echo "$output"
|
|
|
|
[ "$output" != "" ]
|
2016-12-16 23:34:51 +00:00
|
|
|
cleanup_images
|
2017-05-12 13:36:15 +00:00
|
|
|
stop_crio
|
2016-12-16 23:34:51 +00:00
|
|
|
}
|
|
|
|
|
2017-08-10 13:49:07 +00:00
|
|
|
@test "image pull with signature" {
|
|
|
|
start_crio "" "" --no-pause-image
|
2017-11-15 15:24:20 +00:00
|
|
|
run crictl pull "$SIGNED_IMAGE"
|
2017-08-10 13:49:07 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
cleanup_images
|
|
|
|
stop_crio
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "image pull without signature" {
|
|
|
|
start_crio "" "" --no-pause-image
|
2017-11-15 15:24:20 +00:00
|
|
|
run crictl image pull "$UNSIGNED_IMAGE"
|
2017-08-10 13:49:07 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -ne 0 ]
|
|
|
|
cleanup_images
|
|
|
|
stop_crio
|
|
|
|
}
|
|
|
|
|
Return image references from the storage package
The image's canonical reference is a name with a digest of the image's
manifest, so in imageService.ImageStatus() and
imageService.ListImages(), divide the image's name list into tagged and
digested values, and if we have names, add canonical versions.
In Server.ContainerStatus(), return the image name as it was given to us
as the image, and the image digested reference as the image reference.
In Server.ListImages(), be sure to only return tagged names in the
RepoTags field. In Server.ImageStatus(), also return canonical
references in the RepoDigests field.
In Server.PullImage(), be sure that we consistently return the same
image reference for an image, whether we ended up pulling it or not.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-07-12 16:41:38 +00:00
|
|
|
@test "image pull and list by tag and ID" {
|
|
|
|
start_crio "" "" --no-pause-image
|
|
|
|
run crictl pull "$IMAGE:go"
|
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
|
|
|
|
run crictl images --quiet "$IMAGE:go"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
echo "$output"
|
|
|
|
[ "$output" != "" ]
|
|
|
|
imageid="$output"
|
|
|
|
|
|
|
|
run crictl images --quiet @"$imageid"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
echo "$output"
|
|
|
|
[ "$output" != "" ]
|
|
|
|
|
|
|
|
run crictl images --quiet "$imageid"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
echo "$output"
|
|
|
|
[ "$output" != "" ]
|
|
|
|
|
|
|
|
cleanup_images
|
|
|
|
stop_crio
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "image pull and list by digest and ID" {
|
2017-05-12 13:36:15 +00:00
|
|
|
start_crio "" "" --no-pause-image
|
2017-11-15 15:24:20 +00:00
|
|
|
run crictl pull nginx@sha256:33eb1ed1e802d4f71e52421f56af028cdf12bb3bfff5affeaf5bf0e328ffa1bc
|
2017-04-06 17:28:55 +00:00
|
|
|
echo "$output"
|
2017-07-12 16:41:38 +00:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
|
2017-11-15 15:24:20 +00:00
|
|
|
run crictl images --quiet nginx@sha256:33eb1ed1e802d4f71e52421f56af028cdf12bb3bfff5affeaf5bf0e328ffa1bc
|
2017-07-12 16:41:38 +00:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
echo "$output"
|
|
|
|
[ "$output" != "" ]
|
Return image references from the storage package
The image's canonical reference is a name with a digest of the image's
manifest, so in imageService.ImageStatus() and
imageService.ListImages(), divide the image's name list into tagged and
digested values, and if we have names, add canonical versions.
In Server.ContainerStatus(), return the image name as it was given to us
as the image, and the image digested reference as the image reference.
In Server.ListImages(), be sure to only return tagged names in the
RepoTags field. In Server.ImageStatus(), also return canonical
references in the RepoDigests field.
In Server.PullImage(), be sure that we consistently return the same
image reference for an image, whether we ended up pulling it or not.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-07-12 16:41:38 +00:00
|
|
|
imageid="$output"
|
2017-07-12 16:41:38 +00:00
|
|
|
|
Return image references from the storage package
The image's canonical reference is a name with a digest of the image's
manifest, so in imageService.ImageStatus() and
imageService.ListImages(), divide the image's name list into tagged and
digested values, and if we have names, add canonical versions.
In Server.ContainerStatus(), return the image name as it was given to us
as the image, and the image digested reference as the image reference.
In Server.ListImages(), be sure to only return tagged names in the
RepoTags field. In Server.ImageStatus(), also return canonical
references in the RepoDigests field.
In Server.PullImage(), be sure that we consistently return the same
image reference for an image, whether we ended up pulling it or not.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-07-12 16:41:38 +00:00
|
|
|
run crictl images --quiet @"$imageid"
|
2017-04-06 17:28:55 +00:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
echo "$output"
|
|
|
|
[ "$output" != "" ]
|
|
|
|
|
Return image references from the storage package
The image's canonical reference is a name with a digest of the image's
manifest, so in imageService.ImageStatus() and
imageService.ListImages(), divide the image's name list into tagged and
digested values, and if we have names, add canonical versions.
In Server.ContainerStatus(), return the image name as it was given to us
as the image, and the image digested reference as the image reference.
In Server.ListImages(), be sure to only return tagged names in the
RepoTags field. In Server.ImageStatus(), also return canonical
references in the RepoDigests field.
In Server.PullImage(), be sure that we consistently return the same
image reference for an image, whether we ended up pulling it or not.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-07-12 16:41:38 +00:00
|
|
|
run crictl images --quiet "$imageid"
|
2017-04-06 17:28:55 +00:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
echo "$output"
|
|
|
|
[ "$output" != "" ]
|
|
|
|
|
|
|
|
cleanup_images
|
2017-05-12 13:36:15 +00:00
|
|
|
stop_crio
|
2017-04-06 17:28:55 +00:00
|
|
|
}
|
|
|
|
|
2016-12-16 23:34:51 +00:00
|
|
|
@test "image list with filter" {
|
2017-05-12 13:36:15 +00:00
|
|
|
start_crio "" "" --no-pause-image
|
2017-11-15 15:24:20 +00:00
|
|
|
run crictl pull "$IMAGE"
|
2016-12-16 23:34:51 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
2017-11-15 15:24:20 +00:00
|
|
|
run crictl images --quiet "$IMAGE"
|
2016-12-16 23:34:51 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
printf '%s\n' "$output" | while IFS= read -r id; do
|
2017-11-15 15:24:20 +00:00
|
|
|
run crictl rmi "$id"
|
2016-12-16 23:34:51 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
done
|
2017-11-15 15:24:20 +00:00
|
|
|
run crictl images --quiet
|
2016-12-16 23:34:51 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
printf '%s\n' "$output" | while IFS= read -r id; do
|
|
|
|
echo "$id"
|
|
|
|
status=1
|
|
|
|
done
|
|
|
|
cleanup_images
|
2017-05-12 13:36:15 +00:00
|
|
|
stop_crio
|
2016-12-16 23:34:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "image list/remove" {
|
2017-05-12 13:36:15 +00:00
|
|
|
start_crio "" "" --no-pause-image
|
2017-11-15 15:24:20 +00:00
|
|
|
run crictl pull "$IMAGE"
|
2016-12-16 23:34:51 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
2017-11-15 15:24:20 +00:00
|
|
|
run crictl images --quiet
|
2016-12-16 23:34:51 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
2017-04-06 17:28:55 +00:00
|
|
|
[ "$output" != "" ]
|
2016-12-16 23:34:51 +00:00
|
|
|
printf '%s\n' "$output" | while IFS= read -r id; do
|
2017-11-15 15:24:20 +00:00
|
|
|
run crictl rmi "$id"
|
2016-12-16 23:34:51 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
done
|
2017-11-15 15:24:20 +00:00
|
|
|
run crictl images --quiet
|
2016-12-16 23:34:51 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
2017-04-06 17:28:55 +00:00
|
|
|
[ "$output" = "" ]
|
2016-12-16 23:34:51 +00:00
|
|
|
printf '%s\n' "$output" | while IFS= read -r id; do
|
|
|
|
echo "$id"
|
|
|
|
status=1
|
|
|
|
done
|
|
|
|
cleanup_images
|
2017-05-12 13:36:15 +00:00
|
|
|
stop_crio
|
2016-12-16 23:34:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "image status/remove" {
|
2017-05-12 13:36:15 +00:00
|
|
|
start_crio "" "" --no-pause-image
|
2017-11-15 15:24:20 +00:00
|
|
|
run crictl pull "$IMAGE"
|
2016-12-16 23:34:51 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
2017-11-15 15:24:20 +00:00
|
|
|
run crictl images --quiet
|
2016-12-16 23:34:51 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
2017-04-06 17:28:55 +00:00
|
|
|
[ "$output" != "" ]
|
2016-12-16 23:34:51 +00:00
|
|
|
printf '%s\n' "$output" | while IFS= read -r id; do
|
2017-11-14 14:54:53 +00:00
|
|
|
run crictl images -v "$id"
|
2016-12-16 23:34:51 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
2017-04-06 17:28:55 +00:00
|
|
|
[ "$output" != "" ]
|
2017-11-15 15:24:20 +00:00
|
|
|
run crictl rmi "$id"
|
2016-12-16 23:34:51 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
done
|
2017-11-15 15:24:20 +00:00
|
|
|
run crictl images --quiet
|
2016-12-16 23:34:51 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
2017-04-06 17:28:55 +00:00
|
|
|
[ "$output" = "" ]
|
2016-12-16 23:34:51 +00:00
|
|
|
printf '%s\n' "$output" | while IFS= read -r id; do
|
|
|
|
echo "$id"
|
|
|
|
status=1
|
|
|
|
done
|
|
|
|
cleanup_images
|
2017-05-12 13:36:15 +00:00
|
|
|
stop_crio
|
2016-12-16 23:34:51 +00:00
|
|
|
}
|