mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +03:00
ZTS: rsend_009_pos.ksh is destructive on zfs-on-root system
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
This commit is contained in:
parent
dcce0dc5f0
commit
95055c2ce2
@ -45,13 +45,16 @@
|
||||
|
||||
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."
|
||||
|
Loading…
Reference in New Issue
Block a user