]> granicus.if.org Git - zfs/commitdiff
Fix zpool_add_005_pos
authorbunder2015 <omfgbunder@gmail.com>
Tue, 27 Jun 2017 17:06:07 +0000 (13:06 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 27 Jun 2017 17:06:07 +0000 (10:06 -0700)
Under Linux the existence of a block device in /etc/fstab is
not sufficient to prevent the use of the force flag.  Without
the force flag a warning will be printed that the device has
a filesystem of a given type.  Providing the force option
will overwrite that filesystem as long as it is not actively
mounted.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Tested-by: bunder2015 <omfgbunder@gmail.com>
Signed-off-by: bunder2015 <omfgbunder@gmail.com>
Closes #6267
Closes #6272

tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_005_pos.ksh

index a7c7bc04bb966ced3e7d284f6c793a00517a4c65..1516cb20afb47ac72f4fbbee7b97af6b025236aa 100755 (executable)
@@ -80,7 +80,11 @@ log_must poolexists "$TESTPOOL1"
 unset NOINUSE_CHECK
 log_mustnot zpool add -f "$TESTPOOL" ${disk}${SLICE_PREFIX}${SLICE1}
 log_mustnot zpool add -f "$TESTPOOL" $mnttab_dev
-log_mustnot zpool add -f "$TESTPOOL" $vfstab_dev
+if is_linux; then
+       log_mustnot zpool add "$TESTPOOL" $vfstab_dev
+else
+       log_mustnot zpool add -f "$TESTPOOL" $vfstab_dev
+fi
 
 if ! is_linux; then
        log_must echo "y" | newfs ${DEV_DSKDIR}/$dump_dev > /dev/null 2>&1