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