From 3c2f69aa91653f06c7ca5560148e9dad2cffaed3 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 | 11 +++++++++++ 1 file changed, 11 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..3d229dccd75b 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 @@ -118,4 +118,15 @@ verify_inherited 'snapdev' 'hidden' $SUBZVOL $VOLFS blockdev_missing $SUBSNAPDEV blockdev_exists $SNAPDEV +# 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 +log_must zfs destroy $SNAP-new + log_pass "ZFS volume property 'snapdev' works as expected"