From 336f6810cec9b30ad497da26ee463ed5736db2bd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 14 Aug 2008 17:26:30 +1000 Subject: expanded the SMB2-CREATE and RAW-OPEN tests to explore more of how the create options fields are supposed to work (This used to be commit 0576875eccaa21ad529c9db41db91781ad400d0f) --- source4/torture/raw/open.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'source4/torture/raw') diff --git a/source4/torture/raw/open.c b/source4/torture/raw/open.c index b6979fa0d9..39ff443ccd 100644 --- a/source4/torture/raw/open.c +++ b/source4/torture/raw/open.c @@ -844,6 +844,7 @@ static bool test_nttrans_create(struct smbcli_state *cli, struct torture_context int fnum = -1; bool ret = true; int i; + uint32_t ok_mask, not_supported_mask, invalid_parameter_mask; struct { uint32_t open_disp; bool with_file; @@ -982,6 +983,10 @@ static bool test_nttrans_create(struct smbcli_state *cli, struct torture_context } io.ntcreatex.in.create_options = create_option; status = smb_raw_open(cli->tree, tctx, &io); + if (!NT_STATUS_IS_OK(status)) { + printf("ntcreatex create option 0x%08x gave %s - should give NT_STATUS_OK\n", + create_option, nt_errstr(status)); + } CHECK_STATUS(status, NT_STATUS_OK); fnum = io.ntcreatex.out.file.fnum; @@ -999,6 +1004,36 @@ static bool test_nttrans_create(struct smbcli_state *cli, struct torture_context smbcli_close(cli->tree, fnum); } + ok_mask = not_supported_mask = invalid_parameter_mask = 0; + + io.ntcreatex.in.file_attr = 0; + io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN_IF; + io.ntcreatex.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; + + /* Check for options that should return NOT_SUPPORTED, OK or INVALID_PARAMETER */ + for (i=0; i < 32; i++) { + uint32_t create_option = 1<tree, tctx, &io); + if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) { + not_supported_mask |= create_option; + } else if (NT_STATUS_EQUAL(status, NT_STATUS_OK)) { + ok_mask |= create_option; + smbcli_close(cli->tree, io.ntcreatex.out.file.fnum); + } else if (NT_STATUS_EQUAL(status, NT_STATUS_INVALID_PARAMETER)) { + invalid_parameter_mask |= create_option; + } else { + printf("create option 0x%08x returned %s\n", create_option, nt_errstr(status)); + } + } + + CHECK_VAL(ok_mask, 0x00efcfce); + CHECK_VAL(not_supported_mask, 0x00002000); + CHECK_VAL(invalid_parameter_mask, 0xff100030); + smbcli_unlink(cli->tree, fname); -- cgit From c1c6c1b609ab57186dab7b13c56bfe4475a733f7 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 14 Aug 2008 15:14:53 +0200 Subject: RAW-OPEN: be more strict in create_option checking metze (This used to be commit d548f5dee5980eae0aea25f1314238eb4f963568) --- source4/torture/raw/open.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'source4/torture/raw') diff --git a/source4/torture/raw/open.c b/source4/torture/raw/open.c index 39ff443ccd..f3494ea3d0 100644 --- a/source4/torture/raw/open.c +++ b/source4/torture/raw/open.c @@ -845,6 +845,7 @@ static bool test_nttrans_create(struct smbcli_state *cli, struct torture_context bool ret = true; int i; uint32_t ok_mask, not_supported_mask, invalid_parameter_mask; + uint32_t not_a_directory_mask, unexpected_mask; struct { uint32_t open_disp; bool with_file; @@ -1004,13 +1005,16 @@ static bool test_nttrans_create(struct smbcli_state *cli, struct torture_context smbcli_close(cli->tree, fnum); } - ok_mask = not_supported_mask = invalid_parameter_mask = 0; - io.ntcreatex.in.file_attr = 0; io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN_IF; io.ntcreatex.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; /* Check for options that should return NOT_SUPPORTED, OK or INVALID_PARAMETER */ + ok_mask = 0; + not_supported_mask = 0; + invalid_parameter_mask = 0; + not_a_directory_mask = 0; + unexpected_mask = 0; for (i=0; i < 32; i++) { uint32_t create_option = 1<tree, io.ntcreatex.out.file.fnum); } else if (NT_STATUS_EQUAL(status, NT_STATUS_INVALID_PARAMETER)) { invalid_parameter_mask |= create_option; + } else if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_A_DIRECTORY)) { + not_a_directory_mask |= 1<tree, fname); -- cgit From 3efd7d22626d179b2bf28d7fb3473ed982ed7dcb Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 23 Aug 2008 11:54:02 +1000 Subject: don't use zero data for the first file in RAW-OFFLINE the most likely bugs in HSM involve zero data, due to the dm_punch_hole() request (This used to be commit 330ab956ea7e0b344450eee60b1357d854fbef28) --- source4/torture/raw/offline.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/torture/raw') diff --git a/source4/torture/raw/offline.c b/source4/torture/raw/offline.c index 9c66c3be9c..9240c76b6b 100644 --- a/source4/torture/raw/offline.c +++ b/source4/torture/raw/offline.c @@ -108,7 +108,7 @@ static void loadfile_callback(struct composite_context *ctx) } for (i=0;iloadfile->out.data[i] != state->fnumber % 256) { + if (state->loadfile->out.data[i] != 1+(state->fnumber % 255)) { printf("Bad data in file %u\n", state->fnumber); test_failed++; return; @@ -436,7 +436,7 @@ bool torture_test_offline(struct torture_context *torture) char buf[FILE_SIZE]; NTSTATUS status; - memset(buf, i % 256, sizeof(buf)); + memset(buf, 1+(i % 255), sizeof(buf)); fnum = smbcli_open(state[0].tree, fname, O_RDWR|O_CREAT, DENY_NONE); if (fnum == -1) { -- cgit From b030743d7408a427cf8e36faa1a2a3b8386112e8 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 24 Aug 2008 17:38:43 +1000 Subject: show the bad data in RAW-OFFLINE also show the worst case latencies so far, matching tsm_torture (This used to be commit 5859bb337ce2ec5091425ebd02cad14c4da40457) --- source4/torture/raw/offline.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'source4/torture/raw') diff --git a/source4/torture/raw/offline.c b/source4/torture/raw/offline.c index 9240c76b6b..0f7787a92f 100644 --- a/source4/torture/raw/offline.c +++ b/source4/torture/raw/offline.c @@ -109,7 +109,10 @@ static void loadfile_callback(struct composite_context *ctx) for (i=0;iloadfile->out.data[i] != 1+(state->fnumber % 255)) { - printf("Bad data in file %u\n", state->fnumber); + printf("Bad data in file %u (got %u expected %u)\n", + state->fnumber, + state->loadfile->out.data[i], + 1+(state->fnumber % 255)); test_failed++; return; } @@ -344,12 +347,16 @@ static void report_rate(struct event_context *ev, struct timed_event *te, total_online += state[i].online_count; total_offline += state[i].offline_count; } - printf("ops/s=%4u offline=%5u online=%4u set_lat=%.1f get_lat=%.1f save_lat=%.1f load_lat=%.1f\r", + printf("ops/s=%4u offline=%5u online=%4u set_lat=%.1f/%.1f get_lat=%.1f/%.1f save_lat=%.1f/%.1f load_lat=%.1f/%.1f\n", total, total_offline, total_online, latencies[OP_SETOFFLINE], + worst_latencies[OP_SETOFFLINE], latencies[OP_GETOFFLINE], + worst_latencies[OP_GETOFFLINE], latencies[OP_SAVEFILE], - latencies[OP_LOADFILE]); + worst_latencies[OP_SAVEFILE], + latencies[OP_LOADFILE], + worst_latencies[OP_LOADFILE]); fflush(stdout); event_add_timed(ev, state, timeval_current_ofs(1, 0), report_rate, state); -- cgit From a22b9d648553e5e7e0ee19606d9bceeb3b356241 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 24 Aug 2008 17:42:29 +1000 Subject: fixed the data in SAVEFILE op in RAW-OFFLINE (This used to be commit 3441ea5df5b750442d17b90de73d392d2d802ab1) --- source4/torture/raw/offline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/raw') diff --git a/source4/torture/raw/offline.c b/source4/torture/raw/offline.c index 0f7787a92f..f2f0bf5d27 100644 --- a/source4/torture/raw/offline.c +++ b/source4/torture/raw/offline.c @@ -256,7 +256,7 @@ static void test_offline(struct offline_state *state) state->savefile->in.fname = state->fname; state->savefile->in.data = talloc_size(state->savefile, FILE_SIZE); state->savefile->in.size = FILE_SIZE; - memset(state->savefile->in.data, state->fnumber, FILE_SIZE); + memset(state->savefile->in.data, 1+(state->fnumber%255), FILE_SIZE); ctx = smb_composite_savefile_send(state->tree, state->savefile); if (ctx == NULL) { -- cgit