summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Rosenfeld <hans.rosenfeld@nexenta.com>2015-03-03 15:06:53 +0100
committerDan McDonald <danmcd@omniti.com>2015-03-10 15:52:35 -0400
commitc029eafbb040b81649027c5ae5a38e92d214461b (patch)
tree38f178e9a6326432687a0c66d7972727ff3122a2
parentc79a74a8321729c8f50472db67e907324bace4e5 (diff)
downloadillumos-joyent-c029eafbb040b81649027c5ae5a38e92d214461b.tar.gz
5684 ZFS bootfs tests need some work
Reviewed by: Jean McCormack <jean.mccormack@nexenta.com> Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com> Reviewed by: John Kennedy <john.kennedy@delphix.com> Approved by: Dan McDonald <danmcd@omniti.com>
-rw-r--r--usr/src/pkg/manifests/system-test-zfstest.mf3
-rw-r--r--usr/src/test/zfs-tests/runfiles/delphix.run2
-rw-r--r--usr/src/test/zfs-tests/runfiles/omnios.run2
-rw-r--r--usr/src/test/zfs-tests/runfiles/openindiana.run2
-rw-r--r--usr/src/test/zfs-tests/tests/functional/bootfs/Makefile3
-rw-r--r--usr/src/test/zfs-tests/tests/functional/bootfs/bootfs_001_pos.ksh7
-rw-r--r--usr/src/test/zfs-tests/tests/functional/bootfs/bootfs_002_neg.ksh25
-rw-r--r--usr/src/test/zfs-tests/tests/functional/bootfs/bootfs_007_pos.ksh (renamed from usr/src/test/zfs-tests/tests/functional/bootfs/bootfs_007_neg.ksh)10
8 files changed, 28 insertions, 26 deletions
diff --git a/usr/src/pkg/manifests/system-test-zfstest.mf b/usr/src/pkg/manifests/system-test-zfstest.mf
index 3a97a72f1b..10f8d357df 100644
--- a/usr/src/pkg/manifests/system-test-zfstest.mf
+++ b/usr/src/pkg/manifests/system-test-zfstest.mf
@@ -12,6 +12,7 @@
#
# Copyright (c) 2012, 2014 by Delphix. All rights reserved.
# Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2015, Nexenta Systems Inc. All rights reserved.
#
set name=pkg.fmri value=pkg:/system/test/zfstest@$(PKGVERS)
@@ -300,7 +301,7 @@ file path=opt/zfs-tests/tests/functional/bootfs/bootfs_003_pos mode=0555
file path=opt/zfs-tests/tests/functional/bootfs/bootfs_004_neg mode=0555
file path=opt/zfs-tests/tests/functional/bootfs/bootfs_005_neg mode=0555
file path=opt/zfs-tests/tests/functional/bootfs/bootfs_006_pos mode=0555
-file path=opt/zfs-tests/tests/functional/bootfs/bootfs_007_neg mode=0555
+file path=opt/zfs-tests/tests/functional/bootfs/bootfs_007_pos mode=0555
file path=opt/zfs-tests/tests/functional/bootfs/bootfs_008_neg mode=0555
file path=opt/zfs-tests/tests/functional/cache/cache.cfg mode=0555
file path=opt/zfs-tests/tests/functional/cache/cache.kshlib mode=0555
diff --git a/usr/src/test/zfs-tests/runfiles/delphix.run b/usr/src/test/zfs-tests/runfiles/delphix.run
index 6ba4b94cea..eef8eef38b 100644
--- a/usr/src/test/zfs-tests/runfiles/delphix.run
+++ b/usr/src/test/zfs-tests/runfiles/delphix.run
@@ -56,7 +56,7 @@ tests = ['atime_001_pos', 'atime_002_neg']
[/opt/zfs-tests/tests/functional/bootfs]
tests = ['bootfs_001_pos', 'bootfs_002_neg', 'bootfs_003_pos',
- 'bootfs_004_neg', 'bootfs_005_neg', 'bootfs_006_pos', 'bootfs_007_neg',
+ 'bootfs_004_neg', 'bootfs_005_neg', 'bootfs_006_pos', 'bootfs_007_pos',
'bootfs_008_neg']
pre =
post =
diff --git a/usr/src/test/zfs-tests/runfiles/omnios.run b/usr/src/test/zfs-tests/runfiles/omnios.run
index ba9438b811..a4a3184ebe 100644
--- a/usr/src/test/zfs-tests/runfiles/omnios.run
+++ b/usr/src/test/zfs-tests/runfiles/omnios.run
@@ -56,7 +56,7 @@ tests = ['atime_001_pos', 'atime_002_neg']
[/opt/zfs-tests/tests/functional/bootfs]
tests = ['bootfs_001_pos', 'bootfs_002_neg', 'bootfs_003_pos',
- 'bootfs_004_neg', 'bootfs_005_neg', 'bootfs_006_pos', 'bootfs_007_neg',
+ 'bootfs_004_neg', 'bootfs_005_neg', 'bootfs_006_pos', 'bootfs_007_pos',
'bootfs_008_neg']
pre =
post =
diff --git a/usr/src/test/zfs-tests/runfiles/openindiana.run b/usr/src/test/zfs-tests/runfiles/openindiana.run
index ba9438b811..a4a3184ebe 100644
--- a/usr/src/test/zfs-tests/runfiles/openindiana.run
+++ b/usr/src/test/zfs-tests/runfiles/openindiana.run
@@ -56,7 +56,7 @@ tests = ['atime_001_pos', 'atime_002_neg']
[/opt/zfs-tests/tests/functional/bootfs]
tests = ['bootfs_001_pos', 'bootfs_002_neg', 'bootfs_003_pos',
- 'bootfs_004_neg', 'bootfs_005_neg', 'bootfs_006_pos', 'bootfs_007_neg',
+ 'bootfs_004_neg', 'bootfs_005_neg', 'bootfs_006_pos', 'bootfs_007_pos',
'bootfs_008_neg']
pre =
post =
diff --git a/usr/src/test/zfs-tests/tests/functional/bootfs/Makefile b/usr/src/test/zfs-tests/tests/functional/bootfs/Makefile
index 8fa874cc40..c6ca6e8d95 100644
--- a/usr/src/test/zfs-tests/tests/functional/bootfs/Makefile
+++ b/usr/src/test/zfs-tests/tests/functional/bootfs/Makefile
@@ -11,6 +11,7 @@
#
# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright 2015 Nexenta Systems, Inc.
#
include $(SRC)/Makefile.master
@@ -24,7 +25,7 @@ PROGS = bootfs_001_pos \
bootfs_004_neg \
bootfs_005_neg \
bootfs_006_pos \
- bootfs_007_neg \
+ bootfs_007_pos \
bootfs_008_neg
CMDS = $(PROGS:%=$(TESTDIR)/%)
diff --git a/usr/src/test/zfs-tests/tests/functional/bootfs/bootfs_001_pos.ksh b/usr/src/test/zfs-tests/tests/functional/bootfs/bootfs_001_pos.ksh
index 5fb22e3b69..abd3d0a7f5 100644
--- a/usr/src/test/zfs-tests/tests/functional/bootfs/bootfs_001_pos.ksh
+++ b/usr/src/test/zfs-tests/tests/functional/bootfs/bootfs_001_pos.ksh
@@ -24,16 +24,18 @@
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# Copyright 2015 Nexenta Systems, Inc.
+#
. $STF_SUITE/include/libtest.shlib
#
# DESCRIPTION:
#
-# Valid datasets are accepted as bootfs property values
+# Valid datasets and snapshots are accepted as bootfs property values
#
# STRATEGY:
-# 1. Create a set of datasets in a test pool
+# 1. Create a set of datasets and snapshots in a test pool
# 2. Try setting them as boot filesystems
#
@@ -68,6 +70,7 @@ log_must $ZFS snapshot $TESTPOOL/$TESTFS@snap
log_must $ZFS clone $TESTPOOL/$TESTFS@snap $TESTPOOL/clone
log_must $ZPOOL set bootfs=$TESTPOOL/$TESTFS $TESTPOOL
+log_must $ZPOOL set bootfs=$TESTPOOL/$TESTFS@snap $TESTPOOL
log_must $ZPOOL set bootfs=$TESTPOOL/clone $TESTPOOL
log_must $ZFS promote $TESTPOOL/clone
diff --git a/usr/src/test/zfs-tests/tests/functional/bootfs/bootfs_002_neg.ksh b/usr/src/test/zfs-tests/tests/functional/bootfs/bootfs_002_neg.ksh
index 93800dccc5..a894778773 100644
--- a/usr/src/test/zfs-tests/tests/functional/bootfs/bootfs_002_neg.ksh
+++ b/usr/src/test/zfs-tests/tests/functional/bootfs/bootfs_002_neg.ksh
@@ -24,6 +24,8 @@
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# Copyright 2015 Nexenta Systems, Inc.
+#
. $STF_SUITE/include/libtest.shlib
@@ -34,21 +36,13 @@
#
# STRATEGY:
#
-# 1. Create a snapshot and a zvol
-# 2. Verify that we can't set the bootfs to those datasets
+# 1. Create a zvol
+# 2. Verify that we can't set the bootfs to that dataset
#
verify_runnable "global"
function cleanup {
- if snapexists $TESTPOOL/$TESTFS@snap
- then
- $ZFS destroy $TESTPOOL/$TESTFS@snap
- fi
- if datasetexists $TESTPOOL/$TESTFS
- then
- log_must $ZFS destroy $TESTPOOL/$TESTFS
- fi
if datasetexists $TESTPOOL/vol
then
log_must $ZFS destroy $TESTPOOL/vol
@@ -57,6 +51,9 @@ function cleanup {
then
log_must $ZPOOL destroy $TESTPOOL
fi
+ if [[ -f $VDEV ]]; then
+ log_must $RM -f $VDEV
+ fi
}
@@ -69,14 +66,12 @@ fi
log_assert "Invalid datasets are rejected as boot property values"
log_onexit cleanup
-DISK=${DISKS%% *}
+typeset VDEV=/bootfs_002_neg_a.$$.dat
-log_must $ZPOOL create $TESTPOOL $DISK
-log_must $ZFS create $TESTPOOL/$TESTFS
-log_must $ZFS snapshot $TESTPOOL/$TESTFS@snap
+log_must $MKFILE 400m $VDEV
+create_pool "$TESTPOOL" "$VDEV"
log_must $ZFS create -V 10m $TESTPOOL/vol
-log_mustnot $ZPOOL set bootfs=$TESTPOOL/$TESTFS@snap $TESTPOOL
log_mustnot $ZPOOL set bootfs=$TESTPOOL/vol $TESTPOOL
log_pass "Invalid datasets are rejected as boot property values"
diff --git a/usr/src/test/zfs-tests/tests/functional/bootfs/bootfs_007_neg.ksh b/usr/src/test/zfs-tests/tests/functional/bootfs/bootfs_007_pos.ksh
index a80f45ab98..17cfc5017b 100644
--- a/usr/src/test/zfs-tests/tests/functional/bootfs/bootfs_007_neg.ksh
+++ b/usr/src/test/zfs-tests/tests/functional/bootfs/bootfs_007_pos.ksh
@@ -24,6 +24,8 @@
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# Copyright 2015 Nexenta Systems, Inc.
+#
. $STF_SUITE/include/libtest.shlib
@@ -31,12 +33,12 @@
# DESCRIPTION:
#
# Setting bootfs on a pool which was configured with the whole disk
-# (i.e. EFI) will fail
+# (i.e. EFI) works.
#
# STRATEGY:
# 1. create a pool with a whole disk
# 2. create a filesystem on this pool
-# 3. verify we can not set bootfs on the filesystem we just created.
+# 3. verify we can set bootfs on the filesystem we just created.
#
verify_runnable "global"
@@ -52,12 +54,12 @@ log_onexit cleanup
DISK=${DISKS%% *}
typeset EFI_BOOTFS=$TESTPOOL/efs
typeset assert_mesg="setting bootfs on a pool which was configured with the \
- whole disk will fail"
+ whole disk works"
log_assert $assert_mesg
create_pool "$TESTPOOL" "$DISK"
log_must $ZFS create $EFI_BOOTFS
-log_mustnot $ZPOOL set bootfs=$EFI_BOOTFS $TESTPOOL
+log_must $ZPOOL set bootfs=$EFI_BOOTFS $TESTPOOL
log_pass $assert_mesg