]> git.proxmox.com Git - mirror_zfs.git/commitdiff
ZTS: rsend_009_pos.ksh is destructive on zfs-on-root system
authoryouzhongyang <youzhong@gmail.com>
Tue, 1 Nov 2022 19:08:37 +0000 (15:08 -0400)
committerGitHub <noreply@github.com>
Tue, 1 Nov 2022 19:08:37 +0000 (12:08 -0700)
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Allan Jude <allan@klarasystems.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Youzhong Yang <yyang@mathworks.com>
Closes #14113

tests/zfs-tests/tests/functional/rsend/rsend_009_pos.ksh

index ba60afe9acd3c4f89b19ee5e9301f6c4e08a1888..fc5a582f881e00742f05a12f41bcd27dd0128019 100755 (executable)
 
 verify_runnable "global"
 
+BPOOL=bpool_test
+SPOOL=spool_test
+
 function cleanup
 {
-       if datasetexists bpool ; then
-               log_must_busy zpool destroy -f bpool
+       if datasetexists $BPOOL ; then
+               log_must_busy zpool destroy -f $BPOOL
        fi
-       if datasetexists spool ; then
-               log_must_busy zpool destroy -f spool
+       if datasetexists $SPOOL ; then
+               log_must_busy zpool destroy -f $SPOOL
        fi
 }
 
@@ -60,33 +63,33 @@ log_onexit cleanup
 
 log_must mkfile $MINVDEVSIZE $TESTDIR/bfile
 log_must mkfile $SPA_MINDEVSIZE  $TESTDIR/sfile
-log_must zpool create -O compression=off bpool $TESTDIR/bfile
-log_must zpool create -O compression=off spool $TESTDIR/sfile
+log_must zpool create -O compression=off $BPOOL $TESTDIR/bfile
+log_must zpool create -O compression=off $SPOOL $TESTDIR/sfile
 
 #
 # Test out of space on sub-filesystem
 #
-log_must zfs create bpool/fs
-log_must mkfile 30M /bpool/fs/file
+log_must zfs create $BPOOL/fs
+log_must mkfile 30M /$BPOOL/fs/file
 
-log_must zfs snapshot bpool/fs@snap
-log_must eval "zfs send -R bpool/fs@snap > $BACKDIR/fs-R"
-log_mustnot eval "zfs receive -d -F spool < $BACKDIR/fs-R"
+log_must zfs snapshot $BPOOL/fs@snap
+log_must eval "zfs send -R $BPOOL/fs@snap > $BACKDIR/fs-R"
+log_mustnot eval "zfs receive -d -F $SPOOL < $BACKDIR/fs-R"
 
-log_must datasetnonexists spool/fs
-log_must ismounted spool
+log_must datasetnonexists $SPOOL/fs
+log_must ismounted $SPOOL
 
 #
 # Test out of space on top filesystem
 #
-log_must mv /bpool/fs/file /bpool
-log_must_busy zfs destroy -rf bpool/fs
+log_must mv /$BPOOL/fs/file /$BPOOL
+log_must_busy zfs destroy -rf $BPOOL/fs
 
-log_must zfs snapshot bpool@snap
-log_must eval "zfs send -R bpool@snap > $BACKDIR/bpool-R"
-log_mustnot eval "zfs receive -d -F spool < $BACKDIR/bpool-R"
+log_must zfs snapshot $BPOOL@snap
+log_must eval "zfs send -R $BPOOL@snap > $BACKDIR/bpool-R"
+log_mustnot eval "zfs receive -d -F $SPOOL < $BACKDIR/bpool-R"
 
-log_must datasetnonexists spool/fs
-log_must ismounted spool
+log_must datasetnonexists $SPOOL/fs
+log_must ismounted $SPOOL
 
 log_pass "zfs receive can handle out of space correctly."