]> granicus.if.org Git - zfs/commitdiff
ZTS: Fix mmp_hostid test
authorIgor K <igor@dilos.org>
Tue, 8 Oct 2019 20:40:17 +0000 (23:40 +0300)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 8 Oct 2019 20:40:17 +0000 (13:40 -0700)
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

tests/zfs-tests/tests/functional/mmp/mmp_hostid.ksh

index b492b1070caffbd665bb270c1baafd354375de65..e3c6e34f4bc0b03840ecc42c99e80ba6757d153e 100755 (executable)
@@ -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