summaryrefslogtreecommitdiff
path: root/source3/script/tests
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2017-11-14 15:54:19 -0800
committerAndreas Schneider <asn@cryptomilk.org>2017-11-15 19:50:54 +0100
commitf8cd211acc3824e01d89a6f8b6666c39aa5cd54e (patch)
treeee2573241a4ec307aafe239c5307933ab2f6632d /source3/script/tests
parentaaa52ab7b5ae711b80e3967ab1ecc91888c346f6 (diff)
downloadsamba-f8cd211acc3824e01d89a6f8b6666c39aa5cd54e.tar.gz
s3: smbclient: tests: Test "volume" command over SMB1 and SMB2+.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13140 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed Nov 15 19:50:54 CET 2017 on sn-devel-144
Diffstat (limited to 'source3/script/tests')
-rwxr-xr-xsource3/script/tests/test_smbclient_s3.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh
index 45005776cf8..d98da0dd260 100755
--- a/source3/script/tests/test_smbclient_s3.sh
+++ b/source3/script/tests/test_smbclient_s3.sh
@@ -1525,7 +1525,34 @@ EOF
fi
}
+# Test doing a volume command.
+test_volume()
+{
+ tmpfile=$PREFIX/smbclient_interactive_prompt_commands
+ cat > $tmpfile <<EOF
+volume
+quit
+EOF
+ cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp -I $SERVER_IP $ADDARGS < $tmpfile 2>&1'
+ eval echo "$cmd"
+ out=`eval $cmd`
+ ret=$?
+ rm -f $tmpfile
+ if [ $ret != 0 ] ; then
+ echo "$out"
+ echo "failed doing volume command with error $ret"
+ return 1
+ fi
+
+ echo "$out" | grep '^Volume: |tmp| serial number'
+ ret=$?
+ if [ $ret != 0 ] ; then
+ echo "$out"
+ echo "failed doing volume command"
+ return 1
+ fi
+}
test_server_os_message()
{
@@ -1684,6 +1711,10 @@ testit "rename_dotdot" \
test_rename_dotdot || \
failed=`expr $failed + 1`
+testit "volume" \
+ test_volume || \
+ failed=`expr $failed + 1`
+
testit "rm -rf $LOGDIR" \
rm -rf $LOGDIR || \
failed=`expr $failed + 1`