From: Justin Stephenson Date: Fri, 21 Sep 2018 13:45:33 +0000 (-0400) Subject: s4:torture: Use test client user and machine name defaults X-Git-Tag: ldb-1.6.1~307 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e97d3cda81628de8d23237d2f7d4ead55c729f6;p=thirdparty%2Fsamba.git s4:torture: Use test client user and machine name defaults Use "testclient_machine" and "testclient_user" in open printer calls. Signed-off-by: Justin Stephenson Reviewed-by: Andreas Schneider Reviewed-by: Bjoern Jacke --- diff --git a/source4/torture/rpc/iremotewinspool.c b/source4/torture/rpc/iremotewinspool.c index 662e132593a..3e8010d2c2b 100644 --- a/source4/torture/rpc/iremotewinspool.c +++ b/source4/torture/rpc/iremotewinspool.c @@ -52,7 +52,7 @@ static bool torture_rpc_iremotewinspool_setup_common(struct torture_context *tct printer_name = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(t->iremotewinspool_pipe)); - client_info = test_get_client_info(tctx, WIN_7, 6, 1); + client_info = test_get_client_info(tctx, WIN_7, 6, 1, "testclient_machine", "testclient_user"); torture_assert(tctx, test_AsyncOpenPrinter_byprinter(tctx, t, @@ -112,7 +112,7 @@ static bool test_AsyncClosePrinter(struct torture_context *tctx, printer_name = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p)); - client_info = test_get_client_info(tctx, WIN_7, 6, 1); + client_info = test_get_client_info(tctx, WIN_7, 6, 1, "testclient_machine", "testclient_user"); torture_assert(tctx, test_AsyncOpenPrinter_byprinter(tctx, ctx, p, printer_name, client_info, &handle), @@ -138,7 +138,7 @@ static bool test_AsyncOpenPrinter(struct torture_context *tctx, printer_name = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p)); - client_info = test_get_client_info(tctx, WIN_7, 6, 1); + client_info = test_get_client_info(tctx, WIN_7, 6, 1, "testclient_machine", "testclient_user"); torture_assert(tctx, test_AsyncOpenPrinter_byprinter(tctx, ctx, p, printer_name, client_info, &handle), @@ -178,7 +178,8 @@ static bool test_AsyncOpenPrinterValidateBuildNumber(struct torture_context *tct torture_assert_not_null(tctx, printer_name, "Cannot allocate memory"); /* fail with Windows 2000 build number */ - client_info = test_get_client_info(tctx, WIN_2000, 3, SPOOLSS_MINOR_VERSION_0); + client_info = test_get_client_info(tctx, WIN_2000, 3, SPOOLSS_MINOR_VERSION_0, + "testclient_machine", "testclient_user"); ZERO_STRUCT(devmode_ctr); @@ -197,7 +198,8 @@ static bool test_AsyncOpenPrinterValidateBuildNumber(struct torture_context *tct "AsyncOpenPrinter should have failed"); /* succeed with Windows 7 build number */ - client_info = test_get_client_info(tctx, WIN_7, 6, 1); + client_info = test_get_client_info(tctx, WIN_7, 6, 1, + "testclient_machine", "testclient_user"); client_info_ctr.user_info.level1 = &client_info; r.in.pClientInfo = &client_info_ctr; @@ -800,7 +802,7 @@ static bool test_OpenPrinter(struct torture_context *tctx, printer_name = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p)); - client_info = test_get_client_info(tctx, WIN_7, 6, 1); + client_info = test_get_client_info(tctx, WIN_7, 6, 1, "testclient_machine", "testclient_user"); torture_assert(tctx, test_AsyncOpenPrinter_byprinter(tctx, ctx, p, printer_name, client_info, &handle), diff --git a/source4/torture/rpc/iremotewinspool_common.c b/source4/torture/rpc/iremotewinspool_common.c index c1dc444f8ae..9fe5d061551 100644 --- a/source4/torture/rpc/iremotewinspool_common.c +++ b/source4/torture/rpc/iremotewinspool_common.c @@ -10,13 +10,15 @@ struct spoolss_UserLevel1 test_get_client_info(struct torture_context *tctx, enum client_os_version os, enum spoolss_MajorVersion major_number, - enum spoolss_MinorVersion minor_number) + enum spoolss_MinorVersion minor_number, + const char *machine, + const char *user) { struct spoolss_UserLevel1 level1; level1.size = 28; - level1.client = talloc_asprintf(tctx, "\\\\%s", "mthelena"); - level1.user = "GD"; + level1.client = talloc_asprintf(tctx, "\\\\%s", machine); + level1.user = user; level1.processor = PROCESSOR_ARCHITECTURE_AMD64; level1.major = major_number; level1.minor = minor_number; diff --git a/source4/torture/rpc/iremotewinspool_common.h b/source4/torture/rpc/iremotewinspool_common.h index 868d142cdee..39bd9672b68 100644 --- a/source4/torture/rpc/iremotewinspool_common.h +++ b/source4/torture/rpc/iremotewinspool_common.h @@ -44,7 +44,9 @@ enum client_os_version struct spoolss_UserLevel1 test_get_client_info(struct torture_context *tctx, enum client_os_version os, enum spoolss_MajorVersion major_number, - enum spoolss_MinorVersion minor_number); + enum spoolss_MinorVersion minor_number, + const char *machine, + const char *user); bool test_AsyncOpenPrinter_byprinter(struct torture_context *tctx, struct test_iremotewinspool_context *ctx, diff --git a/source4/torture/rpc/iremotewinspool_driver.c b/source4/torture/rpc/iremotewinspool_driver.c index a2876b5a8a5..f7562e418c4 100644 --- a/source4/torture/rpc/iremotewinspool_driver.c +++ b/source4/torture/rpc/iremotewinspool_driver.c @@ -63,7 +63,8 @@ static bool test_init_iremotewinspool_openprinter(struct torture_context *tctx, printer_name = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(t->iremotewinspool_pipe)); torture_assert_not_null_goto(tctx, printer_name, ok, done, "Cannot allocate memory"); - client_info = test_get_client_info(tctx, WIN_7, 3, SPOOLSS_MINOR_VERSION_0); + client_info = test_get_client_info(tctx, WIN_7, 3, SPOOLSS_MINOR_VERSION_0, + "testclient_machine", "testclient_user"); ok = test_AsyncOpenPrinter_byprinter(tctx, t, t->iremotewinspool_pipe, printer_name, client_info, &t->server_handle);