github.com/vrothberg/storage@v1.12.13/tests/delete-image.bats (about)

     1  #!/usr/bin/env bats
     2  
     3  load helpers
     4  
     5  @test "delete-image" {
     6  	# Create a layer.
     7  	run storage --debug=false create-layer
     8  	[ "$status" -eq 0 ]
     9  	[ "$output" != "" ]
    10  	layer=$output
    11  
    12  	# Create an image using that layer.
    13  	run storage --debug=false create-image $layer
    14  	[ "$status" -eq 0 ]
    15  	[ "$output" != "" ]
    16  	image=${output%%	*}
    17  
    18  	# Check that the image can be found.
    19  	storage exists -i $image
    20  
    21  	# Use delete-image to delete it.
    22  	storage delete-image $image
    23  
    24  	# Check that the image is gone.
    25  	run storage exists -i $image
    26  	[ "$status" -ne 0 ]
    27  }