From 8af362c3e9c04d030b995b4f8779b7680a7af397 Mon Sep 17 00:00:00 2001 From: Igor K Date: Tue, 8 Oct 2019 23:40:17 +0300 Subject: [PATCH] ZTS: Fix mmp_hostid test Correctly use the `mntpnt_fs` variable, and include additional logic to ensure the /etc/hostid is correct set up and cleaned up. Signed-off-by: Brian Behlendorf Signed-off-by: Igor Kozhukhov Closes #9349 --- tests/zfs-tests/tests/functional/mmp/mmp_hostid.ksh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/zfs-tests/tests/functional/mmp/mmp_hostid.ksh b/tests/zfs-tests/tests/functional/mmp/mmp_hostid.ksh index b492b1070..e3c6e34f4 100755 --- a/tests/zfs-tests/tests/functional/mmp/mmp_hostid.ksh +++ b/tests/zfs-tests/tests/functional/mmp/mmp_hostid.ksh @@ -43,6 +43,9 @@ function cleanup log_must rm $MMP_DIR/file.{0,1,2,3,4,5} log_must rmdir $MMP_DIR log_must mmp_clear_hostid + if [[ -L $HOSTID_FILE ]]; then + rm -f $HOSTID_FILE + fi } log_assert "Verify hostid file can reside on a ZFS dataset" @@ -64,10 +67,11 @@ log_must mv $HOSTID_FILE $mntpnt_etc/hostid # 3. Create a file so the pool will have some contents log_must zfs create $MMP_POOL/fs mntpnt_fs=$(get_prop mountpoint $MMP_POOL/fs) -log_must mkfile 1M $fs_mntpnt/file +log_must mkfile 1M $mntpnt_fs/file # 4. Verify multihost cannot be enabled until the /etc/hostid is linked log_mustnot zpool set multihost=on $MMP_POOL +log_mustnot ls -l $HOSTID_FILE log_must ln -s $mntpnt_etc/hostid $HOSTID_FILE log_must zpool set multihost=on $MMP_POOL