Skip to content

Commit 8aac150

Browse files
authored
Merge pull request #205 from JeremiahM37/qt5network5
qt5network5 workflow
2 parents 2dff613 + cf43bec commit 8aac150

2 files changed

Lines changed: 173 additions & 0 deletions

File tree

.github/scripts/qtbase/BLACKLIST

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[connectToHostEncrypted:WithoutProxy]
2+
ci
3+
[connectToHostEncryptedWithVerificationPeerName:WithoutProxy]
4+
ci
5+
[sessionCipher:WithoutProxy]
6+
ci
7+
[sessionCipher:WithSocks5Proxy]
8+
ci
9+
[sessionCipher:WithSocks5ProxyAuth]
10+
ci
11+
[sessionCipher:WithHttpProxy]
12+
ci
13+
[sessionCipher:WithHttpProxyBasicAuth]
14+
ci
15+
[protocol:WithoutProxy]
16+
ci
17+
[setSslConfiguration:WithoutProxy:set-root-cert]
18+
ci
19+
[setSslConfiguration:WithoutProxy:secure]
20+
ci
21+
[verifyMode:WithoutProxy]
22+
ci
23+
[resetProxy:WithoutProxy]
24+
ci
25+
[readFromClosedSocket:WithoutProxy]
26+
ci
27+
[forwardReadChannelFinished:WithoutProxy]
28+
ci

.github/workflows/qt5network5.yml

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
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 OSP
62+
uses: actions/checkout@v4
63+
with:
64+
repository: wolfssl/osp
65+
path: osp
66+
fetch-depth: 1
67+
68+
- name: Checkout Qt
69+
uses: actions/checkout@v4
70+
with:
71+
repository: qt/qtbase
72+
path: qt5_repo
73+
ref: ${{ matrix.qt_ref }}
74+
fetch-depth: 1
75+
76+
- name: Configure Qt
77+
working-directory: qt5_repo
78+
run: |
79+
# Set up the environment for wolfProvider
80+
source $GITHUB_WORKSPACE/scripts/env-setup
81+
82+
# Configure Qt with GUI support to avoid test dependency issues
83+
# Build with GUI support but skip examples and DBus
84+
./configure -opensource -confirm-license -developer-build \
85+
-nomake examples -no-dbus -no-opengl \
86+
-openssl-linked
87+
88+
- name: Build Qt (dev version - CMake)
89+
if: matrix.qt_ref == 'dev'
90+
working-directory: qt5_repo
91+
run: |
92+
# Apply patch from OSP repo
93+
patch -p1 < $GITHUB_WORKSPACE/osp/wolfProvider/qtbase/qtbase-v6.10-wolfprov.patch
94+
95+
# Build the OpenSSL TLS backend plugin first
96+
ninja QTlsBackendOpenSSLPlugin
97+
98+
# Build only the SSL test and its dependencies
99+
cmake --build . --target tst_qsslsocket --parallel $(nproc)
100+
101+
#disable tests that both openssl and wolfprovider fail
102+
cp $GITHUB_WORKSPACE/.github/scripts/qtbase/BLACKLIST tests/auto/network/ssl/qsslsocket/BLACKLIST
103+
104+
- name: Build Qt (v5.15.8 - qmake)
105+
if: matrix.qt_ref != 'dev'
106+
working-directory: qt5_repo
107+
run: |
108+
# Force C++14 to avoid C++17 compatibility issues
109+
echo 'QMAKE_CXXFLAGS += -std=c++14' >> mkspecs/linux-g++/qmake.conf
110+
111+
make -k -j$(nproc)
112+
113+
- name: Add test server to hosts
114+
run: |
115+
sudo sh -c 'echo "127.0.0.1 qt-test-server.qt-test-net" >> /etc/hosts'
116+
117+
- name: Run QSSLSocket test
118+
working-directory: qt5_repo
119+
run: |
120+
# Set up the environment for wolfProvider
121+
source $GITHUB_WORKSPACE/scripts/env-setup
122+
export ${{ matrix.force_fail }}
123+
124+
# Run the QSSLSocket test, the make check takes too long
125+
QTEST_ENVIRONMENT=ci ./tests/auto/network/ssl/qsslsocket/tst_qsslsocket 2>&1 | tee qsslsocket-test.log
126+
127+
# Check test results based on qt_ref
128+
if [[ "${{ matrix.qt_ref }}" == "dev" ]]; then
129+
if grep -q "0 failed" qsslsocket-test.log; then
130+
TEST_RESULT=0
131+
else
132+
TEST_RESULT=1
133+
echo "Tests failed unexpectedly for 'dev' branch."
134+
fi
135+
else
136+
#No easy way to disable tests in v5.15.8. Both openssl and wolfprovider should always pass 521 tests on this version though
137+
if grep -q "521 passed" qsslsocket-test.log; then
138+
TEST_RESULT=0
139+
else
140+
TEST_RESULT=1
141+
echo "Tests failed unexpectedly for 'v5.15.8-lts-lgpl' branch."
142+
fi
143+
fi
144+
145+
$GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} qtbase-qsslsocket

0 commit comments

Comments
 (0)