SGI compiler fixes.
[kai/samba.git] / testsuite / build_farm / basicsmb.test
1 test_smb_conf_setup() {
2         cat basicsmb.smb.conf.template | sed "s|PREFIX|$prefix|g" | sed "s|BUILD_FARM|$pwd|g" > $prefix/lib/smb.conf
3         echo "Setting up smb.conf:"
4         cat $prefix/lib/smb.conf
5
6 }
7
8 test_smbpasswd() {
9         ( echo $password ; echo $password; ) | $prefix/bin/smbpasswd -L -s -a $whoami
10         status=$?
11         if [ $status = 0 ]; then
12             echo "smbpasswd correctly set inital password ($password)"
13         else
14             echo "smbpasswd failed to set inital password ($password)!"
15             return 1
16         fi
17         return 0
18 }
19
20 test_sharelist() {
21         if $prefix/bin/smbclient -U$whoami% -L $host; then
22                 echo "smbd listed shares OK"
23         else
24                 echo "listing shares with smbd failed with $?"
25                 return 1
26         fi
27         return 0
28 }
29
30 test_listfiles() {
31         if $prefix/bin/smbclient //$host/samba -U$whoami% -c 'ls'; then
32                 echo "listed files OK"
33         else 
34                 echo "listing files with smbd failed with $?"
35                 return 1
36         fi
37         return 0
38 }
39
40 test_listfilesauth() {
41         if $prefix/bin/smbclient //$host/samba_2_2 -U$whoami%$password -c 'ls'; then
42                 echo "listed files OK"
43         else 
44                 echo "listing files with smbd failed with $?"
45                 return 1
46         fi
47         return 0
48 }
49
50
51 (test_smb_conf_setup && test_smbpasswd) || exit 1
52
53 test_sharelist
54 test_listfiles
55 test_listfilesauth
56
57