From c5d91e0e0f750329d3e99c8bd9345aea5a475d94 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 9 Mar 2015 20:37:45 +0100 Subject: [PATCH] s4-torture: Make the backupkey test as a noop with MIT Kerberos. The test is planned but will be skipped in the MIT case this way. We need to rewrite the test using a proper cryto/tls library. Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison --- source4/torture/rpc/backupkey.c | 28 +++++++++++++++++++++++++--- source4/torture/rpc/rpc.c | 2 -- source4/torture/wscript_build | 17 +++++++++-------- 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/source4/torture/rpc/backupkey.c b/source4/torture/rpc/backupkey.c index c3e990819ec..a3b8aaa9a8d 100644 --- a/source4/torture/rpc/backupkey.c +++ b/source4/torture/rpc/backupkey.c @@ -20,12 +20,15 @@ #include "includes.h" #include "../libcli/security/security.h" + +#include "torture/rpc/torture_rpc.h" +#include "torture/ndr/ndr.h" + +#ifdef SAMBA4_USES_HEIMDAL #include "librpc/gen_ndr/ndr_backupkey_c.h" #include "librpc/gen_ndr/ndr_backupkey.h" #include "librpc/gen_ndr/ndr_lsa_c.h" #include "librpc/gen_ndr/ndr_security.h" -#include "torture/rpc/torture_rpc.h" -#include "torture/ndr/ndr.h" #include "lib/cmdline/popt_common.h" #include "libcli/auth/proto.h" #include "lib/crypto/arcfour.h" @@ -2032,12 +2035,23 @@ static bool test_ServerWrap_encrypt_decrypt_wrong_sid(struct torture_context *tc { return test_ServerWrap_decrypt_wrong_stuff(tctx, p, WRONG_SID); } +#else +static bool test_skip(struct torture_context *tctx, + void *data) +{ + torture_skip(tctx, "Skip backupkey test with MIT Kerberos"); + + return true; +} +#endif struct torture_suite *torture_rpc_backupkey(TALLOC_CTX *mem_ctx) { - struct torture_rpc_tcase *tcase; struct torture_suite *suite = torture_suite_create(mem_ctx, "backupkey"); +#ifdef SAMBA4_USES_HEIMDAL + struct torture_rpc_tcase *tcase; + tcase = torture_suite_add_rpc_iface_tcase(suite, "backupkey", &ndr_table_backupkey); @@ -2126,6 +2140,14 @@ struct torture_suite *torture_rpc_backupkey(TALLOC_CTX *mem_ctx) torture_rpc_tcase_add_test(tcase, "server_wrap_encrypt_decrypt_wrong_sid", test_ServerWrap_encrypt_decrypt_wrong_sid); +#else + struct torture_tcase *tcase; + + tcase = torture_suite_add_tcase(suite, "backupkey"); + + torture_tcase_add_simple_test(tcase, "skip", + test_skip); +#endif return suite; } diff --git a/source4/torture/rpc/rpc.c b/source4/torture/rpc/rpc.c index 48d75d4703e..e70fac52fee 100644 --- a/source4/torture/rpc/rpc.c +++ b/source4/torture/rpc/rpc.c @@ -540,9 +540,7 @@ NTSTATUS torture_rpc_init(void) torture_suite_add_simple_test(suite, "asyncbind", torture_async_bind); torture_suite_add_suite(suite, torture_rpc_ntsvcs(suite)); torture_suite_add_suite(suite, torture_rpc_bind(suite)); -#ifdef AD_DC_BUILD_IS_ENABLED /* Add Heimdal-specific KDC test */ torture_suite_add_suite(suite, torture_rpc_backupkey(suite)); -#endif torture_suite_add_suite(suite, torture_rpc_fsrvp(suite)); torture_suite_add_suite(suite, torture_rpc_clusapi(suite)); torture_suite_add_suite(suite, torture_rpc_witness(suite)); diff --git a/source4/torture/wscript_build b/source4/torture/wscript_build index 5f5203301c5..9231bba6fe7 100755 --- a/source4/torture/wscript_build +++ b/source4/torture/wscript_build @@ -32,12 +32,11 @@ bld.RECURSE('winbind') bld.RECURSE('libnetapi') bld.RECURSE('libsmbclient') -heimdal_specific = dict() -heimdal_specific['ndr'] = ('','') -heimdal_specific['rpc'] = ('','') +heimdal_specific = dict(source='', deps='') + if bld.CONFIG_SET('AD_DC_BUILD_IS_ENABLED'): - heimdal_specific['rpc'] = (' rpc/backupkey.c rpc/spoolss_notify.c', - ' RPC_NDR_BACKUPKEY SMB_SERVER dcerpc_server ntvfs') + heimdal_specific['source'] += ' rpc/spoolss_notify.c' + heimdal_specific['deps'] += ' SMB_SERVER dcerpc_server ntvfs' bld.SAMBA_SUBSYSTEM('TORTURE_NDR', source='ndr/ndr.c ndr/winreg.c ndr/atsvc.c ndr/lsa.c ndr/epmap.c ndr/dfs.c ndr/netlogon.c ndr/drsuapi.c ndr/spoolss.c ndr/ntprinting.c ndr/samr.c ndr/dfsblob.c ndr/drsblobs.c ndr/nbt.c ndr/ntlmssp.c ndr/string.c ndr/backupkey.c ndr/witness.c', @@ -61,7 +60,6 @@ bld.SAMBA_MODULE('torture_rpc', rpc/spoolss.c rpc/spoolss_win.c rpc/spoolss_access.c - rpc/spoolss_notify.c rpc/unixinfo.c rpc/samr.c rpc/samr_accessmask.c @@ -100,7 +98,9 @@ bld.SAMBA_MODULE('torture_rpc', rpc/bind.c rpc/fsrvp.c rpc/clusapi.c - rpc/witness.c''' + heimdal_specific['rpc'][0], + rpc/witness.c + rpc/backupkey.c + ''' + heimdal_specific['source'], autoproto='rpc/proto.h', subsystem='smbtorture', init_function='torture_rpc_init', @@ -145,7 +145,8 @@ bld.SAMBA_MODULE('torture_rpc', RPC_NDR_FSRVP RPC_NDR_CLUSAPI RPC_NDR_WITNESS - ''' + heimdal_specific['rpc'][1], + RPC_NDR_BACKUPKEY + ''' + heimdal_specific['deps'], internal_module=True) bld.RECURSE('drs') -- 2.11.4.GIT