diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-02-23 09:16:55 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2012-03-03 17:03:06 +0100 |
commit | 79576df9f0492454a5d09ae59f4fb7ba7421c1ac (patch) | |
tree | ccdfddb199a807ce27aed7d74f91ded9b3b6fd0e /source4 | |
parent | 579bb0a9342a3da4b1be3fb7b25233327f1e4f75 (diff) | |
download | samba-79576df9f0492454a5d09ae59f4fb7ba7421c1ac.tar.gz samba-79576df9f0492454a5d09ae59f4fb7ba7421c1ac.tar.bz2 samba-79576df9f0492454a5d09ae59f4fb7ba7421c1ac.zip |
s4:test:smb2:durable_open: skip lease tests when the server does not support leases
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/smb2/durable_open.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/source4/torture/smb2/durable_open.c b/source4/torture/smb2/durable_open.c index a75027c007..bd11d707e0 100644 --- a/source4/torture/smb2/durable_open.c +++ b/source4/torture/smb2/durable_open.c @@ -22,6 +22,7 @@ #include "includes.h" #include "libcli/smb2/smb2.h" #include "libcli/smb2/smb2_calls.h" +#include "../libcli/smb/smbXcli_base.h" #include "torture/torture.h" #include "torture/smb2/proto.h" #include "../libcli/smb/smbXcli_base.h" @@ -293,6 +294,12 @@ bool test_durable_open_open2(struct torture_context *tctx, char fname[256]; 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"); + } /* Choose a random name in case the state is left a little funky. */ snprintf(fname, 256, "durable_open_open2_%s.dat", generate_random_str(tctx, 8)); @@ -881,6 +888,12 @@ bool test_durable_open_lease(struct torture_context *tctx, char fname[256]; bool ret = true; uint64_t lease1, lease2; + uint32_t caps; + + caps = smb2cli_conn_server_capabilities(tree1->session->transport->conn); + if (!(caps & SMB2_CAP_LEASING)) { + torture_skip(tctx, "leases are not supported"); + } /* * Choose a random name and random lease in case the state is left a @@ -980,6 +993,12 @@ bool test_durable_open_lock(struct torture_context *tctx, char fname[256]; bool ret = true; uint64_t lease; + uint32_t caps; + + caps = smb2cli_conn_server_capabilities(tree->session->transport->conn); + if (!(caps & SMB2_CAP_LEASING)) { + torture_skip(tctx, "leases are not supported"); + } /* * Choose a random name and random lease in case the state is left a @@ -1074,6 +1093,12 @@ bool test_durable_open_open_lease(struct torture_context *tctx, char fname[256]; bool ret = true; uint64_t lease; + uint32_t caps; + + caps = smb2cli_conn_server_capabilities(tree1->session->transport->conn); + if (!(caps & SMB2_CAP_LEASING)) { + torture_skip(tctx, "leases are not supported"); + } /* * Choose a random name and random lease in case the state is left a |