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.
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.
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]
24 # Copyright 2010 Sun Microsystems, Inc. All rights reserved.
31 # Verify password can work
34 # 1. run "sharectl set -p section=$SERVER:$TUSER -p password=$pass smbfs"
35 # 2. run "sharectl set -p section=$SERVER:$TUSER -p addr=$server smbfs"
36 # 3. run "smbutil view //$TUSER1@$server"
37 # 4. run "mount -F smbfs //$TUSER@$server/public $TMNT"
38 # 3. sharectl, smbutil and mount can get right message
41 .
$STF_SUITE/include
/libtest.ksh
44 tc_desc
="Verify password can work"
45 print_test_case
$tc_id - $tc_desc
47 if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
48 [[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
57 server
=$
(server_name
) ||
return
59 pass
=$
(smbutil
crypt $TPASS)
60 SERVER
=$
(echo $server|
tr "[:lower:]" "[:upper:]")
62 cmd
="sharectl set -p section=$SERVER:$TUSER -p password=\$pass smbfs"
64 if [[ $?
!= 0 ]]; then
65 cti_fail
"FAIL: sharectl set password in $SERVER section failed"
68 cti_report
"PASS: sharectl set password in $SERVER section succeeded"
71 cmd
="sharectl set -p section=$SERVER:$TUSER -p addr=$server smbfs"
73 if [[ $?
!= 0 ]]; then
74 cti_fail
"FAIL: sharectl set addr in $SERVER section failed"
75 sharectl delsect
$SERVER:$TUSER smbfs
78 cti_report
"PASS: sharectl set addr in $SERVER section succeeded"
83 # get rid of our connection first
84 cti_execute_cmd
"smbutil discon //$TUSER1@$server"
87 cti_report
"expect failure next"
88 cmd
="smbutil view -N //$TUSER1@$server"
89 cti_execute
-i '' PASS
$cmd
90 if [[ $?
== 0 ]]; then
91 cti_fail
"FAIL: smbutil view succeeded for SERVER password by $TUSER1"
92 sharectl delsect
$SERVER:$TUSER smbfs
95 cti_report
"PASS: smbutil view ffailed for SERVER password by $TUSER1"
98 cmd
="mount -F smbfs //$TUSER@$server/public $TMNT"
99 cti_execute
-i '' FAIL
$cmd
100 if [[ $?
!= 0 ]]; then
101 cti_fail
"FAIL: smbmount can't mount the public share by $TUSER"
102 sharectl delsect
$SERVER:$TUSER smbfs
105 cti_report
"PASS: smbmount can mount the public share by $TUSER"
109 if [[ $?
!= 0 ]]; then
111 sharectl delsect
$SERVER:$TUSER smbfs
116 sharectl delsect
$SERVER:$TUSER smbfs
118 cti_pass
"${tc_id}: PASS"