Skip to content

Commit

Permalink
DOSE-683 Checkpoint tests aren't fully adapted to work with object st…
Browse files Browse the repository at this point in the history
…orage (openzfs#478)
  • Loading branch information
nupur-agrawal-delphix authored Oct 4, 2021
1 parent 99a48ef commit 204f711
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ log_must zpool checkpoint $TESTPOOL
test_change_state_after_checkpoint

log_must zpool export $TESTPOOL
log_must zpool import --rewind-to-checkpoint $TESTPOOL
log_must import_pool -e "--rewind-to-checkpoint" -p $TESTPOOL
test_verify_pre_checkpoint_state

log_must zpool checkpoint $TESTPOOL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ test_change_state_after_checkpoint
log_must zpool checkpoint -d $TESTPOOL

log_must zpool export $TESTPOOL
log_mustnot zpool import --rewind-to-checkpoint $TESTPOOL
log_mustnot import_pool -e "--rewind-to-checkpoint" -p $TESTPOOL

log_must zpool import $TESTPOOL
log_must import_pool -p $TESTPOOL
test_verify_post_checkpoint_state

log_pass "Discard checkpoint from pool."
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ done
#
log_mustnot zpool checkpoint -d $non_checkpointed
log_must zpool export $non_checkpointed
log_mustnot zpool import --rewind-to-checkpoint $non_checkpointed
log_must zpool import $non_checkpointed
log_mustnot import_pool -e "--rewind-to-checkpoint" -p $non_checkpointed
log_must import_pool -p $non_checkpointed

log_pass "Badly formed checkpoint related commands with " \
"invalid inputs fail as expected."
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# 1. Create pool
# 2. Populate it
# 3. Take checkpoint
# 4. Modify data (include at least one destructive change)
# 4. Modify data (include at least one destructive change)
# 5. Export and import pool
# 6. Verify that the pool was opened with the most current
# data and not the checkpointed state.
Expand All @@ -41,7 +41,7 @@ log_must zpool checkpoint $TESTPOOL
test_change_state_after_checkpoint

log_must zpool export $TESTPOOL
log_must zpool import $TESTPOOL
log_must import_pool -p $TESTPOOL

test_verify_post_checkpoint_state

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# 1. Create pool
# 2. Populate it
# 3. Take checkpoint
# 4. Modify data (include at least one destructive change)
# 4. Modify data (include at least one destructive change)
# 5. Rewind to checkpoint
# 6. Verify that the data before the checkpoint are present
# and the data after the checkpoint is gone.
Expand All @@ -42,7 +42,7 @@ log_must zpool checkpoint $TESTPOOL
test_change_state_after_checkpoint

log_must zpool export $TESTPOOL
log_must zpool import --rewind-to-checkpoint $TESTPOOL
log_must import_pool -e "--rewind-to-checkpoint" -p $TESTPOOL

test_verify_pre_checkpoint_state

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# 1. Create pool
# 2. Populate it
# 3. Take checkpoint
# 4. Modify data (include at least one destructive change)
# 4. Modify data (include at least one destructive change)
# 5. Export and import the checkpointed state as readonly
# 6. Verify that we can see the checkpointed state and not
# the actual current state.
Expand All @@ -45,12 +45,12 @@ log_must zpool checkpoint $TESTPOOL
test_change_state_after_checkpoint

log_must zpool export $TESTPOOL
log_must zpool import -o readonly=on --rewind-to-checkpoint $TESTPOOL
log_must import_pool -e "-o readonly=on --rewind-to-checkpoint" -p $TESTPOOL

test_verify_pre_checkpoint_state "ro-check"

log_must zpool export $TESTPOOL
log_must zpool import $TESTPOOL
log_must import_pool -p $TESTPOOL

test_verify_post_checkpoint_state

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# 1. Create pool
# 2. Populate it
# 3. Take checkpoint
# 4. Modify data (include at least one destructive change)
# 4. Modify data (include at least one destructive change)
# 5. Verify zdb finds checkpoint when run on current state
# 6. Verify zdb finds old dataset when run on checkpointed
# state
Expand Down Expand Up @@ -84,7 +84,7 @@ zdb -e $TESTPOOL | grep "Dataset $FS1" && \
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 import_pool -p $TESTPOOL

log_must zpool checkpoint -d $TESTPOOL

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
# 1. Create pool
# 2. Populate it
# 3. Take checkpoint
# 4. Modify data (include at least one destructive change)
# 4. Modify data (include at least one destructive change)
# 5. Export pool
# 6. Introduce a new feature in the pool which is unsupported
# but readonly-compatible and increment its reference
# number so it is marked active.
# 7. Verify that the pool can't be opened writeable, but we
# can rewind to the checkpoint (before the feature was
# can rewind to the checkpoint (before the feature was
# introduced) if we want to.
#

Expand All @@ -58,8 +58,8 @@ log_must zpool export $TESTPOOL
log_must zhack feature enable -r $TESTPOOL 'com.company:future_feature'
log_must zhack feature ref $TESTPOOL 'com.company:future_feature'

log_mustnot zpool import $TESTPOOL
log_must zpool import --rewind-to-checkpoint $TESTPOOL
log_mustnot import_pool -p $TESTPOOL
log_must import_pool -e "--rewind-to-checkpoint" -p $TESTPOOL

test_verify_pre_checkpoint_state

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ function cleanup_test_pool
# data from old pools.
#
if ! use_object_store; then
for disk in $DISKS; do
zpool labelclear -f $disk
done
fi
for disk in $DISKS; do
zpool labelclear -f $disk
done
fi
}

function cleanup_nested_pools
Expand Down

0 comments on commit 204f711

Please sign in to comment.