summaryrefslogtreecommitdiff
path: root/source4/torture/smb2
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-04-17 13:41:54 +0200
committerRichard Sharpe <sharpe@samba.org>2013-04-27 18:09:36 +0200
commitb7765fe63fa04e09ac67285d0e17e37b06bcff8b (patch)
tree600b4bffbea594a349d00c9e228db9ae68b5dfea /source4/torture/smb2
parent27e9115eb01f02d5d07d2cf35887f99ff8d823b8 (diff)
downloadsamba-b7765fe63fa04e09ac67285d0e17e37b06bcff8b.tar.gz
samba-b7765fe63fa04e09ac67285d0e17e37b06bcff8b.tar.bz2
samba-b7765fe63fa04e09ac67285d0e17e37b06bcff8b.zip
torture: Only test leases if supported
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com> Autobuild-User(master): Richard Sharpe <sharpe@samba.org> Autobuild-Date(master): Sat Apr 27 18:09:37 CEST 2013 on sn-devel-104
Diffstat (limited to 'source4/torture/smb2')
-rw-r--r--source4/torture/smb2/lease.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/source4/torture/smb2/lease.c b/source4/torture/smb2/lease.c
index 21d4679942..992c21b240 100644
--- a/source4/torture/smb2/lease.c
+++ b/source4/torture/smb2/lease.c
@@ -25,6 +25,7 @@
#include "libcli/smb2/smb2_calls.h"
#include "torture/torture.h"
#include "torture/smb2/proto.h"
+#include "libcli/smb/smbXcli_base.h"
#define CHECK_VAL(v, correct) do { \
if ((v) != (correct)) { \
@@ -117,6 +118,12 @@ static bool test_lease_request(struct torture_context *tctx,
const char *dname = "lease.dir";
bool ret = true;
int i;
+ uint32_t caps;
+
+ caps = smb2cli_conn_server_capabilities(tree->session->transport->conn);
+ if (!(caps & SMB2_CAP_LEASING)) {
+ torture_skip(tctx, "leases are not supported");
+ }
smb2_util_unlink(tree, fname);
smb2_util_unlink(tree, fname2);
@@ -193,6 +200,12 @@ static bool test_lease_upgrade(struct torture_context *tctx,
NTSTATUS status;
const char *fname = "lease.dat";
bool ret = true;
+ uint32_t caps;
+
+ caps = smb2cli_conn_server_capabilities(tree->session->transport->conn);
+ if (!(caps & SMB2_CAP_LEASING)) {
+ torture_skip(tctx, "leases are not supported");
+ }
smb2_util_unlink(tree, fname);
@@ -301,6 +314,12 @@ static bool test_lease_upgrade2(struct torture_context *tctx,
const char *fname = "lease.dat";
bool ret = true;
int i;
+ uint32_t caps;
+
+ caps = smb2cli_conn_server_capabilities(tree->session->transport->conn);
+ if (!(caps & SMB2_CAP_LEASING)) {
+ torture_skip(tctx, "leases are not supported");
+ }
for (i = 0; i < NUM_UPGRADE_TESTS; i++) {
struct lease_upgrade2_test t = lease_upgrade2_tests[i];
@@ -515,6 +534,12 @@ static bool test_lease_break(struct torture_context *tctx,
const char *fname = "lease.dat";
bool ret = true;
int i;
+ uint32_t caps;
+
+ caps = smb2cli_conn_server_capabilities(tree->session->transport->conn);
+ if (!(caps & SMB2_CAP_LEASING)) {
+ torture_skip(tctx, "leases are not supported");
+ }
tree->session->transport->lease.handler = torture_lease_handler;
tree->session->transport->lease.private_data = tree;
@@ -677,6 +702,12 @@ static bool test_lease_oplock(struct torture_context *tctx,
const char *fname = "lease.dat";
bool ret = true;
int i;
+ uint32_t caps;
+
+ caps = smb2cli_conn_server_capabilities(tree->session->transport->conn);
+ if (!(caps & SMB2_CAP_LEASING)) {
+ torture_skip(tctx, "leases are not supported");
+ }
tree->session->transport->lease.handler = torture_lease_handler;
tree->session->transport->lease.private_data = tree;
@@ -796,6 +827,12 @@ static bool test_lease_multibreak(struct torture_context *tctx,
NTSTATUS status;
const char *fname = "lease.dat";
bool ret = true;
+ uint32_t caps;
+
+ caps = smb2cli_conn_server_capabilities(tree->session->transport->conn);
+ if (!(caps & SMB2_CAP_LEASING)) {
+ torture_skip(tctx, "leases are not supported");
+ }
tree->session->transport->lease.handler = torture_lease_handler;
tree->session->transport->lease.private_data = tree;