126168Sfsmp#!/bin/ksh -p
226168Sfsmp#
350477Speter# CDDL HEADER START
426168Sfsmp#
526168Sfsmp# The contents of this file are subject to the terms of the
626168Sfsmp# Common Development and Distribution License (the "License").
728043Sfsmp# You may not use this file except in compliance with the License.
827728Sfsmp#
928043Sfsmp# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1026168Sfsmp# or https://opensource.org/licenses/CDDL-1.0.
1126168Sfsmp# See the License for the specific language governing permissions
1226168Sfsmp# and limitations under the License.
1326168Sfsmp#
1426168Sfsmp# When distributing Covered Code, include this CDDL HEADER in each
1526168Sfsmp# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1666716Sjhb# If applicable, add the following below this CDDL HEADER, with the
1766716Sjhb# fields enclosed by brackets "[]" replaced with your own identifying
1866716Sjhb# information: Portions Copyright [yyyy] [name of copyright owner]
1966716Sjhb#
2066716Sjhb# CDDL HEADER END
2166716Sjhb#
2293264Sdillon
2366716Sjhb#
2466716Sjhb# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
2566716Sjhb# Use is subject to license terms.
2628442Sfsmp#
2793264Sdillon
2893264Sdillon#
2993264Sdillon# Copyright (c) 2016 by Delphix. All rights reserved.
3093264Sdillon#
3193264Sdillon
3293264Sdillon. $STF_SUITE/include/libtest.shlib
3393264Sdillon#
3493264Sdillon# DESCRIPTION:
3566716Sjhb#
3666716Sjhb# Zpool set usage message is displayed when called with no arguments
3766716Sjhb#
3866716Sjhb# STRATEGY:
3966716Sjhb#	1. Run zpool set
4066716Sjhb#	2. Check that exit status is set to 2
4166716Sjhb#	3. Check usage message contains text "usage"
4293264Sdillon#
4393264Sdillon#
4427696Sfsmp
4538888Steggelog_assert "zpool set usage message is displayed when called with no arguments"
4638888Stegge
4738888Steggezpool set > /dev/null 2>&1
4834021SteggeRET=$?
4988322Sjhbif [ $RET != 2 ]
5073011Sjakethen
5134021Stegge	log_fail "\"zpool set\" exit status $RET should be equal to 2."
5273011Sjakefi
5338888Stegge
5438888Steggezpool set 2>&1 | grep -qi usage
5538888Steggeif [ $? != 0 ]
5634021Steggethen
5734021Stegge	log_fail "Usage message for zpool set did not contain the word 'usage'."
5834021Steggefi
5934021Stegge
6088322Sjhblog_pass "zpool set usage message is displayed when called with no arguments"
6128487Sfsmp