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.
25 # Copyright 2018 Nexenta Systems, Inc. All rights reserved.
32 # Verify user and domain can work in .nsmbrc
35 # 1. create a .nsmbrc file
36 # 2. run "smbutil view //$server"
37 # 3. run "mount -F smbfs //$server/public $TMNT"
38 # 4. smbutil and mount can get the right message
41 .
$STF_SUITE/include
/libtest.ksh
44 tc_desc
=" Verify user and domain in sever section 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
52 server
=$
(server_name
) ||
return
54 cti_execute_cmd
"rm -f ~/.nsmbrc"
58 pass
=$
(smbutil
crypt $TPASS)
59 SERVER
=$
(echo $server |
tr "[:lower:]" "[:upper:]")
60 echo "[$SERVER]" > ~
/.nsmbrc
61 echo "password=$pass" >> ~
/.nsmbrc
62 echo "user=$TUSER" >> ~
/.nsmbrc
63 echo "domain=mydomain" >> ~
/.nsmbrc
64 cti_execute_cmd
chmod 600 ~
/.nsmbrc
66 cmd
="smbutil view //$server"
67 cti_execute
-i '' FAIL
$cmd
68 if [[ $?
!= 0 ]]; then
69 cti_fail
"FAIL: user and domain properties in default SERVER section" \
73 cti_report
"PASS: user and domain properties in default SERVER section" \
77 cmd
="mount -F smbfs //$server/public $TMNT"
78 cti_execute
-i '' FAIL
$cmd
79 if [[ $?
!= 0 ]]; then
80 cti_fail
"FAIL: user and domain properties in default SERVER section" \
84 cti_report
"PASS: user and domain properties in default SERVER section" \
89 if [[ $?
!= 0 ]]; then
94 cti_execute_cmd
"rm -f ~/.nsmbrc"
97 cti_pass
"${tc_id}: PASS"