[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]
jobs:
# macos-latest:
# name: Build and Test on MacOS Latest
# runs-on: macos-latest
# steps:
## - name: Install MongoDB with Package Manager
## run: |
## brew tap mongodb/brew
## brew install mongodb-community
## brew services start mongodb-community
# - name: Create the TUN device with the interface name `ogstun`.
# run: |
# sudo ifconfig lo0 alias 127.0.0.2 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.4 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.6 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.7 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.8 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.9 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.10 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.11 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.12 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.13 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.14 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.15 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.16 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.17 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.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.1.10 netmask 255.255.255.255
# - name: Install the dependencies for building the source code.
# run: brew install mongo-c-driver libidn libmicrohttpd nghttp2 bison libusrsctp libtins talloc meson
# - name: Check out repository code
# uses: actions/checkout@main
# - name: Setup Meson Build
# run: PATH="/usr/local/opt/bison/bin:$PATH" PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:$PKG_CONFIG_PATH" meson setup build
# env:
# CC: gcc
# - name : Build Open5GS
# run: ninja -C build
# - name: Test Open5GS
# run: sudo meson test -C build -v crypt unit
#
macos-latest:
name: Build and Test on MacOS Latest
runs-on: macos-latest
steps:
- name: Install and start MongoDB
run: |
brew tap mongodb/brew
brew trust mongodb/brew
brew install mongodb/brew/mongodb-community@8.0
brew services start mongodb/brew/mongodb-community@8.0
for attempt in {1..30}; do
if mongosh --quiet \
'mongodb://127.0.0.1:27017/?serverSelectionTimeoutMS=1000' \
--eval 'quit(db.adminCommand({ping: 1}).ok === 1 ? 0 : 1)' \
>/dev/null 2>&1; then
exit 0
fi
sleep 1
done
echo "::error::MongoDB did not become ready"
mongo_log="$(brew --prefix)/var/log/mongodb/mongo.log"
if [ -f "$mongo_log" ]; then
tail -n 100 "$mongo_log"
fi
exit 1
- name: Configure loopback addresses for tests
run: |
sudo ifconfig lo0 alias 127.0.0.2 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.4 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.6 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.7 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.8 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.9 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.10 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.11 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.12 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.13 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.14 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.15 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.16 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.17 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.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:
name: Build and Test on Ubuntu Latest
runs-on: ubuntu-latest
@ -75,4 +100,4 @@ jobs:
- name : Build Open5GS
run: ninja -C build
- 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(&addr, 0, sizeof addr);
infolen = sizeof rcv_info;
n = usrsctp_recvv(socket, msg, len,
&addr.sa, &addrlen,
(void *)&rcv_info,

View file

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