Skip to content

Commit

Permalink
add imagefs integration tests
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Hannon <kehannon@redhat.com>
  • Loading branch information
kannon92 committed Feb 8, 2024
1 parent e0e17ee commit 49fbb63
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions contrib/test/ci/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ kata_skip_files:
- "ctr_userns.bats"
- "drop_infra.bats" # infra ctr is not dropped on purpose with kata
- "infra_ctr_cpuset.bats"
- "imagefsinfo.bats" # image and container filesystems is not in kata at the moment
- "inspect.bats"
- "metrics.bats"
- "network_ping.bats"
Expand Down
34 changes: 34 additions & 0 deletions test/imagefsinfo.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bats
# vim: set syntax=sh:

load helpers

function setup() {
setup_test
start_crio
}

function teardown() {
cleanup_test
}

@test "image fs info with default settings should return matching container_filesystem and image_filesystem" {
output=$(crictl imagefsinfo)
[ "$output" != "" ]

container_output=$(jq -e '.status.containerFilesystems[0]' <<< "$output")
image_output=$(jq -e '.status.imageFilesystems[0]' <<< "$output")
# if these are the same we can directly compare.
[ "$container_output" = "$image_output" ]
}

@test "image fs info with imagestore set should return different filesystems" {
stop_crio
CONTAINER_IMAGESTORE="$TESTDIR/imagestore" start_crio
output=$(crictl imagefsinfo)
[ "$output" != "" ]

container_output=$(jq -e '.status.containerFilesystems[0]' <<< "$output")
image_output=$(jq -e '.status.imageFilesystems[0]' <<< "$output")
[ "$container_output" != "$image_output" ]
}

0 comments on commit 49fbb63

Please sign in to comment.