Skip to content

Commit 27ed748

Browse files
authored
Merge pull request #8504 from rlm2002/msys2
Add MSYS2 build CI test
2 parents aff17b7 + b64f509 commit 27ed748

4 files changed

Lines changed: 51 additions & 7 deletions

File tree

.github/workflows/msys2.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: MSYS2 Build Test
2+
3+
# START OF COMMON SECTION
4+
on:
5+
push:
6+
branches: [ 'master', 'main', 'release/**' ]
7+
pull_request:
8+
branches: [ '*' ]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
# END OF COMMON SECTION
14+
15+
jobs:
16+
msys2:
17+
runs-on: windows-latest
18+
defaults:
19+
run:
20+
shell: msys2 {0}
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
include:
25+
- { sys: ucrt64, compiler: mingw-w64-ucrt-x86_64-gcc }
26+
- { sys: mingw64, compiler: mingw-w64-x86_64-gcc }
27+
- { sys: msys, compiler: gcc }
28+
steps:
29+
- uses: actions/checkout@v3
30+
- uses: msys2/setup-msys2@v2
31+
with:
32+
msystem: ${{ matrix.sys }}
33+
update: true
34+
install: git ${{matrix.compiler}} autotools base-devel autoconf netcat
35+
- name: configure wolfSSL
36+
run: ./autogen.sh && ./configure CFLAGS="-DUSE_CERT_BUFFERS_2048 -DUSE_CERT_BUFFERS_256 -DNO_WRITE_TEMP_FILES"
37+
- name: build wolfSSL
38+
run: make check
39+
- name: Display log
40+
if: always()
41+
run: cat test-suite.log

scripts/ocsp-stapling.test

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,8 @@ generate_port() {
448448
# Generate a random port number
449449
#-------------------------------------------------------------------------#
450450

451-
if [[ "$OSTYPE" == "linux"* ]]; then
451+
if [[ "$OSTYPE" == "linux"* || "$OSTYPE" == "msys"
452+
|| "$OSTYPE" == "cygwin"* ]]; then
452453
port=$(($(od -An -N2 /dev/urandom) % (65535-49512) + 49512))
453454
elif [[ "$OSTYPE" == "darwin"* ]]; then
454455
port=$(($(od -An -N2 /dev/random) % (65535-49512) + 49512))

scripts/ocsp-stapling2.test

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,8 @@ generate_port() {
467467
# Generate a random port number
468468
#-------------------------------------------------------------------------#
469469

470-
if [[ "$OSTYPE" == "linux"* ]]; then
470+
if [[ "$OSTYPE" == "linux"* || "$OSTYPE" == "msys"
471+
|| "$OSTYPE" == "cygwin" ]]; then
471472
port=$(($(od -An -N2 /dev/urandom) % (65535-49512) + 49512))
472473
elif [[ "$OSTYPE" == "darwin"* ]]; then
473474
port=$(($(od -An -N2 /dev/random) % (65535-49512) + 49512))

tests/api.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8242,7 +8242,7 @@ static THREAD_RETURN WOLFSSL_THREAD test_server_loop(void* args)
82428242
if (!sharedCtx)
82438243
wolfSSL_CTX_free(ctx);
82448244

8245-
if (clientfd >= 0)
8245+
if (clientfd != SOCKET_INVALID)
82468246
CloseSocket(clientfd);
82478247

82488248
#ifdef WOLFSSL_TIRTOS
@@ -52614,7 +52614,7 @@ static int test_wolfSSL_BIO(void)
5261452614
ExpectIntEQ((int)BIO_set_mem_eof_return(f_bio1, -1), 0);
5261552615
ExpectIntEQ((int)BIO_set_mem_eof_return(NULL, -1), 0);
5261652616

52617-
ExpectTrue((f1 = XFOPEN(svrCertFile, "rwb")) != XBADFILE);
52617+
ExpectTrue((f1 = XFOPEN(svrCertFile, "rb+")) != XBADFILE);
5261852618
ExpectIntEQ((int)BIO_set_fp(f_bio1, f1, BIO_CLOSE), WOLFSSL_SUCCESS);
5261952619
ExpectIntEQ(BIO_write_filename(f_bio2, testFile),
5262052620
WOLFSSL_SUCCESS);
@@ -52638,7 +52638,7 @@ static int test_wolfSSL_BIO(void)
5263852638
BIO_free(f_bio2);
5263952639
f_bio2 = NULL;
5264052640

52641-
ExpectNotNull(f_bio1 = BIO_new_file(svrCertFile, "rwb"));
52641+
ExpectNotNull(f_bio1 = BIO_new_file(svrCertFile, "rb+"));
5264252642
ExpectIntEQ((int)BIO_set_mem_eof_return(f_bio1, -1), 0);
5264352643
ExpectIntEQ(BIO_read(f_bio1, cert, sizeof(cert)), sizeof(cert));
5264452644
BIO_free(f_bio1);
@@ -55290,7 +55290,7 @@ static int test_wc_ERR_print_errors_fp(void)
5529055290
XFILE fp = XBADFILE;
5529155291

5529255292
WOLFSSL_ERROR(WC_NO_ERR_TRACE(BAD_FUNC_ARG));
55293-
ExpectTrue((fp = XFOPEN("./tests/test-log-dump-to-file.txt", "ar")) !=
55293+
ExpectTrue((fp = XFOPEN("./tests/test-log-dump-to-file.txt", "a+")) !=
5529455294
XBADFILE);
5529555295
wc_ERR_print_errors_fp(fp);
5529655296
#if defined(DEBUG_WOLFSSL)
@@ -85971,7 +85971,8 @@ static int test_dtls_msg_from_other_peer(void)
8597185971
* !defined(SINGLE_THREADED) && !defined(NO_RSA) */
8597285972
#if defined(WOLFSSL_DTLS) && !defined(WOLFSSL_IPV6) && \
8597385973
!defined(NO_WOLFSSL_CLIENT) && !defined(NO_WOLFSSL_SERVER) && \
85974-
defined(HAVE_IO_TESTS_DEPENDENCIES) && !defined(WOLFSSL_NO_TLS12)
85974+
defined(HAVE_IO_TESTS_DEPENDENCIES) && !defined(WOLFSSL_NO_TLS12) \
85975+
&& !defined(USE_WINDOWS_API)
8597585976
static int test_dtls_ipv6_check(void)
8597685977
{
8597785978
EXPECT_DECLS;

0 commit comments

Comments
 (0)