Skip to content

Commit

Permalink
Add test for --all
Browse files Browse the repository at this point in the history
This patch adds tests for the '--all' option for checkpointctl show.

Signed-off-by: Sankalp Acharya <[email protected]>
  • Loading branch information
sankalp-12 committed Apr 18, 2023
1 parent 6fd6177 commit dd8f7aa
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion test/checkpointctl.bats
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,24 @@ function teardown() {
[[ ${lines[10]} == *"/proc"* ]]
}

@test "Run checkpointctl show with tar file and --all and valid spec.dump and valid stats-dump" {
cp test/config.dump "$TEST_TMP_DIR1"
cp test/spec.dump "$TEST_TMP_DIR1"
cp test/stats-dump "$TEST_TMP_DIR1"
mkdir "$TEST_TMP_DIR1"/checkpoint
( cd "$TEST_TMP_DIR1" && tar cf "$TEST_TMP_DIR2"/test.tar . )
checkpointctl show "$TEST_TMP_DIR2"/test.tar --all
[ "$status" -eq 0 ]
[[ ${lines[6]} == *"Overview of Mounts"* ]]
[[ ${lines[8]} == *"DESTINATION"* ]]
[[ ${lines[10]} == *"/proc"* ]]
[[ ${lines[11]} == *"/etc/hostname"* ]]
[[ ${lines[13]} == *"CRIU dump statistics"* ]]
[[ ${lines[15]} == *"MEMWRITE TIME"* ]]
[[ ${lines[17]} == *"446571 us"* ]]
}

@test "Run checkpointctl show with tar file and missing --mounts and --full-paths" {
@test "Run checkpointctl show with tar file and missing --mounts/-all and --full-paths" {
cp test/config.dump "$TEST_TMP_DIR1"
cp test/spec.dump "$TEST_TMP_DIR1"
mkdir "$TEST_TMP_DIR1"/checkpoint
Expand Down

0 comments on commit dd8f7aa

Please sign in to comment.