Merge remote-tracking branch 'origin/master'
[unleashed/lotheac.git] / usr / src / test / smbclient-tests / tests / smbmount / tp_smbmount_015.ksh
blob6bfeb65a1fd98c14041e51132b2189b422b7da8a
1 #!/bin/ksh -p
3 # CDDL HEADER START
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]
20 # CDDL HEADER END
24 # Copyright 2010 Sun Microsystems, Inc. All rights reserved.
28 # ID: smbmount_015
30 # DESCRIPTION:
31 # Verify smbmount can mount 2 private shares
33 # STRATEGY:
34 # 1. run "mount -F smbfs -o dirperms=777,fileperms=666
35 # //$AUSER:$APASS@$server/$AUSER $TMNT"
36 # 2 mount successfully
37 # 3. run "mount -F smbfs -o dirperms=777,fileperms=666
38 # //$BUSER:$BPASS@$server/$BUSER $TMNT2"
39 # 4 mount successfully
42 . $STF_SUITE/include/libtest.ksh
44 tc_id="smbmount015"
45 tc_desc="Verify smbmount can mount 2 private shares"
46 print_test_case $tc_id - $tc_desc
48 if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
49 [[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
50 set -x
53 server=$(server_name) || return
55 # SKIP for now (mount priv issues)
56 no_tested || return
58 testdir_init $TDIR
59 smbmount_clean $TMNT
60 smbmount_init $TMNT
61 smbmount_clean $TMNT2
62 smbmount_init $TMNT2
64 cmd="mount -F smbfs -o noprompt,dirperms=777,fileperms=666
65 //$AUSER:$APASS@$server/a_share $TMNT"
66 cti_execute -i '' FAIL $cmd
67 if [[ $? != 0 ]]; then
68 cti_fail "FAIL: smbmount can't mount the share a_share"
69 return
70 else
71 cti_report "PASS: smbmount can mount the share a_share"
74 smbmount_check $TMNT || return
76 cmd="cp /usr/bin/ls $TMNT/ls_file"
77 cti_execute FAIL sudo -n -u $AUSER $cmd
79 cmd="diff /usr/bin/ls $TMNT/ls_file"
80 cti_execute FAIL sudo -n -u $AUSER $cmd
82 cmd="mount -F smbfs -o noprompt,dirperms=777,fileperms=666
83 //$BUSER:$BPASS@$server/$BUSER $TMNT2"
84 cti_execute -i '' FAIL $cmd
86 smbmount_check $TMNT || return
88 cmd="cp /usr/bin/ls $TMNT/ls_file"
89 cti_execute FAIL sudo -n -u $AUSER $cmd
91 cmd="diff /usr/bin/ls $TMNT/ls_file"
92 cti_execute FAIL sudo -n -u $AUSER $cmd
94 cmd="umount $TMNT"
95 cti_execute_cmd $cmd
96 if [[ $? != 0 ]]; then
97 cti_fail "FAIL: failed to umount the $TMNT"
98 return
99 else
100 cti_report "PASS: umount the $TMNT successfully"
103 cmd="umount $TMNT2"
104 cti_execute_cmd $cmd
105 if [[ $? != 0 ]]; then
106 cti_fail "FAIL: failed to umount the $TMNT2"
107 return
108 cti_report "PASS: umount the $TMNT2 successfully"
111 smbmount_clean $TMNT
112 smbmount_clean $TMNT2
114 cti_pass "${tc_id}: PASS"