From dd8f7aaff6cc34e8e43eb2e1127390e043e5ece2 Mon Sep 17 00:00:00 2001 From: Sankalp Acharya Date: Tue, 18 Apr 2023 20:39:58 +0530 Subject: [PATCH] Add test for `--all` This patch adds tests for the '--all' option for checkpointctl show. Signed-off-by: Sankalp Acharya --- test/checkpointctl.bats | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/test/checkpointctl.bats b/test/checkpointctl.bats index 718a1a70..5e26cbd1 100644 --- a/test/checkpointctl.bats +++ b/test/checkpointctl.bats @@ -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