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

     1  #!/usr/bin/env bats
     2  
     3  load helpers
     4  
     5  @test "image" {
     6  	# Create and populate three interesting layers.
     7  	populate
     8  
     9  	# Create an image using to top layer.
    10  	name=wonderful-image
    11  	run storage --debug=false create-image --name $name $upperlayer
    12  	[ "$status" -eq 0 ]
    13  	[ "$output" != "" ]
    14  	image=${lines[0]}
    15  
    16  	# Add a couple of big data items.
    17  	createrandom ${TESTDIR}/random1
    18  	createrandom ${TESTDIR}/random2
    19  	storage set-image-data -f ${TESTDIR}/random1 $image random1
    20  	storage set-image-data -f ${TESTDIR}/random2 $image random2
    21  
    22  	# Get information about the image, and make sure the ID, name, and data names were preserved.
    23  	run storage image $image
    24  	echo "$output"
    25  	[ "$status" -eq 0 ]
    26  	[[ "$output" =~ "ID: $image" ]]
    27  	[[ "$output" =~ "Name: $name" ]]
    28  	[[ "$output" =~ "Data: random1" ]]
    29  	[[ "$output" =~ "Data: random2" ]]
    30  }