3 # Blackbox test for 'dfree command' and smbclient "l"
4 # command disk free printout.
9 Usage: test_dfree_command.sh SERVER DOMAIN USERNAME PASSWORD PREFIX SMBCLIENT
23 incdir
=`dirname $0`/..
/..
/..
/testprogs
/blackbox
26 test_smbclient_dfree
() {
34 subunit_start_test
"$name"
35 output
=$
($VALGRIND $smbclient //$SERVER/$share -c "$cmd" $@
2>&1)
37 if [ x
$status = x0
]; then
38 received
=$
(echo "$output" |
awk '/blocks of size/ {print $1, $5, $6}')
39 if [ "$expected" = "$received" ]; then
40 subunit_pass_test
"$name"
42 echo "$output" | subunit_fail_test
"$name"
45 echo "$output" | subunit_fail_test
"$name"
51 test_smbclient_dfree
"Test dfree command share root SMB3" dfree
"l" "2000 1024. 20" -U$USERNAME%$PASSWORD --option=clientmaxprotocol
=SMB3 || failed
=`expr $failed + 1`
52 test_smbclient_dfree
"Test dfree command share root NT1" dfree
"l" "2000 1024. 20" -U$USERNAME%$PASSWORD --option=clientmaxprotocol
=NT1 || failed
=`expr $failed + 1`
53 test_smbclient_dfree
"Test dfree command subdir1 SMB3" dfree
"cd subdir1; l" "8000 1024. 80" -U$USERNAME%$PASSWORD --option=clientmaxprotocol
=SMB3 || failed
=`expr $failed + 1`
54 test_smbclient_dfree
"Test dfree command subdir2 SMB3" dfree
"cd subdir2; l" "32000 1024. 320" -U$USERNAME%$PASSWORD --option=clientmaxprotocol
=SMB3 || failed
=`expr $failed + 1`
55 #SMB1 queries disk usage stat on the share's root, regardless of working directory
56 test_smbclient_dfree
"Test dfree command subdir1 NT1" dfree
"cd subdir1; l" "2000 1024. 20" -U$USERNAME%$PASSWORD --option=clientmaxprotocol
=NT1 || failed
=`expr $failed + 1`