diff options
Diffstat (limited to 'tests/zfs-tests/tests/functional/cli_user/misc/zpool_wait_privilege.ksh')
-rwxr-xr-x | tests/zfs-tests/tests/functional/cli_user/misc/zpool_wait_privilege.ksh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_wait_privilege.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_wait_privilege.ksh new file mode 100755 index 000000000000..42a2dd2c63ee --- /dev/null +++ b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_wait_privilege.ksh @@ -0,0 +1,35 @@ +#!/bin/ksh -p +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2019 by Delphix. All rights reserved. +# + +. $STF_SUITE/include/libtest.shlib + +# +# DESCRIPTION: +# +# zpool wait works when run as an unprivileged user +# + +verify_runnable "global" + +log_must zpool wait $TESTPOOL + +# Make sure printing status works as unprivileged user. +output=$(zpool wait -H $TESTPOOL 1) || \ + log_fail "'zpool wait -H $TESTPOOL 1' failed" +# There should be one line of status output in a pool with no activity. +log_must eval '[[ $(wc -l <<<$output) -ge 1 ]]' + +log_pass "zpool wait works when run as a user" |