summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-08-14 01:21:05 +0000
committerAndrew Tridgell <tridge@samba.org>2003-08-14 01:21:05 +0000
commit9af22cd8837f25758e3993d5836c2a26f05e5676 (patch)
tree5d1e5771713b75d02d01f100e6b2748aa3969e5e /source4
parentae6453269da39fa1e6d131b05307199a8ec1b344 (diff)
downloadsamba-9af22cd8837f25758e3993d5836c2a26f05e5676.tar.gz
samba-9af22cd8837f25758e3993d5836c2a26f05e5676.tar.bz2
samba-9af22cd8837f25758e3993d5836c2a26f05e5676.zip
added SMBopen to gentest
(This used to be commit b47737b00bd6a96d8dec53381872656997ec6ad2)
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/gentest.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c
index ec090d59dd..4711ea91ae 100644
--- a/source4/torture/gentest.c
+++ b/source4/torture/gentest.c
@@ -1087,6 +1087,40 @@ static BOOL handler_openx(int instance)
/*
+ generate open operations
+*/
+static BOOL handler_open(int instance)
+{
+ union smb_open parm[NSERVERS];
+ NTSTATUS status[NSERVERS];
+
+ parm[0].open.level = RAW_OPEN_OPEN;
+ parm[0].open.in.flags = gen_bits_mask2(0xF, 0xFFFF);
+ parm[0].open.in.search_attrs = gen_attrib();
+ parm[0].open.in.fname = gen_fname_open(instance);
+
+ if (!options.use_oplocks) {
+ /* mask out oplocks */
+ parm[0].open.in.flags &= ~(OPENX_FLAGS_REQUEST_OPLOCK|
+ OPENX_FLAGS_REQUEST_BATCH_OPLOCK);
+ }
+
+ GEN_COPY_PARM;
+ GEN_CALL(smb_raw_open(tree, current_op.mem_ctx, &parm[i]));
+
+ CHECK_EQUAL(open.out.attrib);
+ CHECK_TIMES_EQUAL(open.out.write_time);
+ CHECK_EQUAL(open.out.size);
+ CHECK_EQUAL(open.out.rmode);
+
+ /* open creates a new file handle */
+ ADD_HANDLE(parm[0].open.in.fname, open.out.fnum);
+
+ return True;
+}
+
+
+/*
generate ntcreatex operations
*/
static BOOL handler_ntcreatex(int instance)
@@ -1820,6 +1854,7 @@ static struct {
BOOL (*handler)(int instance);
int count, success_count;
} gen_ops[] = {
+ {"OPEN", handler_open},
{"OPENX", handler_openx},
{"NTCREATEX", handler_ntcreatex},
{"CLOSE", handler_close},