From 156c9521773c2bd83847adf41c386f5a3d42f713 Mon Sep 17 00:00:00 2001 From: James Dingwall Date: Fri, 4 Oct 2024 19:30:34 +0100 Subject: [PATCH] ZTS: issue #14223: add check for /dev changes after snapshot rename After renaming a snapshot with 'snapdev=visible' ensure that the /dev entries are updated to reflect the rename. Signed-off-by: James Dingwall --- .../functional/zvol/zvol_misc/zvol_misc_snapdev.ksh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_snapdev.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_snapdev.ksh index 1fc2d2780b1c..af780b628ce4 100755 --- a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_snapdev.ksh +++ b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_snapdev.ksh @@ -117,5 +117,18 @@ log_must zfs set snapdev=visible $TESTPOOL verify_inherited 'snapdev' 'hidden' $SUBZVOL $VOLFS blockdev_missing $SUBSNAPDEV blockdev_exists $SNAPDEV +log_must zfs destroy $SNAP + +# 4. Verify "rename" is correctly reflected when "snapdev=visible" +# 4.1 First create a snapshot and verify the device is present +log_must zfs snapshot $SNAP +log_must zfs set snapdev=visible $ZVOL +blockdev_exists $SNAPDEV +# 4.2 rename the snapshot and verify the devices are updated +log_must zfs rename $SNAP $SNAP-new +blockdev_missing $SNAPDEV +blockdev_exists $SNAPDEV-new +# 4.3 cleanup +log_must zfs destroy $SNAP-new log_pass "ZFS volume property 'snapdev' works as expected"