Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 135 additions & 0 deletions .github/workflows/qt5network5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
name: qtbase Network Tests
on:
push:
branches: [ 'master', 'main', 'release/**', 'qt5network5' ]
pull_request:
branches: [ '*' ]

concurrency:
Comment thread
JeremiahM37 marked this conversation as resolved.
Outdated
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build_wolfprovider:
uses: ./.github/workflows/build-wolfprovider.yml
with:
wolfssl_ref: ${{ matrix.wolfssl_ref }}
openssl_ref: ${{ matrix.openssl_ref }}
strategy:
matrix:
wolfssl_ref: [ 'master', 'v5.8.0-stable' ]
openssl_ref: [ 'openssl-3.5.0' ]

test_qtbase_network:
runs-on: ubuntu-22.04
needs: build_wolfprovider
timeout-minutes: 30
strategy:
matrix:
wolfssl_ref: [ 'master', 'v5.8.0-stable' ]
openssl_ref: [ 'openssl-3.5.0' ]
qt_ref: [ 'dev', 'v5.15.8-lts-lgpl' ]
force_fail: [ 'WOLFPROV_FORCE_FAIL=1', '' ]
exclude:
- qt_ref: 'dev'
force_fail: 'WOLFPROV_FORCE_FAIL=1'
steps:
- name: Checkout wolfProvider
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Retrieving wolfSSL/wolfProvider from cache
uses: actions/cache/restore@v4
id: wolfprov-cache
with:
path: |
wolfssl-install
wolfprov-install
openssl-install/lib64
openssl-install/include
openssl-install/bin
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ matrix.openssl_ref }}-${{ github.sha }}
fail-on-cache-miss: true

- name: Install Qt dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential pkg-config \
python3 perl libpcre2-dev zlib1g-dev cmake ninja-build

- name: Checkout Qt
uses: actions/checkout@v4
with:
repository: qt/qtbase
path: qt5_repo
ref: ${{ matrix.qt_ref }}
fetch-depth: 1

- name: Configure Qt
working-directory: qt5_repo
run: |
# Set up the environment for wolfProvider
source $GITHUB_WORKSPACE/scripts/env-setup

# Configure Qt with GUI support to avoid test dependency issues
# Build with GUI support but skip examples and DBus
./configure -opensource -confirm-license -developer-build \
-nomake examples -no-dbus -no-opengl \
-openssl-linked
Comment thread
JeremiahM37 marked this conversation as resolved.
Outdated

- name: Build Qt (dev version - CMake)
if: matrix.qt_ref == 'dev'
working-directory: qt5_repo
run: |
# Build the OpenSSL TLS backend plugin first
ninja QTlsBackendOpenSSLPlugin

#hard loads to wolfProvider instead.
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
Comment thread
padelsbach marked this conversation as resolved.
Outdated

#Remove legacy loading
perl -pi -e 's/CASE\(Md4, "MD4"\);/CASE(Md4, nullptr);/g;' src/corelib/tools/qcryptographichash.cpp

# Build only the SSL test and its dependencies
cmake --build . --target tst_qsslsocket --parallel $(nproc)

- name: Build Qt (v5.15.8 - qmake)
if: matrix.qt_ref != 'dev'
working-directory: qt5_repo
run: |
# Force C++14 to avoid C++17 compatibility issues
echo 'QMAKE_CXXFLAGS += -std=c++14' >> mkspecs/linux-g++/qmake.conf

make -k -j$(nproc)
Comment thread
padelsbach marked this conversation as resolved.
Outdated

- name: Add test server to hosts
run: |
sudo sh -c 'echo "127.0.0.1 qt-test-server.qt-test-net" >> /etc/hosts'

- name: Run QSSLSocket test
working-directory: qt5_repo
run: |
# Set up the environment for wolfProvider
source $GITHUB_WORKSPACE/scripts/env-setup
export ${{ matrix.force_fail }}

# Run the QSSLSocket test, the make check takes too long
./tests/auto/network/ssl/qsslsocket/tst_qsslsocket 2>&1 | tee qsslsocket-test.log

# Make sure it passes the same number of tests as openssl
if [ "${{ matrix.qt_ref }}" == "dev" ]; then
EXPECTED_TESTS=549
Comment thread
padelsbach marked this conversation as resolved.
Outdated
else
EXPECTED_TESTS=521
fi

# Check test results
if grep -q "$EXPECTED_TESTS passed" qsslsocket-test.log; then
TEST_RESULT=0
else
TEST_RESULT=1
echo "Expected $EXPECTED_TESTS tests to pass, but results don't match expected counts"
fi

$GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} qtbase-qsslsocket
Loading