]> git.proxmox.com Git - mirror_zfs.git/blobdiff - tests/zfs-tests/tests/functional/pool_checkpoint/checkpoint_zdb.ksh
zdb -k does not work on Linux when used with -e
[mirror_zfs.git] / tests / zfs-tests / tests / functional / pool_checkpoint / checkpoint_zdb.ksh
index 50c45b5b49a32ea89a04f29ce57074046b3f73b0..fdefc0c3bdbb70da203b3e9217fbd44c4699c62e 100755 (executable)
@@ -19,7 +19,7 @@
 
 #
 # DESCRIPTION:
-#      Ensure that checkpoint verification within zdb wowrks as
+#      Ensure that checkpoint verification within zdb works as
 #      we expect.
 #
 # STRATEGY:
 #      5. Verify zdb finds checkpoint when run on current state
 #      6. Verify zdb finds old dataset when run on checkpointed
 #         state
-#      7. Discard checkpoint
-#      8. Verify zdb does not find the checkpoint anymore in the
+#      7. Export pool, and verify the same things with zdb to
+#         test the -e option.
+#      8. Import pool and discard checkpoint
+#      9. Verify zdb does not find the checkpoint anymore in the
 #         current state.
-#      9. Verify that zdb cannot find the checkpointed state
+#      10.Verify that zdb cannot find the checkpointed state
 #         anymore when trying to open it for verification.
 #
 
@@ -68,6 +70,22 @@ zdb $TESTPOOL | grep "Dataset $FS1" && \
 zdb -k $TESTPOOL | grep "Dataset $CHECKPOINTED_FS1" || \
        log_fail "zdb could not find destroyed dataset in checkpoint"
 
+log_must zpool export $TESTPOOL
+
+zdb -e $TESTPOOL | grep "Checkpointed uberblock found" || \
+       log_fail "zdb could not find checkpointed uberblock"
+
+zdb -k -e $TESTPOOL | grep "Checkpointed uberblock found" && \
+       log_fail "zdb found checkpointed uberblock in checkpointed state"
+
+zdb -e $TESTPOOL | grep "Dataset $FS1" && \
+       log_fail "zdb found destroyed dataset in current state"
+
+zdb -k -e $TESTPOOL | grep "Dataset $CHECKPOINTED_FS1" || \
+       log_fail "zdb could not find destroyed dataset in checkpoint"
+
+log_must zpool import $TESTPOOL
+
 log_must zpool checkpoint -d $TESTPOOL
 
 zdb $TESTPOOL | grep "Checkpointed uberblock found" && \