diff options
author | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2021-06-01 14:47:35 +0200 |
---|---|---|
committer | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2021-06-09 20:55:49 +0200 |
commit | 6998ed4c96cfd56d2265e4e748b30a95a2f3d723 (patch) | |
tree | c34193d1e5cc7a944b8c664f3ab68571cc6b5d41 /tests/auto/network/ssl/qocsp/tst_qocsp.cpp | |
parent | 5b78d7fdcf9b758f117eaa65dc5eeddd0d4557e0 (diff) |
Introduce a mini-version of qsslsocket_openssl_symbols_p.h/.cpp
For auto-tests that were temporarily disabled. Similar to
network-settings.h, header-only stuff.
Fixes: QTBUG-92866
Fixes: QTBUG-92877
Change-Id: I15b5c0b41f0d8bfe59b09c844884ff6d99e6d41a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'tests/auto/network/ssl/qocsp/tst_qocsp.cpp')
-rw-r--r-- | tests/auto/network/ssl/qocsp/tst_qocsp.cpp | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/tests/auto/network/ssl/qocsp/tst_qocsp.cpp b/tests/auto/network/ssl/qocsp/tst_qocsp.cpp index 5c28f5a8ec..1b48b59534 100644 --- a/tests/auto/network/ssl/qocsp/tst_qocsp.cpp +++ b/tests/auto/network/ssl/qocsp/tst_qocsp.cpp @@ -31,7 +31,10 @@ #include <QtNetwork/private/qtnetworkglobal_p.h> +#include "../shared/qopenssl_symbols.h" + #include <QtNetwork/qsslcertificate.h> +#include <QtNetwork/qocspresponse.h> #include <QtNetwork/qtcpserver.h> #include <QtNetwork/qsslerror.h> #include <QtNetwork/qsslkey.h> @@ -64,9 +67,6 @@ QT_BEGIN_NAMESPACE namespace { -// TLSTODO: the test is temporarily disabled due to openssl code -// moved into plugin and not in QtNetwork anymore. -#if 0 using OcspResponse = QSharedPointer<OCSP_RESPONSE>; using BasicResponse = QSharedPointer<OCSP_BASICRESP>; using SingleResponse = QSharedPointer<OCSP_SINGLERESP>; @@ -74,10 +74,6 @@ using CertId = QSharedPointer<OCSP_CERTID>; using EvpKey = QSharedPointer<EVP_PKEY>; using Asn1Time = QSharedPointer<ASN1_TIME>; using CertificateChain = QList<QSslCertificate>; - -// TLSTODO: test temporarily disabled due to openssl code moved -// into plugin and not in QtNetwork anymore. - using NativeX509Ptr = X509 *; class X509Stack { @@ -376,16 +372,11 @@ void OcspServer::incomingConnection(qintptr socketDescriptor) serverSocket.startServerEncryption(); } -#endif // if 0 - } // unnamed namespace class tst_QOcsp : public QObject { Q_OBJECT -// TLSTODO: test temporarily disabled due to openssl code moved -// into plugin and not in QtNetwork anymore. -#if 0 public slots: void initTestCase(); @@ -434,7 +425,6 @@ private: QSslError::OcspResponseCertIdUnknown, QSslError::OcspResponseExpired, QSslError::OcspStatusUnknown}; -#endif // if 0 }; #define QCOMPARE_SINGLE_ERROR(sslSocket, expectedError) \ @@ -455,14 +445,17 @@ private: QSslKey key; \ QVERIFY(loadPrivateKey(QLatin1String(keyFileName), key)) -// TLSTODO: test temporarily disabled due to openssl code moved -// into plugin and not in QtNetwork anymore. -#if 0 QString tst_QOcsp::certDirPath; void tst_QOcsp::initTestCase() { - QVERIFY(QSslSocket::supportsSsl()); + // I'm not testing feature here, I need 'openssl', since the test + // is very OpenSSL-oriented: + if (QSslSocket::activeBackend() != QStringLiteral("openssl")) + QSKIP("This test requires the OpenSSL backend"); + + if (!qt_auto_test_resolve_OpenSSL_symbols()) + QSKIP("Failed to resolve OpenSSL symbols required by this test"); certDirPath = QFileInfo(QFINDTESTDATA("certs")).absolutePath(); QVERIFY(certDirPath.size() > 0); @@ -839,8 +832,6 @@ CertificateChain tst_QOcsp::subjectToChain(const CertificateChain &chain) return CertificateChain() << chain[0]; } -#endif // if 0 - QT_END_NAMESPACE QTEST_MAIN(tst_QOcsp) |