diff options
-rw-r--r-- | source4/librpc/idl/dfs.idl | 3 | ||||
-rw-r--r-- | source4/samba4-knownfail | 3 | ||||
-rw-r--r-- | source4/samba4-skip | 3 | ||||
-rwxr-xr-x | source4/selftest/test_rpc.sh | 6 | ||||
-rw-r--r-- | source4/torture/config.mk | 1 | ||||
-rw-r--r-- | source4/torture/rpc/atsvc.c | 2 | ||||
-rw-r--r-- | source4/torture/rpc/dfs.c | 124 | ||||
-rw-r--r-- | source4/torture/rpc/echo.c | 2 | ||||
-rw-r--r-- | source4/torture/rpc/epmapper.c | 109 | ||||
-rw-r--r-- | source4/torture/rpc/eventlog.c | 2 | ||||
-rw-r--r-- | source4/torture/rpc/initshutdown.c | 132 | ||||
-rw-r--r-- | source4/torture/rpc/oxidresolve.c | 203 | ||||
-rw-r--r-- | source4/torture/rpc/remact.c | 78 | ||||
-rw-r--r-- | source4/torture/rpc/rot.c | 47 | ||||
-rw-r--r-- | source4/torture/rpc/rpc.c | 11 | ||||
-rw-r--r-- | source4/torture/rpc/srvsvc.c | 2 | ||||
-rw-r--r-- | source4/torture/rpc/svcctl.c | 2 | ||||
-rw-r--r-- | source4/torture/rpc/unixinfo.c | 2 | ||||
-rw-r--r-- | source4/torture/rpc/winreg.c | 2 | ||||
-rw-r--r-- | source4/torture/rpc/wkssvc.c | 2 |
20 files changed, 278 insertions, 458 deletions
diff --git a/source4/librpc/idl/dfs.idl b/source4/librpc/idl/dfs.idl index 2b519b15d5..30da410a46 100644 --- a/source4/librpc/idl/dfs.idl +++ b/source4/librpc/idl/dfs.idl @@ -5,7 +5,8 @@ [ uuid("4fc742e0-4a10-11cf-8273-00aa004ae673"), version(3.0), pointer_default(unique), - helpstring("Settings for Microsoft Distributed File System") + helpstring("Settings for Microsoft Distributed File System"), + endpoint("ncacn_np:[\\pipe\\dfs]", "ncacn_ip_tcp:", "ncalrpc:") ] interface netdfs { /******************/ diff --git a/source4/samba4-knownfail b/source4/samba4-knownfail index d4a5441043..02d024726e 100644 --- a/source4/samba4-knownfail +++ b/source4/samba4-knownfail @@ -10,3 +10,6 @@ RPC-WKSSVC.*NetWkstaGetInfo RPC-WKSSVC.*NetWkstaTransportEnum RPC-HANDLES.*/lsarpc-shared RPC-HANDLES.*/mixed-shared +RPC-EPMAPPER.*/Insert +RPC-EPMAPPER.*/InqObject +RPC-DFS.* diff --git a/source4/samba4-skip b/source4/samba4-skip index 2669b38b56..c0bc3e5731 100644 --- a/source4/samba4-skip +++ b/source4/samba4-skip @@ -42,9 +42,6 @@ ntvfs/cifs RAW-SAMBA3BADPATH ntvfs/cifs RAW-SCAN-EAMAX ntvfs/cifs RAW-CONTEXT ntvfs/cifs RAW-QFILEINFO-IPC -RPC-SVCCTL RPC-DSSYNC -RPC-EPMAPPER -RPC-INITSHUTDOWN RPC-SAMSYNC LDAP-UPTODATEVECTOR diff --git a/source4/selftest/test_rpc.sh b/source4/selftest/test_rpc.sh index 724196bbfa..adcab0af39 100755 --- a/source4/selftest/test_rpc.sh +++ b/source4/selftest/test_rpc.sh @@ -2,9 +2,9 @@ # add tests to this list as they start passing, so we test # that they stay passing -ncacn_np_tests="RPC-SPOOLSS RPC-SRVSVC RPC-UNIXINFO RPC-SCHANNEL RPC-JOIN RPC-LSA RPC-ECHO RPC-DSSETUP RPC-ALTERCONTEXT RPC-MULTIBIND RPC-NETLOGON RPC-MGMT RPC-HANDLES RPC-WINREG RPC-WKSSVC RPC-SVCCTL RPC-EPMAPPER RPC-INITSHUTDOWN RPC-EVENTLOG RPC-ATSVC RPC-SAMSYNC" -ncalrpc_tests="RPC-MGMT RPC-UNIXINFO RPC-SCHANNEL RPC-JOIN RPC-LSA RPC-ECHO RPC-DSSETUP RPC-ALTERCONTEXT RPC-MULTIBIND RPC-NETLOGON RPC-WINREG RPC-WKSSVC RPC-SVCCTL RPC-EPMAPPER RPC-EVENTLOG RPC-ATSVC RPC-INITSHUTDOWN" -ncacn_ip_tcp_tests="RPC-UNIXINFO RPC-SCHANNEL RPC-JOIN RPC-LSA RPC-ECHO RPC-DSSETUP RPC-ALTERCONTEXT RPC-MULTIBIND RPC-NETLOGON RPC-MGMT RPC-HANDLES RPC-WINREG RPC-WKSSVC RPC-SVCCTL RPC-EPMAPPER RPC-ATSVC RPC-EVENTLOG RPC-DSSYNC" +ncacn_np_tests="RPC-SPOOLSS RPC-SRVSVC RPC-UNIXINFO RPC-SCHANNEL RPC-JOIN RPC-LSA RPC-ECHO RPC-DSSETUP RPC-ALTERCONTEXT RPC-MULTIBIND RPC-NETLOGON RPC-MGMT RPC-HANDLES RPC-WINREG RPC-WKSSVC RPC-SVCCTL RPC-EPMAPPER RPC-INITSHUTDOWN RPC-EVENTLOG RPC-ATSVC RPC-SAMSYNC RPC-OXIDRESOLVE RPC-DFS" +ncalrpc_tests="RPC-MGMT RPC-UNIXINFO RPC-SCHANNEL RPC-JOIN RPC-LSA RPC-ECHO RPC-DSSETUP RPC-ALTERCONTEXT RPC-MULTIBIND RPC-NETLOGON RPC-WINREG RPC-WKSSVC RPC-SVCCTL RPC-EPMAPPER RPC-EVENTLOG RPC-ATSVC RPC-INITSHUTDOWN RPC-OXIDRESOLVE RPC-DFS" +ncacn_ip_tcp_tests="RPC-UNIXINFO RPC-SCHANNEL RPC-JOIN RPC-LSA RPC-ECHO RPC-DSSETUP RPC-ALTERCONTEXT RPC-MULTIBIND RPC-NETLOGON RPC-MGMT RPC-HANDLES RPC-WINREG RPC-WKSSVC RPC-SVCCTL RPC-EPMAPPER RPC-ATSVC RPC-EVENTLOG RPC-DSSYNC RPC-OXIDRESOLVE RPC-DFS" slow_ncacn_np_tests="RPC-SAMLOGON RPC-SAMR RPC-SAMR-USERS RPC-SAMR-PASSWORDS RPC-COUNTCALLS" slow_ncalrpc_tests="RPC-SAMR RPC-SAMR-PASSWORDS RPC-COUNTCALLS RPC-CRACKNAMES" slow_ncacn_ip_tcp_tests="RPC-SAMR RPC-SAMR-PASSWORDS RPC-COUNTCALLS RPC-CRACKNAMES" diff --git a/source4/torture/config.mk b/source4/torture/config.mk index fc7a3c0763..2afb94cf1b 100644 --- a/source4/torture/config.mk +++ b/source4/torture/config.mk @@ -148,7 +148,6 @@ OBJ_FILES = \ rpc/netlogon.o \ rpc/samlogon.o \ rpc/samsync.o \ - rpc/rot.o \ rpc/bind.o \ rpc/dssetup.o \ rpc/alter_context.o \ diff --git a/source4/torture/rpc/atsvc.c b/source4/torture/rpc/atsvc.c index da541fa1d1..f5295cc6cc 100644 --- a/source4/torture/rpc/atsvc.c +++ b/source4/torture/rpc/atsvc.c @@ -123,7 +123,7 @@ struct torture_suite *torture_rpc_atsvc(void) struct torture_suite *suite = torture_suite_create( talloc_autofree_context(), "ATSVC"); - struct torture_tcase *tcase; + struct torture_rpc_tcase *tcase; tcase = torture_suite_add_rpc_iface_tcase(suite, "atsvc", &ndr_table_atsvc); diff --git a/source4/torture/rpc/dfs.c b/source4/torture/rpc/dfs.c index 249af3ebb1..7dc600ae93 100644 --- a/source4/torture/rpc/dfs.c +++ b/source4/torture/rpc/dfs.c @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -15,7 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "includes.h" @@ -29,8 +30,6 @@ #include "libcli/libcli.h" #include "lib/cmdline/popt_common.h" -#if 0 - #define SMBTORTURE_DFS_SHARENAME "smbtorture_dfs_share" #define SMBTORTURE_DFS_DIRNAME "\\smbtorture_dfs_dir" #define SMBTORTURE_DFS_PATHNAME "C:"SMBTORTURE_DFS_DIRNAME @@ -140,20 +139,23 @@ static BOOL test_DeleteDir(struct smbcli_state *cli, const char *dir) return True; } -static BOOL test_GetManagerVersion(struct torture_context *tctx, struct dcerpc_pipe *p, enum dfs_ManagerVersion *version) +static BOOL test_GetManagerVersion(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, enum dfs_ManagerVersion *version) { NTSTATUS status; struct dfs_GetManagerVersion r; r.out.version = version; - status = dcerpc_dfs_GetManagerVersion(p, tctx, &r); - torture_assert_ntstatus_ok(tctx, status, "GetManagerVersion failed"); + status = dcerpc_dfs_GetManagerVersion(p, mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + printf("GetManagerVersion failed - %s\n", nt_errstr(status)); + return False; + } - return true; + return True; } -static BOOL test_ManagerInitialize(struct torture_context *tctx, struct dcerpc_pipe *p, const char *host) +static BOOL test_ManagerInitialize(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, const char *host) { NTSTATUS status; enum dfs_ManagerVersion version; @@ -161,14 +163,14 @@ static BOOL test_ManagerInitialize(struct torture_context *tctx, struct dcerpc_p printf("Testing ManagerInitialize\n"); - if (!test_GetManagerVersion(tctx, p, &version)) { + if (!test_GetManagerVersion(p, mem_ctx, &version)) { return False; } r.in.servername = host; r.in.flags = 0; - status = dcerpc_dfs_ManagerInitialize(p, tctx, &r); + status = dcerpc_dfs_ManagerInitialize(p, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { printf("ManagerInitialize failed - %s\n", nt_errstr(status)); return False; @@ -181,31 +183,33 @@ static BOOL test_ManagerInitialize(struct torture_context *tctx, struct dcerpc_p return True; } -static BOOL test_GetInfoLevel(struct torture_context *tctx, struct dcerpc_pipe *p, uint16_t level, const char *root) +static BOOL test_GetInfoLevel(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint16_t level, + const char *root) { NTSTATUS status; struct dfs_GetInfo r; - torture_comment(tctx, - talloc_asprintf(tctx, "Testing GetInfo level %u on '%s'\n", level, root)); + printf("Testing GetInfo level %u on '%s'\n", level, root); - r.in.dfs_entry_path = talloc_strdup(tctx, root); + r.in.dfs_entry_path = talloc_strdup(mem_ctx, root); r.in.servername = NULL; r.in.sharename = NULL; r.in.level = level; - status = dcerpc_dfs_GetInfo(p, tctx, &r); - torture_assert_ntstatus_ok(tctx, status, "Info failed"); - torture_assert(tctx, W_ERROR_IS_OK(r.out.result) || - W_ERROR_EQUAL(WERR_NO_MORE_ITEMS, r.out.result), - talloc_asprintf(tctx, - "dfs_GetInfo failed - %s", win_errstr(r.out.result))); + status = dcerpc_dfs_GetInfo(p, mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + printf("GetInfo failed - %s\n", nt_errstr(status)); + return False; + } else if (!W_ERROR_IS_OK(r.out.result) && + !W_ERROR_EQUAL(WERR_NO_MORE_ITEMS, r.out.result)) { + printf("dfs_GetInfo failed - %s\n", win_errstr(r.out.result)); + return False; + } return True; } -static bool test_Info(struct torture_context *tctx, - struct dcerpc_pipe *p, const char *root) +static BOOL test_GetInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, const char *root) { BOOL ret = True; /* 103, 104, 105, 106 is only available on Set */ @@ -213,15 +217,14 @@ static bool test_Info(struct torture_context *tctx, int i; for (i=0;i<ARRAY_SIZE(levels);i++) { - if (!test_GetInfoLevel(tctx, p, levels[i], root)) { - ret = false; + if (!test_GetInfoLevel(p, mem_ctx, levels[i], root)) { + ret = False; } } return ret; } -static bool test_EnumLevel(struct torture_context *tctx, - struct dcerpc_pipe *p, uint16_t level) +static BOOL test_EnumLevelEx(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint16_t level, const char *dfs_name) { NTSTATUS status; struct dfs_EnumEx rex; @@ -302,18 +305,23 @@ static BOOL test_EnumLevel(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint16_t e.e.info1->s = &s; s.path = NULL; - status = dcerpc_dfs_Enum(p, tctx, &r); - torture_assert_ntstatus_ok(tctx, status, "Enum failed - %s\n", - nt_errstr(status)); - torture_assert(tctx, W_ERROR_IS_OK(r.out.result) || - W_ERROR_EQUAL(WERR_NO_MORE_ITEMS, r.out.result), - "dfs_Enum failed - %s", win_errstr(r.out.result)); + printf("Testing Enum level %u\n", level); + + status = dcerpc_dfs_Enum(p, mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + printf("Enum failed - %s\n", nt_errstr(status)); + return False; + } else if (!W_ERROR_IS_OK(r.out.result) && + !W_ERROR_EQUAL(WERR_NO_MORE_ITEMS, r.out.result)) { + printf("dfs_Enum failed - %s\n", win_errstr(r.out.result)); + return False; + } if (level == 1 && r.out.total) { int i; for (i=0;i<*r.out.total;i++) { const char *root = r.out.info->e.info1->s[i].path; - if (!test_GetInfo(tctx, p, root)) { + if (!test_GetInfo(p, mem_ctx, root)) { ret = False; } } @@ -324,16 +332,15 @@ static BOOL test_EnumLevel(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint16_t } -static bool test_Enum(struct torture_context *tctx, - struct dcerpc_pipe *p) +static BOOL test_Enum(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) { BOOL ret = True; uint16_t levels[] = {1, 2, 3, 4, 200, 300}; int i; for (i=0;i<ARRAY_SIZE(levels);i++) { - if (!test_EnumLevel(tctx, p, levels[i])) { - ret = false; + if (!test_EnumLevel(p, mem_ctx, levels[i])) { + ret = False; } } @@ -474,35 +481,22 @@ static BOOL test_StdRoot(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, const char return ret; } -#endif - -struct torture_suite *torture_rpc_dfs(void) +bool torture_rpc_dfs(struct torture_context *torture) { - struct torture_suite *suite = torture_suite_create( - talloc_autofree_context(), "RPC-DFS"); - -#if 0 - struct torture_tcase *tcase = torture_suite_add_rpc_iface_tcase(suite, - "dfs", &ndr_table_netdfs); - - torture_rpc_tcase_add_test(tcase, "GetManagerVersion", - test_GetManagerVersion); - -#if 0 - torture_rpc_tcase_add_test(tcase, "Add", - test_Add); -#endif - - torture_rpc_tcase_add_test(tcase, "Enum", test_Enum); - torture_rpc_tcase_add_test(tcase, "EnumEx", test_EnumEx); - torture_rpc_tcase_add_test(tcase, "ManagerInitialize", - test_ManagerInitialize); - torture_rpc_tcase_add_test(tcase, "StdRoot", - test_StdRoot); + NTSTATUS status; + struct dcerpc_pipe *p; + BOOL ret = True; + enum dfs_ManagerVersion version; + const char *host = lp_parm_string(-1, "torture", "host"); - talloc_free(mem_ctx); + status = torture_rpc_connection(torture, &p, &ndr_table_netdfs); + torture_assert_ntstatus_ok(torture, status, "Unable to connect"); -#endif + ret &= test_GetManagerVersion(p, torture, &version); + ret &= test_ManagerInitialize(p, torture, host); + ret &= test_Enum(p, torture); + ret &= test_EnumEx(p, torture, host); + ret &= test_StdRoot(p, torture, host); - return suite; + return ret; } diff --git a/source4/torture/rpc/echo.c b/source4/torture/rpc/echo.c index 5956ed74a7..edc35c0aa7 100644 --- a/source4/torture/rpc/echo.c +++ b/source4/torture/rpc/echo.c @@ -431,7 +431,7 @@ struct torture_suite *torture_rpc_echo(void) { struct torture_suite *suite = torture_suite_create( talloc_autofree_context(), "ECHO"); - struct torture_tcase *tcase; + struct torture_rpc_tcase *tcase; tcase = torture_suite_add_rpc_iface_tcase(suite, "echo", &ndr_table_rpcecho); diff --git a/source4/torture/rpc/epmapper.c b/source4/torture/rpc/epmapper.c index 3f9de22721..f6f8e66369 100644 --- a/source4/torture/rpc/epmapper.c +++ b/source4/torture/rpc/epmapper.c @@ -134,7 +134,8 @@ static BOOL test_Map(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, return True; } -static BOOL test_Lookup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) +static bool test_Lookup(struct torture_context *tctx, + struct dcerpc_pipe *p) { NTSTATUS status; struct epm_Lookup r; @@ -160,19 +161,19 @@ static BOOL test_Lookup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) ZERO_STRUCT(uuid); ZERO_STRUCT(iface); - status = dcerpc_epm_Lookup(p, mem_ctx, &r); + status = dcerpc_epm_Lookup(p, tctx, &r); if (!NT_STATUS_IS_OK(status) || r.out.result != 0) { break; } printf("epm_Lookup returned %d events GUID %s\n", - *r.out.num_ents, GUID_string(mem_ctx, &handle.uuid)); + *r.out.num_ents, GUID_string(tctx, &handle.uuid)); for (i=0;i<*r.out.num_ents;i++) { printf("\nFound '%s'\n", r.out.entries[i].annotation); - display_tower(mem_ctx, &r.out.entries[i].tower->tower); + display_tower(tctx, &r.out.entries[i].tower->tower); if (r.out.entries[i].tower->tower.num_floors == 5) { - test_Map(p, mem_ctx, r.out.entries[i].tower); + test_Map(p, tctx, r.out.entries[i].tower); } } } while (NT_STATUS_IS_OK(status) && @@ -180,13 +181,9 @@ static BOOL test_Lookup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) *r.out.num_ents == r.in.max_ents && !policy_handle_empty(&handle)); - if (!NT_STATUS_IS_OK(status)) { - printf("Lookup failed - %s\n", nt_errstr(status)); - return False; - } + torture_assert_ntstatus_ok(tctx, status, "Lookup failed"); - - return True; + return true; } static BOOL test_Delete(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct epm_entry_t *entries) @@ -211,7 +208,8 @@ static BOOL test_Delete(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct epm_e return True; } -static BOOL test_Insert(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) +static bool test_Insert(struct torture_context *tctx, + struct dcerpc_pipe *p) { NTSTATUS status; struct epm_Insert r; @@ -219,89 +217,60 @@ static BOOL test_Insert(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) r.in.num_ents = 1; - r.in.entries = talloc_array(mem_ctx, struct epm_entry_t, 1); + r.in.entries = talloc_array(tctx, struct epm_entry_t, 1); ZERO_STRUCT(r.in.entries[0].object); r.in.entries[0].annotation = "smbtorture endpoint"; - status = dcerpc_parse_binding(mem_ctx, "ncalrpc:[SMBTORTURE]", &bd); - if (NT_STATUS_IS_ERR(status)) { - printf("Unable to generate dcerpc_binding struct\n"); - return False; - } + status = dcerpc_parse_binding(tctx, "ncalrpc:[SMBTORTURE]", &bd); + torture_assert_ntstatus_ok(tctx, status, + "Unable to generate dcerpc_binding struct"); - r.in.entries[0].tower = talloc(mem_ctx, struct epm_twr_t); + r.in.entries[0].tower = talloc(tctx, struct epm_twr_t); - status = dcerpc_binding_build_tower(mem_ctx, bd, &r.in.entries[0].tower->tower); - if (NT_STATUS_IS_ERR(status)) { - printf("Unable to build tower from binding struct\n"); - return False; - } + status = dcerpc_binding_build_tower(tctx, bd, &r.in.entries[0].tower->tower); + torture_assert_ntstatus_ok(tctx, status, + "Unable to build tower from binding struct"); r.in.replace = 0; - status = dcerpc_epm_Insert(p, mem_ctx, &r); - if (NT_STATUS_IS_ERR(status)) { - printf("Insert failed - %s\n", nt_errstr(status)); - return False; - } + status = dcerpc_epm_Insert(p, tctx, &r); + torture_assert_ntstatus_ok(tctx, status, "Insert failed"); - if (r.out.result != 0) { - printf("Insert failed - %d\n", r.out.result); - printf("NOT CONSIDERING AS A FAILURE\n"); - return True; - } + torture_assert(tctx, r.out.result == 0, "Insert failed"); - if (!test_Delete(p, mem_ctx, r.in.entries)) { - return False; + if (!test_Delete(p, tctx, r.in.entries)) { + return false; } - return True; + return true; } -static BOOL test_InqObject(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) +static bool test_InqObject(struct torture_context *tctx, struct dcerpc_pipe *p) { NTSTATUS status; struct epm_InqObject r; - r.in.epm_object = talloc(mem_ctx, struct GUID); + r.in.epm_object = talloc(tctx, struct GUID); *r.in.epm_object = ndr_table_epmapper.syntax_id.uuid; - status = dcerpc_epm_InqObject(p, mem_ctx, &r); - if (NT_STATUS_IS_ERR(status)) { - printf("InqObject failed - %s\n", nt_errstr(status)); - return False; - } + status = dcerpc_epm_InqObject(p, tctx, &r); + torture_assert_ntstatus_ok(tctx, status, "InqObject failed"); - return True; + return true; } -BOOL torture_rpc_epmapper(struct torture_context *torture) +struct torture_suite *torture_rpc_epmapper(TALLOC_CTX *mem_ctx) { - NTSTATUS status; - struct dcerpc_pipe *p; - TALLOC_CTX *mem_ctx; - BOOL ret = True; - - mem_ctx = talloc_init("torture_rpc_epmapper"); - - status = torture_rpc_connection(torture, &p, &ndr_table_epmapper); - if (!NT_STATUS_IS_OK(status)) { - talloc_free(mem_ctx); - return False; - } - - if (!test_Lookup(p, mem_ctx)) { - ret = False; - } + struct torture_suite *suite = torture_suite_create(mem_ctx, "EPMAPPER"); + struct torture_rpc_tcase *tcase; + + tcase = torture_suite_add_rpc_iface_tcase(suite, "epmapper", + &ndr_table_epmapper); - if (!test_Insert(p, mem_ctx)) { - ret = False; - } + torture_rpc_tcase_add_test(tcase, "Lookup", test_Lookup); - if (!test_InqObject(p, mem_ctx)) { - ret = False; - } + torture_rpc_tcase_add_test(tcase, "Insert", test_Insert); - talloc_free(mem_ctx); + torture_rpc_tcase_add_test(tcase, "InqObject", test_InqObject); - return ret; + return suite; } diff --git a/source4/torture/rpc/eventlog.c b/source4/torture/rpc/eventlog.c index 0c4ee14f85..1c72625f73 100644 --- a/source4/torture/rpc/eventlog.c +++ b/source4/torture/rpc/eventlog.c @@ -236,7 +236,7 @@ static bool test_OpenEventLog(struct torture_context *tctx, struct torture_suite *torture_rpc_eventlog(void) { struct torture_suite *suite; - struct torture_tcase *tcase; + struct torture_rpc_tcase *tcase; suite = torture_suite_create(talloc_autofree_context(), "EVENTLOG"); tcase = torture_suite_add_rpc_iface_tcase(suite, "eventlog", diff --git a/source4/torture/rpc/initshutdown.c b/source4/torture/rpc/initshutdown.c index aa817928ab..77b86ea3a1 100644 --- a/source4/torture/rpc/initshutdown.c +++ b/source4/torture/rpc/initshutdown.c @@ -30,115 +30,91 @@ static void init_initshutdown_String(TALLOC_CTX *mem_ctx, struct initshutdown_St name->name->name = s; } -static BOOL test_Init(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, - const char *msg, uint32_t timeout) + +static bool test_Abort(struct torture_context *tctx, + struct dcerpc_pipe *p) { - struct initshutdown_Init r; + struct initshutdown_Abort r; NTSTATUS status; - uint16_t hostname = 0x0; - - r.in.hostname = &hostname; - r.in.message = talloc(mem_ctx, struct initshutdown_String); - init_initshutdown_String(mem_ctx, r.in.message, msg); - r.in.force_apps = 1; - r.in.timeout = timeout; - r.in.reboot = 1; + uint16_t server = 0x0; - status = dcerpc_initshutdown_Init(p, mem_ctx, &r); + r.in.server = &server; + + status = dcerpc_initshutdown_Abort(p, tctx, &r); - if (!NT_STATUS_IS_OK(status)) { - printf("initshutdown_Init failed - %s\n", nt_errstr(status)); - return False; - } + torture_assert_ntstatus_ok(tctx, status, + "initshutdown_Abort failed"); - if (!W_ERROR_IS_OK(r.out.result)) { - printf("initshutdown_Init failed - %s\n", win_errstr(r.out.result)); - return False; - } + torture_assert_werr_ok(tctx, r.out.result, "initshutdown_Abort failed"); - return True; + return true; } -static BOOL test_InitEx(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, - const char *msg, uint32_t timeout) +static bool test_Init(struct torture_context *tctx, + struct dcerpc_pipe *p) { - struct initshutdown_InitEx r; + struct initshutdown_Init r; NTSTATUS status; uint16_t hostname = 0x0; + + if (!torture_setting_bool(tctx, "dangerous", false)) + torture_skip(tctx, + "initshutdown tests disabled - enable dangerous tests to use"); r.in.hostname = &hostname; - r.in.message = talloc(mem_ctx, struct initshutdown_String); - init_initshutdown_String(mem_ctx, r.in.message, msg); + r.in.message = talloc(tctx, struct initshutdown_String); + init_initshutdown_String(tctx, r.in.message, "spottyfood"); r.in.force_apps = 1; - r.in.timeout = timeout; + r.in.timeout = 30; r.in.reboot = 1; - r.in.reason = 0; - status = dcerpc_initshutdown_InitEx(p, mem_ctx, &r); + status = dcerpc_initshutdown_Init(p, tctx, &r); - if (!NT_STATUS_IS_OK(status)) { - printf("initshutdown_InitEx failed - %s\n", nt_errstr(status)); - return False; - } + torture_assert_ntstatus_ok(tctx, status, "initshutdown_Init failed"); + torture_assert_werr_ok(tctx, r.out.result, "initshutdown_Init failed"); - if (!W_ERROR_IS_OK(r.out.result)) { - printf("initshutdown_InitEx failed - %s\n", win_errstr(r.out.result)); - return False; - } - - return True; + return test_Abort(tctx, p); } -static BOOL test_Abort(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) +static bool test_InitEx(struct torture_context *tctx, + struct dcerpc_pipe *p) { - struct initshutdown_Abort r; + struct initshutdown_InitEx r; NTSTATUS status; - uint16_t server = 0x0; + uint16_t hostname = 0x0; - r.in.server = &server; + if (!torture_setting_bool(tctx, "dangerous", false)) + torture_skip(tctx, + "initshutdown tests disabled - enable dangerous tests to use"); - status = dcerpc_initshutdown_Abort(p, mem_ctx, &r); - - if (!NT_STATUS_IS_OK(status)) { - printf("initshutdown_Abort failed - %s\n", nt_errstr(status)); - return False; - } + r.in.hostname = &hostname; + r.in.message = talloc(tctx, struct initshutdown_String); + init_initshutdown_String(tctx, r.in.message, "spottyfood"); + r.in.force_apps = 1; + r.in.timeout = 30; + r.in.reboot = 1; + r.in.reason = 0; - if (!W_ERROR_IS_OK(r.out.result)) { - printf("initshutdown_Abort failed - %s\n", win_errstr(r.out.result)); - return False; - } + status = dcerpc_initshutdown_InitEx(p, tctx, &r); - return True; -} + torture_assert_ntstatus_ok(tctx, status, "initshutdown_InitEx failed"); -BOOL torture_rpc_initshutdown(struct torture_context *torture) -{ - NTSTATUS status; - struct dcerpc_pipe *p; - TALLOC_CTX *mem_ctx; - BOOL ret = True; + torture_assert_werr_ok(tctx, r.out.result, "initshutdown_InitEx failed"); - mem_ctx = talloc_init("torture_rpc_initshutdown"); + return test_Abort(tctx, p); +} - status = torture_rpc_connection(torture, &p, &ndr_table_initshutdown); - if (!NT_STATUS_IS_OK(status)) { - talloc_free(mem_ctx); - return False; - } +struct torture_suite *torture_rpc_initshutdown(TALLOC_CTX *mem_ctx) +{ + struct torture_suite *suite = torture_suite_create(mem_ctx, "INITSHUTDOWN"); + struct torture_rpc_tcase *tcase; - if (!torture_setting_bool(torture, "dangerous", False)) { - torture_comment(torture, - "initshutdown tests disabled - enable dangerous tests to use\n"); - } else { - ret &= test_Init(p, mem_ctx, "spottyfood", 30); - ret &= test_Abort(p, mem_ctx); - ret &= test_InitEx(p, mem_ctx, "spottyfood", 30); - ret &= test_Abort(p, mem_ctx); - } + tcase = torture_suite_add_rpc_iface_tcase(suite, "initshutdown", + &ndr_table_initshutdown); - talloc_free(mem_ctx); + torture_rpc_tcase_add_test(tcase, "Init", test_Init); + torture_rpc_tcase_add_test(tcase, "InitEx", test_InitEx); - return ret; + return suite; } diff --git a/source4/torture/rpc/oxidresolve.c b/source4/torture/rpc/oxidresolve.c index 2809a2a3fb..02edb306b3 100644 --- a/source4/torture/rpc/oxidresolve.c +++ b/source4/torture/rpc/oxidresolve.c @@ -31,12 +31,21 @@ const struct GUID IUnknown_uuid = { 0x00000000,0x0000,0x0000,{0xc0,0x00},{0x00,0x00,0x00,0x00,0x00,0x46} }; -static int test_RemoteActivation(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint64_t *oxid, struct GUID *oid) +static bool test_RemoteActivation(struct torture_context *tctx, + uint64_t *oxid, struct GUID *oid) { struct RemoteActivation r; NTSTATUS status; struct GUID iids[2]; uint16_t protseq[3] = { EPM_PROTOCOL_TCP, EPM_PROTOCOL_NCALRPC, EPM_PROTOCOL_UUID }; + struct dcerpc_pipe *p; + + status = torture_rpc_connection(tctx, &p, + &ndr_table_IRemoteActivation); + + if (!NT_STATUS_IS_OK(status)) { + return false; + } ZERO_STRUCT(r.in); r.in.this.version.MajorVersion = 5; @@ -52,66 +61,67 @@ static int test_RemoteActivation(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uin r.out.pOxid = oxid; r.out.ipidRemUnknown = oid; - status = dcerpc_RemoteActivation(p, mem_ctx, &r); + status = dcerpc_RemoteActivation(p, tctx, &r); if(NT_STATUS_IS_ERR(status)) { fprintf(stderr, "RemoteActivation: %s\n", nt_errstr(status)); - return 0; + return false; } if(!W_ERROR_IS_OK(r.out.result)) { fprintf(stderr, "RemoteActivation: %s\n", win_errstr(r.out.result)); - return 0; + return false; } if(!W_ERROR_IS_OK(*r.out.hr)) { fprintf(stderr, "RemoteActivation: %s\n", win_errstr(*r.out.hr)); - return 0; + return false; } if(!W_ERROR_IS_OK(r.out.results[0])) { fprintf(stderr, "RemoteActivation: %s\n", win_errstr(r.out.results[0])); - return 0; + return false; } - - return 1; + return true; } -static int test_SimplePing(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint64_t setid) +static bool test_SimplePing(struct torture_context *tctx, + struct dcerpc_pipe *p) { struct SimplePing r; NTSTATUS status; + uint64_t setid; r.in.SetId = &setid; - status = dcerpc_SimplePing(p, mem_ctx, &r); - if(NT_STATUS_IS_ERR(status)) { - fprintf(stderr, "SimplePing: %s\n", nt_errstr(status)); - return 0; - } - - if(!W_ERROR_IS_OK(r.out.result)) { - fprintf(stderr, "SimplePing: %s\n", win_errstr(r.out.result)); - return 0; - } + status = dcerpc_SimplePing(p, tctx, &r); + torture_assert_ntstatus_ok(tctx, status, "SimplePing"); + torture_assert_werr_ok(tctx, r.out.result, "SimplePing"); - return 1; + return true; } -static int test_ComplexPing(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint64_t *setid, struct GUID oid) +static bool test_ComplexPing(struct torture_context *tctx, + struct dcerpc_pipe *p) { struct ComplexPing r; NTSTATUS status; + uint64_t setid; + struct GUID oid; + uint64_t oxid; - *setid = 0; + if (!test_RemoteActivation(tctx, &oxid, &oid)) + return false; + + setid = 0; ZERO_STRUCT(r.in); r.in.SequenceNum = 0; - r.in.SetId = setid; + r.in.SetId = &setid; r.in.cAddToSet = 1; r.in.AddToSet = &oid; - status = dcerpc_ComplexPing(p, mem_ctx, &r); + status = dcerpc_ComplexPing(p, tctx, &r); if(NT_STATUS_IS_ERR(status)) { fprintf(stderr, "ComplexPing: %s\n", nt_errstr(status)); return 0; @@ -127,148 +137,101 @@ static int test_ComplexPing(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint64_t return 1; } -static int test_ServerAlive(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) +static bool test_ServerAlive(struct torture_context *tctx, + struct dcerpc_pipe *p) { struct ServerAlive r; NTSTATUS status; - status = dcerpc_ServerAlive(p, mem_ctx, &r); - if(NT_STATUS_IS_ERR(status)) { - fprintf(stderr, "ServerAlive: %s\n", nt_errstr(status)); - return 0; - } - - if(!W_ERROR_IS_OK(r.out.result)) { - fprintf(stderr, "ServerAlive: %s\n", win_errstr(r.out.result)); - return 0; - } + status = dcerpc_ServerAlive(p, tctx, &r); + torture_assert_ntstatus_ok(tctx, status, "ServerAlive"); + torture_assert_werr_ok(tctx, r.out.result, "ServerAlive"); - return 1; + return true; } -static int test_ResolveOxid(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint64_t oxid) +static bool test_ResolveOxid(struct torture_context *tctx, + struct dcerpc_pipe *p) { struct ResolveOxid r; NTSTATUS status; uint16_t protseq[2] = { EPM_PROTOCOL_TCP, EPM_PROTOCOL_SMB }; + uint64_t oxid; + struct GUID oid; + + if (!test_RemoteActivation(tctx, &oxid, &oid)) + return false; r.in.pOxid = oxid; r.in.cRequestedProtseqs = 2; r.in.arRequestedProtseqs = protseq; - status = dcerpc_ResolveOxid(p, mem_ctx, &r); - if(NT_STATUS_IS_ERR(status)) { - fprintf(stderr, "ResolveOxid: %s\n", nt_errstr(status)); - return 0; - } - - if(!W_ERROR_IS_OK(r.out.result)) { - fprintf(stderr, "ResolveOxid: %s\n", win_errstr(r.out.result)); - return 0; - } + status = dcerpc_ResolveOxid(p, tctx, &r); + torture_assert_ntstatus_ok(tctx, status, "ResolveOxid"); + torture_assert_werr_ok(tctx, r.out.result, "ResolveOxid"); - return 1; + return true; } -static int test_ResolveOxid2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint64_t oxid) +static bool test_ResolveOxid2(struct torture_context *tctx, + struct dcerpc_pipe *p) { struct ResolveOxid2 r; NTSTATUS status; uint16_t protseq[2] = { EPM_PROTOCOL_TCP, EPM_PROTOCOL_SMB }; + uint64_t oxid; + struct GUID oid; + + if (!test_RemoteActivation(tctx, &oxid, &oid)) + return false; r.in.pOxid = oxid; r.in.cRequestedProtseqs = 2; r.in.arRequestedProtseqs = protseq; - status = dcerpc_ResolveOxid2(p, mem_ctx, &r); - if(NT_STATUS_IS_ERR(status)) { - fprintf(stderr, "ResolveOxid2: %s\n", nt_errstr(status)); - return 0; - } + status = dcerpc_ResolveOxid2(p, tctx, &r); + torture_assert_ntstatus_ok(tctx, status, "ResolveOxid2"); - if(!W_ERROR_IS_OK(r.out.result)) { - fprintf(stderr, "ResolveOxid2: %s\n", win_errstr(r.out.result)); - return 0; - } + torture_assert_werr_ok(tctx, r.out.result, "ResolveOxid2"); - printf("Remote server versions: %d, %d\n", r.out.ComVersion->MajorVersion, r.out.ComVersion->MinorVersion); + torture_comment(tctx, "Remote server versions: %d, %d\n", r.out.ComVersion->MajorVersion, r.out.ComVersion->MinorVersion); - return 1; + return true; } - - -static int test_ServerAlive2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) +static bool test_ServerAlive2(struct torture_context *tctx, + struct dcerpc_pipe *p) { struct ServerAlive2 r; NTSTATUS status; - status = dcerpc_ServerAlive2(p, mem_ctx, &r); - if(NT_STATUS_IS_ERR(status)) { - fprintf(stderr, "ServerAlive2: %s\n", nt_errstr(status)); - return 0; - } - - if(!W_ERROR_IS_OK(r.out.result)) { - fprintf(stderr, "ServerAlive2: %s\n", win_errstr(r.out.result)); - return 0; - } + status = dcerpc_ServerAlive2(p, tctx, &r); + torture_assert_ntstatus_ok(tctx, status, "ServerAlive2"); + torture_assert_werr_ok(tctx, r.out.result, "ServerAlive2"); - return 1; + return true; } -BOOL torture_rpc_oxidresolve(struct torture_context *torture) +struct torture_suite *torture_rpc_oxidresolve(TALLOC_CTX *mem_ctx) { - NTSTATUS status; - struct dcerpc_pipe *p, *premact; - TALLOC_CTX *mem_ctx; - BOOL ret = True; - uint64_t setid; - uint64_t oxid; - struct GUID oid; - - mem_ctx = talloc_init("torture_rpc_oxidresolve"); - - status = torture_rpc_connection(torture, - &premact, - &ndr_table_IRemoteActivation); - - if (!NT_STATUS_IS_OK(status)) { - talloc_free(mem_ctx); - return False; - } - - status = torture_rpc_connection(torture, - &p, - &ndr_table_IOXIDResolver); - - if (!NT_STATUS_IS_OK(status)) { - talloc_free(mem_ctx); - return False; - } - - if(!test_ServerAlive(p, mem_ctx)) - ret = False; + struct torture_suite *suite = torture_suite_create(mem_ctx, + "OXIDRESOLVE"); + struct torture_rpc_tcase *tcase; - if(!test_ServerAlive2(p, mem_ctx)) - ret = False; + tcase = torture_suite_add_rpc_iface_tcase(suite, "oxidresolver", + &ndr_table_IOXIDResolver); - if(!test_RemoteActivation(premact, mem_ctx, &oxid, &oid)) - return False; + torture_rpc_tcase_add_test(tcase, "ServerAlive", test_ServerAlive); - if(!test_ComplexPing(p, mem_ctx, &setid, oid)) - ret = False; + torture_rpc_tcase_add_test(tcase, "ServerAlive2", test_ServerAlive2); - if(!test_SimplePing(p, mem_ctx, setid)) - ret = False; + torture_rpc_tcase_add_test(tcase, "ComplexPing", test_ComplexPing); - if(!test_ResolveOxid(p, mem_ctx, oxid)) - ret = False; - - if(!test_ResolveOxid2(p, mem_ctx, oxid)) - ret = False; + torture_rpc_tcase_add_test(tcase, "SimplePing", test_SimplePing); + + torture_rpc_tcase_add_test(tcase, "ResolveOxid", test_ResolveOxid); - talloc_free(mem_ctx); + torture_rpc_tcase_add_test(tcase, "ResolveOxid2", test_ResolveOxid2); - return ret; + return suite; } diff --git a/source4/torture/rpc/remact.c b/source4/torture/rpc/remact.c index d1294f429d..1fc3c1376b 100644 --- a/source4/torture/rpc/remact.c +++ b/source4/torture/rpc/remact.c @@ -28,7 +28,8 @@ #define DCERPC_IUNKNOWN_UUID "00000000-0000-0000-c000-000000000046" #define DCERPC_ICLASSFACTORY_UUID "00000001-0000-0000-c000-000000000046" -static int test_RemoteActivation(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) +static bool test_RemoteActivation(struct torture_context *tctx, + struct dcerpc_pipe *p) { struct RemoteActivation r; NTSTATUS status; @@ -47,77 +48,42 @@ static int test_RemoteActivation(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) GUID_from_string(DCERPC_IUNKNOWN_UUID, &iids[0]); r.in.pIIDs = iids; - status = dcerpc_RemoteActivation(p, mem_ctx, &r); - if(NT_STATUS_IS_ERR(status)) { - printf("RemoteActivation: %s\n", nt_errstr(status)); - return 0; - } + status = dcerpc_RemoteActivation(p, tctx, &r); + torture_assert_ntstatus_ok(tctx, status, "RemoteActivation"); - if(!W_ERROR_IS_OK(r.out.result)) { - printf("RemoteActivation: %s\n", win_errstr(r.out.result)); - return 0; - } + torture_assert_werr_ok(tctx, r.out.result, "RemoteActivation"); - if(!W_ERROR_IS_OK(*r.out.hr)) { - printf("RemoteActivation: %s\n", win_errstr(*r.out.hr)); - return 0; - } + torture_assert_werr_ok(tctx, *r.out.hr, "RemoteActivation"); - if(!W_ERROR_IS_OK(r.out.results[0])) { - printf("RemoteActivation: %s\n", win_errstr(r.out.results[0])); - return 0; - } + torture_assert_werr_ok(tctx, r.out.results[0], "RemoteActivation"); GUID_from_string(DCERPC_ICLASSFACTORY_UUID, &iids[0]); r.in.Interfaces = 1; r.in.Mode = MODE_GET_CLASS_OBJECT; - status = dcerpc_RemoteActivation(p, mem_ctx, &r); - if(NT_STATUS_IS_ERR(status)) { - printf("RemoteActivation(GetClassObject): %s\n", nt_errstr(status)); - return 0; - } + status = dcerpc_RemoteActivation(p, tctx, &r); + torture_assert_ntstatus_ok(tctx, status, + "RemoteActivation(GetClassObject)"); - if(!W_ERROR_IS_OK(r.out.result)) { - printf("RemoteActivation(GetClassObject): %s\n", win_errstr(r.out.result)); - return 0; - } + torture_assert_werr_ok(tctx, r.out.result, + "RemoteActivation(GetClassObject)"); - if(!W_ERROR_IS_OK(*r.out.hr)) { - printf("RemoteActivation(GetClassObject): %s\n", win_errstr(*r.out.hr)); - return 0; - } + torture_assert_werr_ok(tctx, *r.out.hr, "RemoteActivation(GetClassObject)"); - if(!W_ERROR_IS_OK(r.out.results[0])) { - printf("RemoteActivation(GetClassObject): %s\n", win_errstr(r.out.results[0])); - return 0; - } + torture_assert_werr_ok(tctx, r.out.results[0], + "RemoteActivation(GetClassObject)"); - return 1; + return true; } -BOOL torture_rpc_remact(struct torture_context *torture) +struct torture_suite *torture_rpc_remact(TALLOC_CTX *mem_ctx) { - NTSTATUS status; - struct dcerpc_pipe *p; - TALLOC_CTX *mem_ctx; - BOOL ret = True; - - mem_ctx = talloc_init("torture_rpc_remact"); - - status = torture_rpc_connection(torture, - &p, - &ndr_table_IRemoteActivation); - - if (!NT_STATUS_IS_OK(status)) { - talloc_free(mem_ctx); - return False; - } + struct torture_suite *suite = torture_suite_create(mem_ctx, "REMACT"); + struct torture_rpc_tcase *tcase; - if(!test_RemoteActivation(p, mem_ctx)) - ret = False; + tcase = torture_suite_add_rpc_iface_tcase(suite, "remact", &ndr_table_IRemoteActivation); - talloc_free(mem_ctx); + torture_rpc_tcase_add_test(tcase, "RemoteActivation", test_RemoteActivation); - return ret; + return suite; } diff --git a/source4/torture/rpc/rot.c b/source4/torture/rpc/rot.c deleted file mode 100644 index 32a18b1d32..0000000000 --- a/source4/torture/rpc/rot.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - Unix SMB/CIFS implementation. - test suite for the running object table - - Copyright (C) Jelmer Vernooij 2004 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - -#include "includes.h" -#include "torture/torture.h" -#include "librpc/gen_ndr/ndr_rot.h" -#include "torture/rpc/rpc.h" - -BOOL torture_rpc_rot(struct torture_context *torture) -{ - NTSTATUS status; - struct dcerpc_pipe *p; - TALLOC_CTX *mem_ctx; - BOOL ret = True; - - mem_ctx = talloc_init("torture_rpc_rot"); - - status = torture_rpc_connection(torture, - &p, - &ndr_table_rot); - - if (!NT_STATUS_IS_OK(status)) { - talloc_free(mem_ctx); - return False; - } - - talloc_free(mem_ctx); - - return ret; -} diff --git a/source4/torture/rpc/rpc.c b/source4/torture/rpc/rpc.c index 21a85fbf03..3d8a56ffba 100644 --- a/source4/torture/rpc/rpc.c +++ b/source4/torture/rpc/rpc.c @@ -250,7 +250,7 @@ NTSTATUS torture_rpc_init(void) torture_suite_add_simple_test(suite, "LSA-GETUSER", torture_rpc_lsa_get_user); torture_suite_add_simple_test(suite, "SECRETS", torture_rpc_lsa_secrets); torture_suite_add_suite(suite, torture_rpc_echo()); - torture_suite_add_suite(suite, torture_rpc_dfs()); + torture_suite_add_simple_test(suite, "DFS", torture_rpc_dfs); torture_suite_add_suite(suite, torture_rpc_unixinfo()); torture_suite_add_suite(suite, torture_rpc_eventlog()); torture_suite_add_suite(suite, torture_rpc_atsvc()); @@ -268,10 +268,10 @@ NTSTATUS torture_rpc_init(void) torture_suite_add_simple_test(suite, "SCHANNEL2", torture_rpc_schannel2); torture_suite_add_suite(suite, torture_rpc_srvsvc(suite)); torture_suite_add_suite(suite, torture_rpc_svcctl(suite)); - torture_suite_add_simple_test(suite, "EPMAPPER", torture_rpc_epmapper); - torture_suite_add_simple_test(suite, "INITSHUTDOWN", torture_rpc_initshutdown); - torture_suite_add_simple_test(suite, "OXIDRESOLVE", torture_rpc_oxidresolve); - torture_suite_add_simple_test(suite, "REMACT", torture_rpc_remact); + torture_suite_add_suite(suite, torture_rpc_epmapper(suite)); + torture_suite_add_suite(suite, torture_rpc_initshutdown(suite)); + torture_suite_add_suite(suite, torture_rpc_oxidresolve(suite)); + torture_suite_add_suite(suite, torture_rpc_remact(suite)); torture_suite_add_simple_test(suite, "MGMT", torture_rpc_mgmt); torture_suite_add_simple_test(suite, "SCANNER", torture_rpc_scanner); torture_suite_add_simple_test(suite, "AUTOIDL", torture_rpc_autoidl); @@ -292,7 +292,6 @@ NTSTATUS torture_rpc_init(void) torture_suite_add_simple_test(suite, "RPC-SAMBA3-WINREG", torture_samba3_rpc_winreg); torture_suite_add_simple_test(suite, "DRSUAPI", torture_rpc_drsuapi); torture_suite_add_simple_test(suite, "CRACKNAMES", torture_rpc_drsuapi_cracknames); - torture_suite_add_simple_test(suite, "ROT", torture_rpc_rot); torture_suite_add_simple_test(suite, "DSSETUP", torture_rpc_dssetup); torture_suite_add_simple_test(suite, "ALTERCONTEXT", torture_rpc_alter_context); torture_suite_add_simple_test(suite, "JOIN", torture_rpc_join); diff --git a/source4/torture/rpc/srvsvc.c b/source4/torture/rpc/srvsvc.c index 15d8502867..a51dc96876 100644 --- a/source4/torture/rpc/srvsvc.c +++ b/source4/torture/rpc/srvsvc.c @@ -1131,7 +1131,7 @@ again: struct torture_suite *torture_rpc_srvsvc(TALLOC_CTX *mem_ctx) { struct torture_suite *suite = torture_suite_create(mem_ctx, "SRVSVC"); - struct torture_tcase *tcase; + struct torture_rpc_tcase *tcase; tcase = torture_suite_add_rpc_iface_tcase(suite, "srvsvc (admin access)", &ndr_table_srvsvc); diff --git a/source4/torture/rpc/svcctl.c b/source4/torture/rpc/svcctl.c index 4390b8dd3e..2f2b4ec485 100644 --- a/source4/torture/rpc/svcctl.c +++ b/source4/torture/rpc/svcctl.c @@ -117,7 +117,7 @@ static bool test_SCManager(struct torture_context *tctx, struct torture_suite *torture_rpc_svcctl(TALLOC_CTX *mem_ctx) { struct torture_suite *suite = torture_suite_create(mem_ctx, "SVCCTL"); - struct torture_tcase *tcase; + struct torture_rpc_tcase *tcase; tcase = torture_suite_add_rpc_iface_tcase(suite, "svcctl", &ndr_table_svcctl); diff --git a/source4/torture/rpc/unixinfo.c b/source4/torture/rpc/unixinfo.c index 6a8a664020..80d7d96a9e 100644 --- a/source4/torture/rpc/unixinfo.c +++ b/source4/torture/rpc/unixinfo.c @@ -128,7 +128,7 @@ static bool test_gidtosid(struct torture_context *tctx, struct dcerpc_pipe *p) struct torture_suite *torture_rpc_unixinfo(void) { struct torture_suite *suite; - struct torture_tcase *tcase; + struct torture_rpc_tcase *tcase; suite = torture_suite_create(talloc_autofree_context(), "UNIXINFO"); tcase = torture_suite_add_rpc_iface_tcase(suite, "unixinfo", diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c index 7559a4d8ac..a3d671c489 100644 --- a/source4/torture/rpc/winreg.c +++ b/source4/torture/rpc/winreg.c @@ -747,7 +747,7 @@ struct torture_suite *torture_rpc_winreg(TALLOC_CTX *mem_ctx) {"OpenHKCR", (winreg_open_fn)dcerpc_winreg_OpenHKCR }, {"OpenHKCU", (winreg_open_fn)dcerpc_winreg_OpenHKCU }}; int i; - struct torture_tcase *tcase; + struct torture_rpc_tcase *tcase; struct torture_suite *suite = torture_suite_create(mem_ctx, "WINREG"); tcase = torture_suite_add_rpc_iface_tcase(suite, "winreg", diff --git a/source4/torture/rpc/wkssvc.c b/source4/torture/rpc/wkssvc.c index 49adcb7c29..89be804b07 100644 --- a/source4/torture/rpc/wkssvc.c +++ b/source4/torture/rpc/wkssvc.c @@ -80,7 +80,7 @@ static bool test_NetWkstaTransportEnum(struct torture_context *tctx, struct torture_suite *torture_rpc_wkssvc(void) { struct torture_suite *suite; - struct torture_tcase *tcase; + struct torture_rpc_tcase *tcase; suite = torture_suite_create(talloc_autofree_context(), "WKSSVC"); tcase = torture_suite_add_rpc_iface_tcase(suite, "wkssvc", |