]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove tkey_test (which is no-op anyway)
authorOndřej Surý <ondrej@sury.org>
Wed, 12 Feb 2020 13:15:10 +0000 (14:15 +0100)
committerOndřej Surý <ondrej@sury.org>
Wed, 12 Feb 2020 14:04:17 +0000 (15:04 +0100)
lib/dns/tests/Kyuafile
lib/dns/tests/Makefile.in
lib/dns/tests/tkey_test.c [deleted file]
util/copyrights

index d8e2109f37c503d66eadb9e628151ba3ee5194b0..a3066a6175b6a8ef2605c1dfa37f675f7c050113 100644 (file)
@@ -27,7 +27,6 @@ tap_test_program{name='result_test'}
 tap_test_program{name='rsa_test'}
 tap_test_program{name='sigs_test'}
 tap_test_program{name='time_test'}
-tap_test_program{name='tkey_test'}
 tap_test_program{name='tsig_test'}
 tap_test_program{name='update_test'}
 tap_test_program{name='zonemgr_test'}
index 4eb452d36c9da7279463575e07ab98ebaa036c41..8d03a7801b2bd3d180e297f0c3cd996ca2fd6099 100644 (file)
@@ -53,7 +53,6 @@ SRCS =                acl_test.c \
                rsa_test.c \
                sigs_test.c \
                time_test.c \
-               tkey_test.c \
                tsig_test.c \
                update_test.c \
                zonemgr_test.c \
@@ -86,7 +85,6 @@ TARGETS =     acl_test@EXEEXT@ \
                rsa_test@EXEEXT@ \
                sigs_test@EXEEXT@ \
                time_test@EXEEXT@ \
-               tkey_test@EXEEXT@ \
                tsig_test@EXEEXT@ \
                update_test@EXEEXT@ \
                zonemgr_test@EXEEXT@ \
@@ -241,12 +239,6 @@ WRAP_OPTIONS = \
        -Wl,--wrap=isc_mem_detach \
        -Wl,--wrap=isc__mem_putanddetach
 
-tkey_test@EXEEXT@: tkey_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
-       if test "${LD_WRAP_TESTS}" = true; then WRAP="${WRAP_OPTIONS}"; fi; \
-       ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} \
-                       ${LDFLAGS} $${WRAP} -o $@ tkey_test.@O@ \
-                       ${DNSLIBS} ${ISCLIBS} ${LIBS}
-
 tsig_test@EXEEXT@: tsig_test.@O@ dnstest.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
        ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} \
                ${LDFLAGS} -o $@ tsig_test.@O@ dnstest.@O@ \
diff --git a/lib/dns/tests/tkey_test.c b/lib/dns/tests/tkey_test.c
deleted file mode 100644 (file)
index 9c7d754..0000000
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-#if HAVE_CMOCKA
-
-#include <sched.h> /* IWYU pragma: keep */
-#include <setjmp.h>
-#include <stdarg.h>
-#include <stdbool.h>
-#include <stddef.h>
-#include <stdlib.h>
-
-#define UNIT_TESTING
-#include <cmocka.h>
-
-#include <isc/mem.h>
-#include <isc/result.h>
-#include <isc/util.h>
-
-#include <dns/tkey.h>
-
-#if defined(USE_LIBTOOL) || LD_WRAP
-static isc_mem_t mock_mctx = { .impmagic = 0,
-                              .magic = ISCAPI_MCTX_MAGIC,
-                              .methods = NULL };
-
-void *
-__wrap_isc__mem_get(isc_mem_t *mctx, size_t size);
-void
-__wrap_isc__mem_put(isc_mem_t *ctx0, void *ptr, size_t size);
-void
-__wrap_isc_mem_attach(isc_mem_t *source0, isc_mem_t **targetp);
-void
-__wrap_isc_mem_detach(isc_mem_t **ctxp);
-void
-__wrap_isc__mem_putanddetach(isc_mem_t **ctxp, void *ptr, size_t size);
-
-void *
-__wrap_isc__mem_get(isc_mem_t *mctx, size_t size)
-{
-       bool has_enough_memory = mock_type(bool);
-
-       UNUSED(mctx);
-
-       mock_assert(has_enough_memory, "mock isc_mem_get failed", __FILE__,
-                   __LINE__);
-
-       /* cppcheck-suppress leakNoVarFunctionCall */
-       return (malloc(size));
-}
-
-void
-__wrap_isc__mem_put(isc_mem_t *ctx0, void *ptr, size_t size)
-{
-       UNUSED(ctx0);
-       UNUSED(size);
-
-       free(ptr);
-}
-
-void
-__wrap_isc_mem_attach(isc_mem_t *source0, isc_mem_t **targetp)
-{
-       *targetp = source0;
-}
-
-void
-__wrap_isc_mem_detach(isc_mem_t **ctxp)
-{
-       *ctxp = NULL;
-}
-
-void
-__wrap_isc__mem_putanddetach(isc_mem_t **ctxp, void *ptr, size_t size)
-{
-       isc_mem_t *ctx = *ctxp;
-       __wrap_isc__mem_put(ctx, ptr, size);
-       __wrap_isc_mem_detach(ctxp);
-}
-
-#ifdef USE_LIBTOOL
-#if ISC_MEM_TRACKLINES
-#define FLARG , const char *file, unsigned int line
-#else
-#define FLARG
-#endif
-
-void *
-isc__mem_get(isc_mem_t *mctx, size_t size FLARG)
-{
-       UNUSED(file);
-       UNUSED(line);
-       return (__wrap_isc__mem_get(mctx, size));
-}
-
-void
-isc__mem_put(isc_mem_t *ctx0, void *ptr, size_t size FLARG)
-{
-       UNUSED(file);
-       UNUSED(line);
-       __wrap_isc__mem_put(ctx0, ptr, size);
-}
-
-void
-isc_mem_attach(isc_mem_t *source0, isc_mem_t **targetp)
-{
-       __wrap_isc_mem_attach(source0, targetp);
-}
-
-void
-isc_mem_detach(isc_mem_t **ctxp)
-{
-       __wrap_isc_mem_detach(ctxp);
-}
-
-void
-isc__mem_putanddetach(isc_mem_t **ctxp, void *ptr, size_t size FLARG)
-{
-       UNUSED(file);
-       UNUSED(line);
-       __wrap_isc__mem_putanddetach(ctxp, ptr, size);
-}
-#endif /* USE_LIBTOOL */
-
-static int
-_setup(void **state)
-{
-       dns_tkeyctx_t *tctx = NULL;
-       will_return(__wrap_isc__mem_get, true);
-       if (dns_tkeyctx_create(&mock_mctx, &tctx) != ISC_R_SUCCESS) {
-               return (-1);
-       }
-       *state = tctx;
-       return (0);
-}
-
-static int
-_teardown(void **state)
-{
-       dns_tkeyctx_t *tctx = *state;
-       if (tctx != NULL) {
-               dns_tkeyctx_destroy(&tctx);
-       }
-       return (0);
-}
-
-static void
-dns_tkeyctx_create_test(void **state)
-{
-       dns_tkeyctx_t *tctx;
-
-       tctx = NULL;
-       will_return(__wrap_isc__mem_get, false);
-       expect_assert_failure(dns_tkeyctx_create(&mock_mctx, &tctx));
-
-       tctx = NULL;
-       will_return(__wrap_isc__mem_get, true);
-       assert_int_equal(dns_tkeyctx_create(&mock_mctx, &tctx), ISC_R_SUCCESS);
-       *state = tctx;
-}
-
-static void
-dns_tkeyctx_destroy_test(void **state)
-{
-       dns_tkeyctx_t *tctx = *state;
-
-       assert_non_null(tctx);
-       dns_tkeyctx_destroy(&tctx);
-}
-#endif /* defined(USE_LIBTOOL) || LD_WRAP */
-
-int
-main(void)
-{
-#if defined(USE_LIBTOOL) || LD_WRAP
-       const struct CMUnitTest tkey_tests[] = {
-               cmocka_unit_test_teardown(dns_tkeyctx_create_test, _teardown),
-               cmocka_unit_test_setup(dns_tkeyctx_destroy_test, _setup),
-#if 0 /* not yet */
-               cmocka_unit_test(dns_tkey_processquery_test),
-               cmocka_unit_test(dns_tkey_builddhquery_test),
-               cmocka_unit_test(dns_tkey_buildgssquery_test),
-               cmocka_unit_test(dns_tkey_builddeletequery_test),
-               cmocka_unit_test(dns_tkey_processdhresponse_test),
-               cmocka_unit_test(dns_tkey_processgssresponse_test),
-               cmocka_unit_test(dns_tkey_processdeleteresponse_test),
-               cmocka_unit_test(dns_tkey_gssnegotiate_test),
-#endif
-       };
-       return (cmocka_run_group_tests(tkey_tests, NULL, NULL));
-#else  /* defined(USE_LIBTOOL) || LD_WRAP */
-       print_message("1..0 # Skip tkey_test requires libtool or LD_WRAP\n");
-#endif /* defined(USE_LIBTOOL) || LD_WRAP */
-}
-
-#else /* CMOCKA */
-
-#include <stdio.h>
-
-int
-main(void)
-{
-       printf("1..0 # Skipped: cmocka not available\n");
-       return (0);
-}
-
-#endif /* CMOCKA */
index 9ac4f64dd0ae047d7c86002ba7ce42d9e5f19064..9a22dcca7c587412751a054477a9e3b272088ef1 100644 (file)
 ./lib/dns/tests/testkeys/Kexample.+008+37464.key       X       2018,2019,2020
 ./lib/dns/tests/testkeys/Kexample.+008+37464.private   X       2018,2019,2020
 ./lib/dns/tests/time_test.c                    C       2011,2012,2016,2018,2019,2020
-./lib/dns/tests/tkey_test.c                    C       2018,2019,2020
 ./lib/dns/tests/tsig_test.c                    C       2017,2018,2019,2020
 ./lib/dns/tests/update_test.c                  C       2011,2012,2014,2016,2017,2018,2019,2020
 ./lib/dns/tests/zonemgr_test.c                 C       2011,2012,2013,2015,2016,2018,2019,2020