|
| 1 | +name: qtbase Network Tests |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: [ 'master', 'main', 'release/**', 'qt5network5' ] |
| 5 | + pull_request: |
| 6 | + branches: [ '*' ] |
| 7 | + |
| 8 | +concurrency: |
| 9 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 10 | + cancel-in-progress: true |
| 11 | + |
| 12 | +jobs: |
| 13 | + build_wolfprovider: |
| 14 | + uses: ./.github/workflows/build-wolfprovider.yml |
| 15 | + with: |
| 16 | + wolfssl_ref: ${{ matrix.wolfssl_ref }} |
| 17 | + openssl_ref: ${{ matrix.openssl_ref }} |
| 18 | + strategy: |
| 19 | + matrix: |
| 20 | + wolfssl_ref: [ 'master', 'v5.8.0-stable' ] |
| 21 | + openssl_ref: [ 'openssl-3.5.0' ] |
| 22 | + |
| 23 | + test_qtbase_network: |
| 24 | + runs-on: ubuntu-22.04 |
| 25 | + needs: build_wolfprovider |
| 26 | + timeout-minutes: 30 |
| 27 | + strategy: |
| 28 | + matrix: |
| 29 | + wolfssl_ref: [ 'master', 'v5.8.0-stable' ] |
| 30 | + openssl_ref: [ 'openssl-3.5.0' ] |
| 31 | + qt_ref: [ 'dev', 'v5.15.8-lts-lgpl' ] |
| 32 | + force_fail: [ 'WOLFPROV_FORCE_FAIL=1', '' ] |
| 33 | + exclude: |
| 34 | + - qt_ref: 'dev' |
| 35 | + force_fail: 'WOLFPROV_FORCE_FAIL=1' |
| 36 | + steps: |
| 37 | + - name: Checkout wolfProvider |
| 38 | + uses: actions/checkout@v4 |
| 39 | + with: |
| 40 | + fetch-depth: 1 |
| 41 | + |
| 42 | + - name: Retrieving wolfSSL/wolfProvider from cache |
| 43 | + uses: actions/cache/restore@v4 |
| 44 | + id: wolfprov-cache |
| 45 | + with: |
| 46 | + path: | |
| 47 | + wolfssl-install |
| 48 | + wolfprov-install |
| 49 | + openssl-install/lib64 |
| 50 | + openssl-install/include |
| 51 | + openssl-install/bin |
| 52 | + key: wolfprov-${{ matrix.wolfssl_ref }}-${{ matrix.openssl_ref }}-${{ github.sha }} |
| 53 | + fail-on-cache-miss: true |
| 54 | + |
| 55 | + - name: Install Qt dependencies |
| 56 | + run: | |
| 57 | + sudo apt-get update |
| 58 | + sudo apt-get install -y build-essential pkg-config \ |
| 59 | + python3 perl libpcre2-dev zlib1g-dev cmake ninja-build |
| 60 | + |
| 61 | + - name: Checkout Qt |
| 62 | + uses: actions/checkout@v4 |
| 63 | + with: |
| 64 | + repository: qt/qtbase |
| 65 | + path: qt5_repo |
| 66 | + ref: ${{ matrix.qt_ref }} |
| 67 | + fetch-depth: 1 |
| 68 | + |
| 69 | + - name: Configure Qt |
| 70 | + working-directory: qt5_repo |
| 71 | + run: | |
| 72 | + # Set up the environment for wolfProvider |
| 73 | + source $GITHUB_WORKSPACE/scripts/env-setup |
| 74 | + |
| 75 | + # Configure Qt with GUI support to avoid test dependency issues |
| 76 | + # Build with GUI support but skip examples and DBus |
| 77 | + ./configure -opensource -confirm-license -developer-build \ |
| 78 | + -nomake examples -no-dbus -no-opengl \ |
| 79 | + -openssl-linked |
| 80 | +
|
| 81 | + - name: Build Qt (dev version - CMake) |
| 82 | + if: matrix.qt_ref == 'dev' |
| 83 | + working-directory: qt5_repo |
| 84 | + run: | |
| 85 | + # Build the OpenSSL TLS backend plugin first |
| 86 | + ninja QTlsBackendOpenSSLPlugin |
| 87 | + |
| 88 | + #hard loads to wolfProvider instead. |
| 89 | + perl -pi -e 's/defaultProvider/wolfProvider/g; s/legacyProvider/wolfProvider/g; s/OSSL_PROVIDER_load\(nullptr, "default"\)/OSSL_PROVIDER_load(nullptr, "libwolfprov")/g; s/OSSL_PROVIDER_load\(nullptr, "legacy"\)/OSSL_PROVIDER_load(nullptr, "libwolfprov")/g;' src/corelib/tools/qcryptographichash.cpp |
| 90 | +
|
| 91 | + #Remove legacy loading |
| 92 | + perl -pi -e 's/CASE\(Md4, "MD4"\);/CASE(Md4, nullptr);/g;' src/corelib/tools/qcryptographichash.cpp |
| 93 | +
|
| 94 | + # Build only the SSL test and its dependencies |
| 95 | + cmake --build . --target tst_qsslsocket --parallel $(nproc) |
| 96 | + |
| 97 | + - name: Build Qt (v5.15.8 - qmake) |
| 98 | + if: matrix.qt_ref != 'dev' |
| 99 | + working-directory: qt5_repo |
| 100 | + run: | |
| 101 | + # Force C++14 to avoid C++17 compatibility issues |
| 102 | + echo 'QMAKE_CXXFLAGS += -std=c++14' >> mkspecs/linux-g++/qmake.conf |
| 103 | + |
| 104 | + make -k -j$(nproc) |
| 105 | + |
| 106 | + - name: Add test server to hosts |
| 107 | + run: | |
| 108 | + sudo sh -c 'echo "127.0.0.1 qt-test-server.qt-test-net" >> /etc/hosts' |
| 109 | +
|
| 110 | + - name: Run QSSLSocket test |
| 111 | + working-directory: qt5_repo |
| 112 | + run: | |
| 113 | + # Set up the environment for wolfProvider |
| 114 | + source $GITHUB_WORKSPACE/scripts/env-setup |
| 115 | + export ${{ matrix.force_fail }} |
| 116 | + |
| 117 | + # Run the QSSLSocket test, the make check takes too long |
| 118 | + ./tests/auto/network/ssl/qsslsocket/tst_qsslsocket 2>&1 | tee qsslsocket-test.log |
| 119 | + |
| 120 | + # Make sure it passes the same number of tests as openssl |
| 121 | + if [ "${{ matrix.qt_ref }}" == "dev" ]; then |
| 122 | + EXPECTED_TESTS=549 |
| 123 | + else |
| 124 | + EXPECTED_TESTS=521 |
| 125 | + fi |
| 126 | + |
| 127 | + # Check test results |
| 128 | + if grep -q "$EXPECTED_TESTS passed" qsslsocket-test.log; then |
| 129 | + TEST_RESULT=0 |
| 130 | + else |
| 131 | + TEST_RESULT=1 |
| 132 | + echo "Expected $EXPECTED_TESTS tests to pass, but results don't match expected counts" |
| 133 | + fi |
| 134 | + |
| 135 | + $GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} qtbase-qsslsocket |
0 commit comments