From bbdfbf8d9d486aee51117976b8f825759a4c4a37 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 3 Dec 2007 00:28:22 +0100 Subject: r26238: Add a loadparm context parameter to torture_context, remove more uses of global_loadparm. (This used to be commit a33a5530545086b81a3b205aa109dff11c546926) --- source4/torture/raw/notify.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'source4/torture/raw/notify.c') diff --git a/source4/torture/raw/notify.c b/source4/torture/raw/notify.c index 96c7e4f947..8687e8e952 100644 --- a/source4/torture/raw/notify.c +++ b/source4/torture/raw/notify.c @@ -544,7 +544,7 @@ done: /* testing of mask bits for change notify */ -static bool test_notify_mask(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) +static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *tctx) { bool ret = true; NTSTATUS status; @@ -585,7 +585,7 @@ static bool test_notify_mask(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) #define NOTIFY_MASK_TEST(setup, op, cleanup, Action, expected, nchanges) \ do { for (mask=i=0;i<32;i++) { \ struct smbcli_request *req; \ - status = smb_raw_open(cli->tree, mem_ctx, &io); \ + status = smb_raw_open(cli->tree, tctx, &io); \ CHECK_STATUS(status, NT_STATUS_OK); \ fnum = io.ntcreatex.out.file.fnum; \ setup \ @@ -594,7 +594,7 @@ static bool test_notify_mask(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) req = smb_raw_changenotify_send(cli->tree, ¬ify); \ op \ msleep(200); smb_raw_ntcancel(req); \ - status = smb_raw_changenotify_recv(req, mem_ctx, ¬ify); \ + status = smb_raw_changenotify_recv(req, tctx, ¬ify); \ cleanup \ smbcli_close(cli->tree, fnum); \ if (NT_STATUS_EQUAL(status, NT_STATUS_CANCELLED)) continue; \ @@ -705,20 +705,20 @@ static bool test_notify_mask(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("testing set file attribute\n"); NOTIFY_MASK_TEST( - fnum2 = create_complex_file(cli, mem_ctx, BASEDIR "\\tname1");, + fnum2 = create_complex_file(cli, tctx, BASEDIR "\\tname1");, smbcli_fsetatr(cli->tree, fnum2, FILE_ATTRIBUTE_HIDDEN, 0, 0, 0, 0);, (smbcli_close(cli->tree, fnum2), smbcli_unlink(cli->tree, BASEDIR "\\tname1"));, NOTIFY_ACTION_MODIFIED, FILE_NOTIFY_CHANGE_ATTRIBUTES, 1); - if (lp_parm_bool(global_loadparm, NULL, "torture", "samba3", false)) { + if (torture_setting_bool(tctx, "samba3", false)) { printf("Samba3 does not yet support create times " "everywhere\n"); } else { printf("testing set file create time\n"); NOTIFY_MASK_TEST( - fnum2 = create_complex_file(cli, mem_ctx, + fnum2 = create_complex_file(cli, tctx, BASEDIR "\\tname1");, smbcli_fsetatr(cli->tree, fnum2, 0, t, 0, 0, 0);, (smbcli_close(cli->tree, fnum2), @@ -729,7 +729,7 @@ static bool test_notify_mask(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("testing set file access time\n"); NOTIFY_MASK_TEST( - fnum2 = create_complex_file(cli, mem_ctx, BASEDIR "\\tname1");, + fnum2 = create_complex_file(cli, tctx, BASEDIR "\\tname1");, smbcli_fsetatr(cli->tree, fnum2, 0, 0, t, 0, 0);, (smbcli_close(cli->tree, fnum2), smbcli_unlink(cli->tree, BASEDIR "\\tname1"));, NOTIFY_ACTION_MODIFIED, @@ -737,7 +737,7 @@ static bool test_notify_mask(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("testing set file write time\n"); NOTIFY_MASK_TEST( - fnum2 = create_complex_file(cli, mem_ctx, BASEDIR "\\tname1");, + fnum2 = create_complex_file(cli, tctx, BASEDIR "\\tname1");, smbcli_fsetatr(cli->tree, fnum2, 0, 0, 0, t, 0);, (smbcli_close(cli->tree, fnum2), smbcli_unlink(cli->tree, BASEDIR "\\tname1"));, NOTIFY_ACTION_MODIFIED, @@ -745,7 +745,7 @@ static bool test_notify_mask(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("testing set file change time\n"); NOTIFY_MASK_TEST( - fnum2 = create_complex_file(cli, mem_ctx, BASEDIR "\\tname1");, + fnum2 = create_complex_file(cli, tctx, BASEDIR "\\tname1");, smbcli_fsetatr(cli->tree, fnum2, 0, 0, 0, 0, t);, (smbcli_close(cli->tree, fnum2), smbcli_unlink(cli->tree, BASEDIR "\\tname1"));, NOTIFY_ACTION_MODIFIED, @@ -754,7 +754,7 @@ static bool test_notify_mask(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("testing write\n"); NOTIFY_MASK_TEST( - fnum2 = create_complex_file(cli, mem_ctx, BASEDIR "\\tname1");, + fnum2 = create_complex_file(cli, tctx, BASEDIR "\\tname1");, smbcli_write(cli->tree, fnum2, 1, &c, 10000, 1);, (smbcli_close(cli->tree, fnum2), smbcli_unlink(cli->tree, BASEDIR "\\tname1"));, NOTIFY_ACTION_MODIFIED, @@ -762,7 +762,7 @@ static bool test_notify_mask(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("testing truncate\n"); NOTIFY_MASK_TEST( - fnum2 = create_complex_file(cli, mem_ctx, BASEDIR "\\tname1");, + fnum2 = create_complex_file(cli, tctx, BASEDIR "\\tname1");, smbcli_ftruncate(cli->tree, fnum2, 10000);, (smbcli_close(cli->tree, fnum2), smbcli_unlink(cli->tree, BASEDIR "\\tname1"));, NOTIFY_ACTION_MODIFIED, -- cgit