blob: 47c9c14a662bf17e91318fd44d556bc22946b38d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
#!/bin/sh
if [ $# -lt 5 ]; then
cat <<EOF
Usage: test_smbclient.sh SERVER USERNAME PASSWORD DOMAIN PREFIX
EOF
exit 1;
fi
SERVER=$1
USERNAME=$2
PASSWORD=$3
DOMAIN=$4
PREFIX=$5
shift 5
failed=0
runcmd() {
testit "$1" bin/smbclient //$SERVER/tmp -W "$DOMAIN "-U"$USERNAME"%"$PASSWORD"
}
incdir=`dirname $0`
. $incdir/test_functions.sh
# Generate random file
cat >tmpfile<<EOF
foo
bar
bloe
blah
EOF
# put that file
echo mput tmpfile | runcmd "Putting file" || failed=`expr $failed + 1`
# check file info
echo altname tmpfile | runcmd "Getting alternative name" || failed=`expr $failed + 1`
# run allinfo on that file
echo allinfo tmpfile | runcmd "Checking info on file" || failed=`expr $failed + 1`
# get that file
mv tmpfile tmpfile-old
echo mget tmpfile | runcmd "Getting file" || failed=`expr $failed + 1`
# remove that file
echo rm tmpfile | runcmd "Removing file" || failed=`expr $failed + 1`
# compare locally
testit "Comparing files" diff tmpfile-old tmpfile || failed=`expr $failed + 1`
# create directory
echo mkdir bla | runcmd "Creating directory" || failed=`expr $failed + 1`
# cd to directory
echo cd bla | runcmd "Changing directory" || failed=`expr $failed + 1`
# cd to top level directory
echo cd .. | runcmd "Going back" || failed=`expr $failed + 1`
# remove directory
echo rmdir bla | runcmd "Removing directory" || failed=`expr $failed + 1`
# enable recurse, create nested directory
echo "recurse; echo mkdir bla/bloe; exit" | runcmd "Creating nested directory" || failed=`expr $failed + 1`
# remove parent directory
echo rmdir bla/bloe | runcmd "Removing directory" || failed=`expr $failed + 1`
# remove child directory
echo rmdir bla | runcmd "Removing directory" || failed=`expr $failed + 1`
# run fsinfo
echo fsinfo objectid | runcmd "Getting file system info" || failed=`expr $failed + 1`
rm -f tmpfile tmpfile-old
testok $0 $failed
|