test/system: Test 'rmi --all' without any images

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

View file

@ -29,6 +29,26 @@ teardown() {
} }
@test "rmi: '--all' without any images" {
local num_of_images
num_of_images="$(list_images)"
assert_equal "$num_of_images" 0
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: Remove all images with the default image present" { @test "rmi: Remove all images with the default image present" {
num_of_images=$(list_images) num_of_images=$(list_images)
assert_equal "$num_of_images" 0 assert_equal "$num_of_images" 0