Skip to content

Commit 4c1f23c

Browse files
committed
tests: remove QCRYPTO_HAVE_TLS_TEST_SUPPORT
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é <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 72150df commit 4c1f23c

8 files changed

+1
-63
lines changed

tests/unit/crypto-tls-psk-helpers.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,10 @@
2020

2121
#include "qemu/osdep.h"
2222

23-
/* Include this first because it defines QCRYPTO_HAVE_TLS_TEST_SUPPORT */
2423
#include "crypto-tls-x509-helpers.h"
25-
2624
#include "crypto-tls-psk-helpers.h"
2725
#include "qemu/sockets.h"
2826

29-
#ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
30-
3127
void test_tls_psk_init(const char *pskfile)
3228
{
3329
FILE *fp;
@@ -46,5 +42,3 @@ void test_tls_psk_cleanup(const char *pskfile)
4642
{
4743
unlink(pskfile);
4844
}
49-
50-
#endif /* QCRYPTO_HAVE_TLS_TEST_SUPPORT */

tests/unit/crypto-tls-psk-helpers.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@
2323

2424
#include <gnutls/gnutls.h>
2525

26-
#ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
27-
2826
void test_tls_psk_init(const char *keyfile);
2927
void test_tls_psk_cleanup(const char *keyfile);
3028

31-
#endif /* QCRYPTO_HAVE_TLS_TEST_SUPPORT */
32-
3329
#endif

tests/unit/crypto-tls-x509-helpers.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
#include "crypto/init.h"
2525
#include "qemu/sockets.h"
2626

27-
#ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
28-
2927
/*
3028
* This stores some static data that is needed when
3129
* encoding extensions in the x509 certs
@@ -504,5 +502,3 @@ void test_tls_discard_cert(QCryptoTLSTestCertReq *req)
504502
unlink(req->filename);
505503
}
506504
}
507-
508-
#endif /* QCRYPTO_HAVE_TLS_TEST_SUPPORT */

tests/unit/crypto-tls-x509-helpers.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,7 @@
2323

2424
#include <gnutls/gnutls.h>
2525
#include <gnutls/x509.h>
26-
27-
#if !(defined WIN32) && \
28-
defined(CONFIG_TASN1)
29-
# define QCRYPTO_HAVE_TLS_TEST_SUPPORT
30-
#endif
31-
32-
#ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
33-
# include <libtasn1.h>
26+
#include <libtasn1.h>
3427

3528

3629
/*
@@ -127,6 +120,4 @@ void test_tls_cleanup(const char *keyfile);
127120

128121
extern const asn1_static_node pkix_asn1_tab[];
129122

130-
#endif /* QCRYPTO_HAVE_TLS_TEST_SUPPORT */
131-
132123
#endif

tests/unit/pkix_asn1_tab.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
#include "qemu/osdep.h"
77
#include "crypto-tls-x509-helpers.h"
88

9-
#ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
10-
119
const asn1_static_node pkix_asn1_tab[] = {
1210
{"PKIX1", 536875024, 0},
1311
{0, 1073741836, 0},
@@ -1105,4 +1103,3 @@ const asn1_static_node pkix_asn1_tab[] = {
11051103
{0, 1048586, "2"},
11061104
{0, 0, 0}
11071105
};
1108-
#endif /* QCRYPTO_HAVE_TLS_TEST_SUPPORT */

tests/unit/test-crypto-tlscredsx509.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
#include "qapi/error.h"
2626
#include "qemu/module.h"
2727

28-
#ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
29-
3028
#define WORKDIR "tests/test-crypto-tlscredsx509-work/"
3129
#define KEYFILE WORKDIR "key-ctx.pem"
3230

@@ -706,13 +704,3 @@ int main(int argc, char **argv)
706704

707705
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
708706
}
709-
710-
#else /* ! QCRYPTO_HAVE_TLS_TEST_SUPPORT */
711-
712-
int
713-
main(void)
714-
{
715-
return EXIT_SUCCESS;
716-
}
717-
718-
#endif /* ! QCRYPTO_HAVE_TLS_TEST_SUPPORT */

tests/unit/test-crypto-tlssession.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
#include "qemu/sockets.h"
3232
#include "authz/list.h"
3333

34-
#ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
35-
3634
#define WORKDIR "tests/test-crypto-tlssession-work/"
3735
#define PSKFILE WORKDIR "keys.psk"
3836
#define KEYFILE WORKDIR "key-ctx.pem"
@@ -648,13 +646,3 @@ int main(int argc, char **argv)
648646

649647
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
650648
}
651-
652-
#else /* ! QCRYPTO_HAVE_TLS_TEST_SUPPORT */
653-
654-
int
655-
main(void)
656-
{
657-
return EXIT_SUCCESS;
658-
}
659-
660-
#endif /* ! QCRYPTO_HAVE_TLS_TEST_SUPPORT */

tests/unit/test-io-channel-tls.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
#include "authz/list.h"
3535
#include "qom/object_interfaces.h"
3636

37-
#ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
38-
3937
#define WORKDIR "tests/test-io-channel-tls-work/"
4038
#define KEYFILE WORKDIR "key-ctx.pem"
4139

@@ -334,13 +332,3 @@ int main(int argc, char **argv)
334332

335333
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
336334
}
337-
338-
#else /* ! QCRYPTO_HAVE_TLS_TEST_SUPPORT */
339-
340-
int
341-
main(void)
342-
{
343-
return EXIT_SUCCESS;
344-
}
345-
346-
#endif /* ! QCRYPTO_HAVE_TLS_TEST_SUPPORT */

0 commit comments

Comments
 (0)