diff options
author | Igor K <igor@dilos.org> | 2019-10-08 23:40:17 +0300 |
---|---|---|
committer | Brian Behlendorf <behlendorf1@llnl.gov> | 2019-10-08 13:40:17 -0700 |
commit | d0a84ba92b40085b46efee9bc1219490876c7a68 (patch) | |
tree | 7113175141c7805788f52630504292f888e7aece /tests/zfs-tests | |
parent | 7b50929851b055deb96fcba919791d5699563e5d (diff) |
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 <behlendorf1@llnl.gov>
Signed-off-by: Igor Kozhukhov <igor@dilos.org>
Closes #9349
Diffstat (limited to 'tests/zfs-tests')
-rwxr-xr-x | tests/zfs-tests/tests/functional/mmp/mmp_hostid.ksh | 6 |
1 files changed, 5 insertions, 1 deletions
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 |