[CI] Re-enable macOS job and fix usrsctp PPID
Some checks are pending
CIFuzz / Fuzzing (push) Waiting to run
Meson Continuous Integration / Build and Test on MacOS Latest (push) Waiting to run
Meson Continuous Integration / Build and Test on Ubuntu Latest (push) Waiting to run

- macOS: install MongoDB 8.0 (mongodb/brew) and wait until ready,
  add loopback aliases used by tests, use brew --prefix paths,
  run the full test suite
- Use meson test -t 3 (timeout multiplier) on macOS and Ubuntu
- usrsctp: set infolen before usrsctp_recvv() so that PPID is
  returned; sctp-test now checks PPID with usrsctp as well
This commit is contained in:
Sukchan Lee 2026-09-29 21:04:25 +09:00
parent 84e68de802
commit 1ac4d5b5ec
3 changed files with 72 additions and 48 deletions

View file

@ -2,51 +2,76 @@ name: Meson Continuous Integration
on: [push, pull_request] on: [push, pull_request]
jobs: jobs:
# macos-latest: macos-latest:
# name: Build and Test on MacOS Latest name: Build and Test on MacOS Latest
# runs-on: macos-latest runs-on: macos-latest
# steps: steps:
## - name: Install MongoDB with Package Manager - name: Install and start MongoDB
## run: | run: |
## brew tap mongodb/brew brew tap mongodb/brew
## brew install mongodb-community brew trust mongodb/brew
## brew services start mongodb-community brew install mongodb/brew/mongodb-community@8.0
# - name: Create the TUN device with the interface name `ogstun`. brew services start mongodb/brew/mongodb-community@8.0
# run: | for attempt in {1..30}; do
# sudo ifconfig lo0 alias 127.0.0.2 netmask 255.255.255.255 if mongosh --quiet \
# sudo ifconfig lo0 alias 127.0.0.3 netmask 255.255.255.255 'mongodb://127.0.0.1:27017/?serverSelectionTimeoutMS=1000' \
# sudo ifconfig lo0 alias 127.0.0.4 netmask 255.255.255.255 --eval 'quit(db.adminCommand({ping: 1}).ok === 1 ? 0 : 1)' \
# sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255 >/dev/null 2>&1; then
# sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255 exit 0
# sudo ifconfig lo0 alias 127.0.0.6 netmask 255.255.255.255 fi
# sudo ifconfig lo0 alias 127.0.0.7 netmask 255.255.255.255 sleep 1
# sudo ifconfig lo0 alias 127.0.0.8 netmask 255.255.255.255 done
# sudo ifconfig lo0 alias 127.0.0.9 netmask 255.255.255.255 echo "::error::MongoDB did not become ready"
# sudo ifconfig lo0 alias 127.0.0.10 netmask 255.255.255.255 mongo_log="$(brew --prefix)/var/log/mongodb/mongo.log"
# sudo ifconfig lo0 alias 127.0.0.11 netmask 255.255.255.255 if [ -f "$mongo_log" ]; then
# sudo ifconfig lo0 alias 127.0.0.12 netmask 255.255.255.255 tail -n 100 "$mongo_log"
# sudo ifconfig lo0 alias 127.0.0.13 netmask 255.255.255.255 fi
# sudo ifconfig lo0 alias 127.0.0.14 netmask 255.255.255.255 exit 1
# sudo ifconfig lo0 alias 127.0.0.15 netmask 255.255.255.255 - name: Configure loopback addresses for tests
# sudo ifconfig lo0 alias 127.0.0.16 netmask 255.255.255.255 run: |
# sudo ifconfig lo0 alias 127.0.0.17 netmask 255.255.255.255 sudo ifconfig lo0 alias 127.0.0.2 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.18 netmask 255.255.255.255 sudo ifconfig lo0 alias 127.0.0.3 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.19 netmask 255.255.255.255 sudo ifconfig lo0 alias 127.0.0.4 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.20 netmask 255.255.255.255 sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.1.10 netmask 255.255.255.255 sudo ifconfig lo0 alias 127.0.0.6 netmask 255.255.255.255
# - name: Install the dependencies for building the source code. sudo ifconfig lo0 alias 127.0.0.7 netmask 255.255.255.255
# run: brew install mongo-c-driver libidn libmicrohttpd nghttp2 bison libusrsctp libtins talloc meson sudo ifconfig lo0 alias 127.0.0.8 netmask 255.255.255.255
# - name: Check out repository code sudo ifconfig lo0 alias 127.0.0.9 netmask 255.255.255.255
# uses: actions/checkout@main sudo ifconfig lo0 alias 127.0.0.10 netmask 255.255.255.255
# - name: Setup Meson Build sudo ifconfig lo0 alias 127.0.0.11 netmask 255.255.255.255
# run: PATH="/usr/local/opt/bison/bin:$PATH" PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:$PKG_CONFIG_PATH" meson setup build sudo ifconfig lo0 alias 127.0.0.12 netmask 255.255.255.255
# env: sudo ifconfig lo0 alias 127.0.0.13 netmask 255.255.255.255
# CC: gcc sudo ifconfig lo0 alias 127.0.0.14 netmask 255.255.255.255
# - name : Build Open5GS sudo ifconfig lo0 alias 127.0.0.15 netmask 255.255.255.255
# run: ninja -C build sudo ifconfig lo0 alias 127.0.0.16 netmask 255.255.255.255
# - name: Test Open5GS sudo ifconfig lo0 alias 127.0.0.17 netmask 255.255.255.255
# run: sudo meson test -C build -v crypt unit sudo ifconfig lo0 alias 127.0.0.18 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.19 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.20 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.21 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.50 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.200 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.1.10 netmask 255.255.255.255
- name: Install the dependencies for building the source code.
run: brew install mongo-c-driver libidn libgcrypt gnutls openssl libmicrohttpd nghttp2 bison libusrsctp libtins talloc meson
- name: Check out repository code
uses: actions/checkout@main
- name: Setup Meson Build
run: |
brew_prefix="$(brew --prefix)"
export PATH="$(brew --prefix bison)/bin:$PATH"
export PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig:${PKG_CONFIG_PATH:-}"
export CFLAGS="-I${brew_prefix}/include ${CFLAGS:-}"
export CXXFLAGS="-I${brew_prefix}/include ${CXXFLAGS:-}"
export LDFLAGS="-L${brew_prefix}/lib ${LDFLAGS:-}"
meson setup build
env:
CC: gcc
- name : Build Open5GS
run: ninja -C build
- name: Test Open5GS
run: sudo meson test -C build -v -t 3
ubuntu-latest: ubuntu-latest:
name: Build and Test on Ubuntu Latest name: Build and Test on Ubuntu Latest
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -75,4 +100,4 @@ jobs:
- name : Build Open5GS - name : Build Open5GS
run: ninja -C build run: ninja -C build
- name: Test Open5GS - name: Test Open5GS
run: meson test -C build -v run: meson test -C build -v -t 3

View file

@ -332,6 +332,7 @@ int ogs_sctp_recvmsg(ogs_sock_t *sock, void *msg, size_t len,
memset(&rcv_info, 0, sizeof rcv_info); memset(&rcv_info, 0, sizeof rcv_info);
memset(&addr, 0, sizeof addr); memset(&addr, 0, sizeof addr);
infolen = sizeof rcv_info;
n = usrsctp_recvv(socket, msg, len, n = usrsctp_recvv(socket, msg, len,
&addr.sa, &addrlen, &addr.sa, &addrlen,
(void *)&rcv_info, (void *)&rcv_info,

View file

@ -274,9 +274,7 @@ static void test5_main(void *data)
size = ogs_sctp_recvdata(sctp, str, STRLEN, &from, &sinfo); size = ogs_sctp_recvdata(sctp, str, STRLEN, &from, &sinfo);
ABTS_INT_EQUAL(tc, strlen(DATASTR), size); ABTS_INT_EQUAL(tc, strlen(DATASTR), size);
ABTS_STR_EQUAL(tc, "::1", OGS_ADDR(&from, buf)); ABTS_STR_EQUAL(tc, "::1", OGS_ADDR(&from, buf));
#if !HAVE_USRSCTP
ABTS_INT_EQUAL(tc, PPID, sinfo.ppid); ABTS_INT_EQUAL(tc, PPID, sinfo.ppid);
#endif
ogs_sctp_destroy(sctp); ogs_sctp_destroy(sctp);
} }