OpenZFS 6877 - zfs_rename_006_pos fails due to missing zvol snapshot device file
Authored by: Akash Ayare <aayare@delphix.com> Reviewed by: John Kennedy <john.kennedy@delphix.com> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Dan Kimmel <dan.kimmel@delphix.com> Reviewed-by: luozhengzheng <luo.zhengzheng@zte.com.cn> Reviewed-by: yuxiang <guo.yong33@zte.com.cn> Ported-by: Brian Behlendorf <behlendorf1@llnl.gov> Bug was caused due to a change in functionality. At some point, ZFS snapshots no longer created associated device files which were being used in the test. To resolve this issue, a clone of the snapshot can be produced which will also create the expected device files; then, the test will behave as it did historically. OpenZFS-issue: https://www.illumos.org/issues/6877 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/2200f27 Closes #5275 Porting Notes: - Hardcoded /dev/zvol/rdsk changed to $ZVOL_RDEVDIR for compatibility. - Enabled in linux runfile.
This commit is contained in:
parent
7305538de3
commit
3691598e26
|
@ -146,11 +146,9 @@ tests = ['zfs_receive_001_pos', 'zfs_receive_002_pos', 'zfs_receive_003_pos',
|
||||||
'zfs_receive_010_pos', 'zfs_receive_011_pos', 'zfs_receive_012_pos',
|
'zfs_receive_010_pos', 'zfs_receive_011_pos', 'zfs_receive_012_pos',
|
||||||
'zfs_receive_013_pos']
|
'zfs_receive_013_pos']
|
||||||
|
|
||||||
# DISABLED:
|
|
||||||
# zfs_rename_006_pos - needs investigation
|
|
||||||
[tests/functional/cli_root/zfs_rename]
|
[tests/functional/cli_root/zfs_rename]
|
||||||
tests = ['zfs_rename_001_pos', 'zfs_rename_002_pos', 'zfs_rename_003_pos',
|
tests = ['zfs_rename_001_pos', 'zfs_rename_002_pos', 'zfs_rename_003_pos',
|
||||||
'zfs_rename_004_neg', 'zfs_rename_005_neg',
|
'zfs_rename_004_neg', 'zfs_rename_005_neg', 'zfs_rename_006_pos',
|
||||||
'zfs_rename_007_pos', 'zfs_rename_008_pos', 'zfs_rename_009_neg',
|
'zfs_rename_007_pos', 'zfs_rename_008_pos', 'zfs_rename_009_neg',
|
||||||
'zfs_rename_010_neg', 'zfs_rename_011_pos', 'zfs_rename_012_neg',
|
'zfs_rename_010_neg', 'zfs_rename_011_pos', 'zfs_rename_012_neg',
|
||||||
'zfs_rename_013_pos']
|
'zfs_rename_013_pos']
|
||||||
|
|
|
@ -24,6 +24,10 @@
|
||||||
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
|
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
|
||||||
# Use is subject to license terms.
|
# Use is subject to license terms.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# Copyright (c) 2015 by Delphix. All rights reserved.
|
||||||
|
#
|
||||||
. $STF_SUITE/include/libtest.shlib
|
. $STF_SUITE/include/libtest.shlib
|
||||||
. $STF_SUITE/tests/functional/cli_root/zfs_rename/zfs_rename.kshlib
|
. $STF_SUITE/tests/functional/cli_root/zfs_rename/zfs_rename.kshlib
|
||||||
|
|
||||||
|
@ -35,6 +39,7 @@
|
||||||
# 1. Create a snapshot of volume.
|
# 1. Create a snapshot of volume.
|
||||||
# 2. Rename volume snapshot to a new one.
|
# 2. Rename volume snapshot to a new one.
|
||||||
# 3. Rename volume to a new one.
|
# 3. Rename volume to a new one.
|
||||||
|
# 4. Create a clone of the snapshot.
|
||||||
# 5. Verify that the rename operations are successful and zfs list can
|
# 5. Verify that the rename operations are successful and zfs list can
|
||||||
# list them.
|
# list them.
|
||||||
#
|
#
|
||||||
|
@ -62,14 +67,18 @@ rename_dataset $vol ${vol}-new
|
||||||
rename_dataset ${vol}-new@${snap}-new ${vol}-new@$snap
|
rename_dataset ${vol}-new@${snap}-new ${vol}-new@$snap
|
||||||
rename_dataset ${vol}-new $vol
|
rename_dataset ${vol}-new $vol
|
||||||
|
|
||||||
|
clone=$TESTPOOL/${snap}_clone
|
||||||
|
create_clone $vol@$snap $clone
|
||||||
|
|
||||||
#verify data integrity
|
#verify data integrity
|
||||||
for input in $VOL_R_PATH ${VOL_R_PATH}@$snap; do
|
for input in $VOL_R_PATH $ZVOL_RDEVDIR/$clone; do
|
||||||
log_must eval "$DD if=$input of=$VOLDATA bs=$BS count=$CNT >/dev/null 2>&1"
|
log_must eval "$DD if=$input of=$VOLDATA bs=$BS count=$CNT >/dev/null 2>&1"
|
||||||
if ! cmp_data $VOLDATA $DATA ; then
|
if ! cmp_data $VOLDATA $DATA ; then
|
||||||
log_fail "$input gets corrupted after rename operation."
|
log_fail "$input gets corrupted after rename operation."
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
destroy_clone $clone
|
||||||
log_must $ZFS destroy $vol@$snap
|
log_must $ZFS destroy $vol@$snap
|
||||||
|
|
||||||
log_pass "'zfs rename' can rename volume snapshot as expected."
|
log_pass "'zfs rename' can rename volume snapshot as expected."
|
||||||
|
|
Loading…
Reference in New Issue