test/system: Test 'rmi --all' with an image without a name

https://github.com/containers/toolbox/pull/1195
This commit is contained in:
Debarshi Ray 2022-12-09 10:58:18 +01:00
parent 8a37c08780
commit e25ab310fa

View file

@ -65,6 +65,31 @@ teardown() {
assert_equal "$new_num_of_images" "$num_of_images" assert_equal "$new_num_of_images" "$num_of_images"
} }
@test "rmi: '--all' with an image without a name" {
local num_of_images
num_of_images="$(list_images)"
assert_equal "$num_of_images" 0
build_image_without_name
num_of_images="$(list_images)"
assert_equal "$num_of_images" 1
run --keep-empty-lines --separate-stderr "$TOOLBOX" rmi --all
assert_success
assert_output ""
output="$stderr"
assert_output ""
if check_bats_version 1.7.0; then
assert [ ${#lines[@]} -eq 0 ]
assert [ ${#stderr_lines[@]} -eq 0 ]
fi
num_of_images="$(list_images)"
assert_equal "$num_of_images" 0
}
@test "rmi: Try to remove all images with a container present and running" { @test "rmi: Try to remove all images with a container present and running" {
skip "Bug: Fail in 'toolbox rmi' does not return non-zero value" skip "Bug: Fail in 'toolbox rmi' does not return non-zero value"
num_of_images=$(list_images) num_of_images=$(list_images)