s4-torture: Make the backupkey test as a noop with MIT Kerberos.
authorAndreas Schneider <asn@samba.org>
Mon, 9 Mar 2015 19:37:45 +0000 (20:37 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 16 Jul 2015 23:38:15 +0000 (01:38 +0200)
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 <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/torture/rpc/backupkey.c
source4/torture/rpc/rpc.c
source4/torture/wscript_build

index c3e990819ec101b2a2316e841d9d7c07d9ecb70e..a3b8aaa9a8db2a3bc642b4872e085b94af593702 100644 (file)
 
 #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;
 }
index 48d75d4703eaa41e9765eee00d2ae52c6ad93de6..e70fac52feecd176bcab16842cef833cb42340d3 100644 (file)
@@ -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));
index 5f5203301c5fc6f87fee3cd9e674039e4fad5120..9231bba6fe7345f55622a7558958bed01096ceba 100755 (executable)
@@ -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')