aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTony Hutter <[email protected]>2019-07-19 11:21:54 -0700
committerBrian Behlendorf <[email protected]>2019-07-19 11:21:54 -0700
commitd84c5a120e992a3576b0fdab233ed619ffeb9539 (patch)
treecabdd1fdd8eda9f37c5329ff49230d533c238a11 /tests
parent7f31908913592b3075306daf403f2a334602493e (diff)
Move some tests to cli_user/zpool_status
The tests in tests/functional/cli_root/zpool_status should all require root. However, linux.run has "user =" specified for those tests, which means they run as a normal user. When I removed that line to run them as root, the following tests did not pass: zpool_status_003_pos zpool_status_-c_disable zpool_status_-c_homedir zpool_status_-c_searchpath These tests need to be run as a normal user. To fix this, move these tests to a new tests/functional/cli_user/zpool_status directory. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Signed-off-by: Tony Hutter <[email protected]> Closes #9057
Diffstat (limited to 'tests')
-rw-r--r--tests/runfiles/linux.run11
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zpool_status/Makefile.am6
-rw-r--r--tests/zfs-tests/tests/functional/cli_user/Makefile.am3
-rw-r--r--tests/zfs-tests/tests/functional/cli_user/zpool_status/Makefile.am8
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zpool_status/cleanup.ksh30
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zpool_status/setup.ksh32
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_-c_disable.ksh (renamed from tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_-c_disable.ksh)0
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_-c_homedir.ksh (renamed from tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_-c_homedir.ksh)0
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_-c_searchpath.ksh (renamed from tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_-c_searchpath.ksh)0
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_003_pos.ksh (renamed from tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_003_pos.ksh)0
10 files changed, 80 insertions, 10 deletions
diff --git a/tests/runfiles/linux.run b/tests/runfiles/linux.run
index 4a0e151f4..f1337cbc7 100644
--- a/tests/runfiles/linux.run
+++ b/tests/runfiles/linux.run
@@ -458,10 +458,7 @@ tests = ['zpool_split_cliargs', 'zpool_split_devices',
tags = ['functional', 'cli_root', 'zpool_split']
[tests/functional/cli_root/zpool_status]
-tests = ['zpool_status_001_pos', 'zpool_status_002_pos','zpool_status_003_pos',
- 'zpool_status_-c_disable', 'zpool_status_-c_homedir',
- 'zpool_status_-c_searchpath']
-user =
+tests = ['zpool_status_001_pos', 'zpool_status_002_pos']
tags = ['functional', 'cli_root', 'zpool_status']
[tests/functional/cli_root/zpool_sync]
@@ -525,6 +522,12 @@ tests = ['zpool_list_001_pos', 'zpool_list_002_neg']
user =
tags = ['functional', 'cli_user', 'zpool_list']
+[tests/functional/cli_user/zpool_status]
+tests = ['zpool_status_003_pos', 'zpool_status_-c_disable',
+ 'zpool_status_-c_homedir', 'zpool_status_-c_searchpath']
+user =
+tags = ['functional', 'cli_user', 'zpool_status']
+
[tests/functional/compression]
tests = ['compress_001_pos', 'compress_002_pos', 'compress_003_pos',
'compress_004_pos']
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_status/Makefile.am b/tests/zfs-tests/tests/functional/cli_root/zpool_status/Makefile.am
index aab4de0e7..beb59e3d0 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_status/Makefile.am
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_status/Makefile.am
@@ -3,8 +3,4 @@ dist_pkgdata_SCRIPTS = \
setup.ksh \
cleanup.ksh \
zpool_status_001_pos.ksh \
- zpool_status_002_pos.ksh \
- zpool_status_003_pos.ksh \
- zpool_status_-c_disable.ksh \
- zpool_status_-c_homedir.ksh \
- zpool_status_-c_searchpath.ksh
+ zpool_status_002_pos.ksh
diff --git a/tests/zfs-tests/tests/functional/cli_user/Makefile.am b/tests/zfs-tests/tests/functional/cli_user/Makefile.am
index f1ff32e8d..119f8ee18 100644
--- a/tests/zfs-tests/tests/functional/cli_user/Makefile.am
+++ b/tests/zfs-tests/tests/functional/cli_user/Makefile.am
@@ -2,4 +2,5 @@ SUBDIRS = \
misc \
zfs_list \
zpool_iostat \
- zpool_list
+ zpool_list \
+ zpool_status
diff --git a/tests/zfs-tests/tests/functional/cli_user/zpool_status/Makefile.am b/tests/zfs-tests/tests/functional/cli_user/zpool_status/Makefile.am
new file mode 100644
index 000000000..e1b339657
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_user/zpool_status/Makefile.am
@@ -0,0 +1,8 @@
+pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/cli_user/zpool_status
+dist_pkgdata_SCRIPTS = \
+ setup.ksh \
+ cleanup.ksh \
+ zpool_status_003_pos.ksh \
+ zpool_status_-c_disable.ksh \
+ zpool_status_-c_homedir.ksh \
+ zpool_status_-c_searchpath.ksh
diff --git a/tests/zfs-tests/tests/functional/cli_user/zpool_status/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_user/zpool_status/cleanup.ksh
new file mode 100755
index 000000000..79cd6e9f9
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_user/zpool_status/cleanup.ksh
@@ -0,0 +1,30 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+default_cleanup
diff --git a/tests/zfs-tests/tests/functional/cli_user/zpool_status/setup.ksh b/tests/zfs-tests/tests/functional/cli_user/zpool_status/setup.ksh
new file mode 100755
index 000000000..6a9af3bc2
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_user/zpool_status/setup.ksh
@@ -0,0 +1,32 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+DISK=${DISKS%% *}
+
+default_setup $DISK
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_-c_disable.ksh b/tests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_-c_disable.ksh
index c8105fb4a..c8105fb4a 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_-c_disable.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_-c_disable.ksh
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_-c_homedir.ksh b/tests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_-c_homedir.ksh
index 4cc3deb6d..4cc3deb6d 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_-c_homedir.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_-c_homedir.ksh
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_-c_searchpath.ksh b/tests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_-c_searchpath.ksh
index a075b9a0c..a075b9a0c 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_-c_searchpath.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_-c_searchpath.ksh
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_003_pos.ksh
index c5e0c6e47..c5e0c6e47 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_003_pos.ksh