From b4b25128b878cc4c41973de9c5ef5e9d0109a6a4 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Wed, 27 Nov 2019 19:25:49 +0000 Subject: [PATCH] s3/selftest: allow samba3.blackbox.dfree_command run NT1 & SMB3 tests samba3.blackbox.dfree_command was a single test that run both NT1 & SMB3 tests together. This allow the protocol to be passed into the test script so the test can be divided into SMB1 & >=SM2 tests. Signed-off-by: Noel Power Reviewed-by: Ralph Boehme --- source3/script/tests/test_dfree_command.sh | 20 ++++++++++++++------ source3/selftest/tests.py | 3 ++- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/source3/script/tests/test_dfree_command.sh b/source3/script/tests/test_dfree_command.sh index a60a52de5c4..715496d47d7 100755 --- a/source3/script/tests/test_dfree_command.sh +++ b/source3/script/tests/test_dfree_command.sh @@ -17,7 +17,9 @@ USERNAME=$3 PASSWORD=$4 PREFIX=$5 smbclient=$6 -shift 6 +protocol=$7 + +shift 7 failed=0 incdir=`dirname $0`/../../../testprogs/blackbox @@ -47,12 +49,18 @@ test_smbclient_dfree() { return $status } +if [ $protocol = "SMB3" ]; then + test_smbclient_dfree "Test dfree command share root SMB3" dfree "l" "2000 1024. 20" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1` + 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` + 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` -test_smbclient_dfree "Test dfree command share root SMB3" dfree "l" "2000 1024. 20" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1` -test_smbclient_dfree "Test dfree command share root NT1" dfree "l" "2000 1024. 20" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=NT1 || failed=`expr $failed + 1` -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` -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` +elif [ $protocol = "NT1" ]; then + test_smbclient_dfree "Test dfree command share root NT1" dfree "l" "2000 1024. 20" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=NT1 || failed=`expr $failed + 1` #SMB1 queries disk usage stat on the share's root, regardless of working directory -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` + 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` +else + echo "unsupported protocol $protocol" | subunit_fail_test "Test dfree command" + $failed=`expr $failed + 1` +fi exit $failed diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py index 49d88d54be4..eaf618cd4c6 100755 --- a/source3/selftest/tests.py +++ b/source3/selftest/tests.py @@ -329,7 +329,8 @@ for env in ["nt4_dc"]: for env in ["fileserver"]: plantestsuite("samba3.blackbox.preserve_case (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_preserve_case.sh"), '$SERVER', '$DOMAIN', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3]) - plantestsuite("samba3.blackbox.dfree_command (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_dfree_command.sh"), '$SERVER', '$DOMAIN', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3]) + plantestsuite("samba3.blackbox.dfree_command NT1 (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_dfree_command.sh"), '$SERVER', '$DOMAIN', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3, "NT1"]) + plantestsuite("samba3.blackbox.dfree_command SMB3 (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_dfree_command.sh"), '$SERVER', '$DOMAIN', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3, "SMB3"]) plantestsuite("samba3.blackbox.dfree_quota (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_dfree_quota.sh"), '$SERVER', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH', smbclient3, smbcquotas, smbcacls]) plantestsuite("samba3.blackbox.smbcquotas (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbcquota.sh"), '$SERVER', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH', smbcquotas]) plantestsuite("samba3.blackbox.valid_users (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_valid_users.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3]) -- 2.47.3