1#!/bin/ksh -p
2
3#
4# This file and its contents are supplied under the terms of the
5# Common Development and Distribution License ("CDDL"), version 1.0.
6# You may only use this file in accordance with the terms of version
7# 1.0 of the CDDL.
8#
9# A full copy of the text of the CDDL should have accompanied this
10# source.  A copy of the CDDL is also available via the Internet at
11# http://www.illumos.org/license/CDDL.
12#
13
14#
15# Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
16#
17
18. $STF_SUITE/include/libtest.shlib
19
20#
21# DESCRIPTION:
22# Wrong arguments passed to zpool reopen should cause an error.
23#
24# STRATEGY:
25# 1. Create an array with bad 'zpool reopen' arguments.
26# 2. For each argument execute the 'zpool reopen' command and verify
27#    if it returns an error.
28#
29
30verify_runnable "global"
31
32# 1. Create an array with bad 'zpool reopen' arguments.
33typeset -a args=("!" "1" "-s" "--n" "-1" "-" "-c" "-f" "-d 2" "-abc" "-na")
34
35log_assert "Test 'zpool reopen' with invalid arguments."
36
37# 2. For each argument execute the 'zpool reopen' command and verify
38#    if it returns an error.
39for arg in ${args[@]}; do
40	log_mustnot zpool reopen $arg
41done
42
43log_pass "Passing invalid arguments to 'zpool reopen' failed as expected."
44