xref: /illumos-gate/usr/src/test/smbclient-tests/tests/smbutil/tp_smbutil_012.ksh (revision cd61ae21816e53b94bc1673f3f1aa651fc3115e8)
1#!/bin/ksh -p
2#
3# CDDL HEADER START
4#
5# The contents of this file are subject to the terms of the
6# Common Development and Distribution License (the "License").
7# You may not use this file except in compliance with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22
23#
24# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
25#
26
27#
28# ID: smbutil_012
29#
30# DESCRIPTION:
31#        Verify smbutil -A can work
32#
33# STRATEGY:
34#	1. run "smbutil view -A //$server"
35#	2. smbutil can get share information
36#
37
38. $STF_SUITE/include/libtest.ksh
39
40tc_id="smbutil012"
41tc_desc="Verify smbutil -A can work"
42print_test_case $tc_id - $tc_desc
43
44if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
45	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
46    set -x
47fi
48
49server=$(server_name) || return
50
51cmd="smbutil view -A //$server"
52cti_execute_cmd $cmd
53if [[ $? != 0 ]]; then
54	cti_fail "FAIL: smbutil can't view the shares"
55	return
56else
57	cti_report "PASS: smbutil can view the shares"
58fi
59
60parse_view_output public cti_stdout
61if [[ $? != 0 ]]; then
62	cti_fail "FAIL: smbutil view can't get the public share"
63	return
64else
65	cti_report "PASS: smbutil view can get the public share"
66fi
67
68cti_pass "${tc_id}: PASS"
69