[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/12] tests: remove QCRYPTO_HAVE_TLS_TEST_SUPPORT
From: |
Paolo Bonzini |
Subject: |
[PULL 05/12] tests: remove QCRYPTO_HAVE_TLS_TEST_SUPPORT |
Date: |
Wed, 23 Jun 2021 14:14:17 +0200 |
meson.build already decides whether it is possible to build the TLS
test suite. There is no need to include that in the source as well.
The dummy tests in fact are broken because they do not produce valid
TAP output (empty output is rejected by scripts/tap-driver.pl).
Cc: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
tests/unit/crypto-tls-psk-helpers.c | 6 ------
tests/unit/crypto-tls-psk-helpers.h | 4 ----
tests/unit/crypto-tls-x509-helpers.c | 4 ----
tests/unit/crypto-tls-x509-helpers.h | 11 +----------
tests/unit/pkix_asn1_tab.c | 3 ---
tests/unit/test-crypto-tlscredsx509.c | 12 ------------
tests/unit/test-crypto-tlssession.c | 12 ------------
tests/unit/test-io-channel-tls.c | 12 ------------
8 files changed, 1 insertion(+), 63 deletions(-)
diff --git a/tests/unit/crypto-tls-psk-helpers.c
b/tests/unit/crypto-tls-psk-helpers.c
index a8395477c3..7f8a488961 100644
--- a/tests/unit/crypto-tls-psk-helpers.c
+++ b/tests/unit/crypto-tls-psk-helpers.c
@@ -20,14 +20,10 @@
#include "qemu/osdep.h"
-/* Include this first because it defines QCRYPTO_HAVE_TLS_TEST_SUPPORT */
#include "crypto-tls-x509-helpers.h"
-
#include "crypto-tls-psk-helpers.h"
#include "qemu/sockets.h"
-#ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
-
void test_tls_psk_init(const char *pskfile)
{
FILE *fp;
@@ -46,5 +42,3 @@ void test_tls_psk_cleanup(const char *pskfile)
{
unlink(pskfile);
}
-
-#endif /* QCRYPTO_HAVE_TLS_TEST_SUPPORT */
diff --git a/tests/unit/crypto-tls-psk-helpers.h
b/tests/unit/crypto-tls-psk-helpers.h
index 5aa9951cb6..faa645c629 100644
--- a/tests/unit/crypto-tls-psk-helpers.h
+++ b/tests/unit/crypto-tls-psk-helpers.h
@@ -23,11 +23,7 @@
#include <gnutls/gnutls.h>
-#ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
-
void test_tls_psk_init(const char *keyfile);
void test_tls_psk_cleanup(const char *keyfile);
-#endif /* QCRYPTO_HAVE_TLS_TEST_SUPPORT */
-
#endif
diff --git a/tests/unit/crypto-tls-x509-helpers.c
b/tests/unit/crypto-tls-x509-helpers.c
index 97658592a2..fc609b3fd4 100644
--- a/tests/unit/crypto-tls-x509-helpers.c
+++ b/tests/unit/crypto-tls-x509-helpers.c
@@ -24,8 +24,6 @@
#include "crypto/init.h"
#include "qemu/sockets.h"
-#ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
-
/*
* This stores some static data that is needed when
* encoding extensions in the x509 certs
@@ -504,5 +502,3 @@ void test_tls_discard_cert(QCryptoTLSTestCertReq *req)
unlink(req->filename);
}
}
-
-#endif /* QCRYPTO_HAVE_TLS_TEST_SUPPORT */
diff --git a/tests/unit/crypto-tls-x509-helpers.h
b/tests/unit/crypto-tls-x509-helpers.h
index 8fcd7785ab..cf6329e653 100644
--- a/tests/unit/crypto-tls-x509-helpers.h
+++ b/tests/unit/crypto-tls-x509-helpers.h
@@ -23,14 +23,7 @@
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
-
-#if !(defined WIN32) && \
- defined(CONFIG_TASN1)
-# define QCRYPTO_HAVE_TLS_TEST_SUPPORT
-#endif
-
-#ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
-# include <libtasn1.h>
+#include <libtasn1.h>
/*
@@ -127,6 +120,4 @@ void test_tls_cleanup(const char *keyfile);
extern const asn1_static_node pkix_asn1_tab[];
-#endif /* QCRYPTO_HAVE_TLS_TEST_SUPPORT */
-
#endif
diff --git a/tests/unit/pkix_asn1_tab.c b/tests/unit/pkix_asn1_tab.c
index 15397cf77a..89521408a1 100644
--- a/tests/unit/pkix_asn1_tab.c
+++ b/tests/unit/pkix_asn1_tab.c
@@ -6,8 +6,6 @@
#include "qemu/osdep.h"
#include "crypto-tls-x509-helpers.h"
-#ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
-
const asn1_static_node pkix_asn1_tab[] = {
{"PKIX1", 536875024, 0},
{0, 1073741836, 0},
@@ -1105,4 +1103,3 @@ const asn1_static_node pkix_asn1_tab[] = {
{0, 1048586, "2"},
{0, 0, 0}
};
-#endif /* QCRYPTO_HAVE_TLS_TEST_SUPPORT */
diff --git a/tests/unit/test-crypto-tlscredsx509.c
b/tests/unit/test-crypto-tlscredsx509.c
index f487349c32..aab4149b56 100644
--- a/tests/unit/test-crypto-tlscredsx509.c
+++ b/tests/unit/test-crypto-tlscredsx509.c
@@ -25,8 +25,6 @@
#include "qapi/error.h"
#include "qemu/module.h"
-#ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
-
#define WORKDIR "tests/test-crypto-tlscredsx509-work/"
#define KEYFILE WORKDIR "key-ctx.pem"
@@ -706,13 +704,3 @@ int main(int argc, char **argv)
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
-
-#else /* ! QCRYPTO_HAVE_TLS_TEST_SUPPORT */
-
-int
-main(void)
-{
- return EXIT_SUCCESS;
-}
-
-#endif /* ! QCRYPTO_HAVE_TLS_TEST_SUPPORT */
diff --git a/tests/unit/test-crypto-tlssession.c
b/tests/unit/test-crypto-tlssession.c
index 8b2453fa79..5f0da9192c 100644
--- a/tests/unit/test-crypto-tlssession.c
+++ b/tests/unit/test-crypto-tlssession.c
@@ -31,8 +31,6 @@
#include "qemu/sockets.h"
#include "authz/list.h"
-#ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
-
#define WORKDIR "tests/test-crypto-tlssession-work/"
#define PSKFILE WORKDIR "keys.psk"
#define KEYFILE WORKDIR "key-ctx.pem"
@@ -648,13 +646,3 @@ int main(int argc, char **argv)
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
-
-#else /* ! QCRYPTO_HAVE_TLS_TEST_SUPPORT */
-
-int
-main(void)
-{
- return EXIT_SUCCESS;
-}
-
-#endif /* ! QCRYPTO_HAVE_TLS_TEST_SUPPORT */
diff --git a/tests/unit/test-io-channel-tls.c b/tests/unit/test-io-channel-tls.c
index ad7554c534..f6fb988c01 100644
--- a/tests/unit/test-io-channel-tls.c
+++ b/tests/unit/test-io-channel-tls.c
@@ -34,8 +34,6 @@
#include "authz/list.h"
#include "qom/object_interfaces.h"
-#ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
-
#define WORKDIR "tests/test-io-channel-tls-work/"
#define KEYFILE WORKDIR "key-ctx.pem"
@@ -334,13 +332,3 @@ int main(int argc, char **argv)
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
-
-#else /* ! QCRYPTO_HAVE_TLS_TEST_SUPPORT */
-
-int
-main(void)
-{
- return EXIT_SUCCESS;
-}
-
-#endif /* ! QCRYPTO_HAVE_TLS_TEST_SUPPORT */
--
2.31.1
- [PULL 00/12] Misc, mostly meson patches for 2021-06-23, Paolo Bonzini, 2021/06/23
- [PULL 03/12] configure: drop unused variables for xts, Paolo Bonzini, 2021/06/23
- [PULL 04/12] meson: remove preadv from summary, Paolo Bonzini, 2021/06/23
- [PULL 05/12] tests: remove QCRYPTO_HAVE_TLS_TEST_SUPPORT,
Paolo Bonzini <=
- [PULL 09/12] configure, meson: convert libusb detection to meson, Paolo Bonzini, 2021/06/23
- [PULL 02/12] meson: drop unused CONFIG_GCRYPT_HMAC, Paolo Bonzini, 2021/06/23
- [PULL 01/12] target/i386: kvm: add support for TSC scaling, Paolo Bonzini, 2021/06/23
- [PULL 07/12] configure, meson: convert libtasn1 detection to meson, Paolo Bonzini, 2021/06/23
- [PULL 08/12] configure, meson: convert pam detection to meson, Paolo Bonzini, 2021/06/23
- [PULL 06/12] configure, meson: convert crypto detection to meson, Paolo Bonzini, 2021/06/23
- [PULL 10/12] configure, meson: convert libcacard detection to meson, Paolo Bonzini, 2021/06/23
- [PULL 11/12] configure, meson: convert libusbredir detection to meson, Paolo Bonzini, 2021/06/23