]> git.proxmox.com Git - mirror_zfs.git/blobdiff - tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_008_pos.ksh
OpenZFS 7386 - zfs get does not work properly with bookmarks
[mirror_zfs.git] / tests / zfs-tests / tests / functional / cli_root / zfs_get / zfs_get_008_pos.ksh
index af1b5681af617583b4a21cfa5a232417dce6b3be..9d54625623157582998fee427b811c6cbaef5916 100755 (executable)
@@ -33,7 +33,7 @@
 # Verify "-d <n>" can work with other options
 #
 # STRATEGY:
-# 1. Create pool, filesystem, dataset, volume and snapshot.
+# 1. Create pool, filesystem, dataset, volume, snapshot, and bookmark.
 # 2. Getting an -d option, other options and properties random combination.
 # 3. Using the combination as the parameters of 'zfs get' to check the
 # command line return value.
@@ -61,6 +61,9 @@ fi
 set -A dataset $TESTPOOL/$TESTCTR $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL \
        $TESTPOOL/$TESTFS@$TESTSNAP $TESTPOOL/$TESTVOL@$TESTSNAP
 
+set -A bookmark_props creation
+set -A bookmark $TESTPOOL/$TESTFS#$TESTBKMARK $TESTPOOL/$TESTVOL#$TESTBKMARK
+
 log_assert "Verify '-d <n>' can work with other options"
 log_onexit cleanup
 
@@ -68,6 +71,10 @@ log_onexit cleanup
 create_snapshot $TESTPOOL/$TESTFS $TESTSNAP
 create_snapshot $TESTPOOL/$TESTVOL $TESTSNAP
 
+# Create filesystem and volume's bookmark
+create_bookmark $TESTPOOL/$TESTFS $TESTSNAP $TESTBKMARK
+create_bookmark $TESTPOOL/$TESTVOL $TESTSNAP $TESTBKMARK
+
 typeset -i opt_numb=16
 typeset -i prop_numb=16
 typeset -i i=0
@@ -87,5 +94,15 @@ for dst in ${dataset[@]}; do
        done
 done
 
+for dst in ${bookmark[@]}; do
+       (( i=0 ))
+       while (( i < opt_numb )); do
+               (( item = $RANDOM % ${#options[@]} ))
+               (( depth_item = $RANDOM % ${#depth_options[@]} ))
+               log_must eval "$ZFS get -${depth_options[depth_item]} ${options[item]} $bookmark_props $dst > /dev/null 2>&1"
+               (( i += 1 ))
+       done
+done
+
 log_pass "Verify '-d <n>' can work with other options"