mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
The other dbus-*.sh tests drive libink's own client, so the wire format was only ever checked against the implementation that wrote it, and the broker path had no coverage at all. Every bug found in it so far was found by hand on a target. Let the dbus plugin bring up a real dbus-daemon, wait for Finit to claim org.finit, then talk to Finit with dbus-send, which shares no code with us. The privileged call is the interesting one: it can only be answered by parking the call and asking the broker who sent it. The bus reads the policy Finit installs, so a malformed org.finit.conf fails here rather than on a target. Tests no longer build --with-libsystemd. Our replacement carries the real soname but only the sd_notify() symbols, so in the test root it shadowed the libsystemd the host's libdbus-1 wants and dbus-daemon died on a missing sd_is_socket. Nothing under test needs the shared library: serv is the only consumer and it compiles sd-daemon.c straight in, which it now does regardless of the flag so notify.sh keeps testing notify:systemd either way. Staged from the host by lib/sysroot.mk like any other binary, and skipped when the host has neither program. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
87 lines
2.9 KiB
YAML
87 lines
2.9 KiB
YAML
name: Bob the Builder
|
|
|
|
# Run on all branches, including all pull requests, except the 'dev'
|
|
# branch since that's where we run Coverity Scan (limited tokens/day)
|
|
on:
|
|
push:
|
|
branches:
|
|
- '**'
|
|
- '!dev'
|
|
pull_request:
|
|
types: [opened, synchronize, reopened, labeled]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
# Verify we can build on latest Ubuntu with both gcc and clang
|
|
name: ${{ matrix.compiler }}
|
|
runs-on: ubuntu-latest
|
|
# Skip redundant builds for PRs - prefer PR builds over push builds
|
|
if: github.event_name != 'push' || github.ref == 'refs/heads/master'
|
|
strategy:
|
|
matrix:
|
|
compiler: [gcc, clang]
|
|
fail-fast: false
|
|
env:
|
|
CC: ${{ matrix.compiler }}
|
|
steps:
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get -y update
|
|
sudo apt-get -y install pkg-config tree jq libcap-dev libconfuse-dev
|
|
wget https://github.com/troglobit/libuev/releases/download/v2.4.1/libuev-2.4.1.tar.xz
|
|
wget https://github.com/troglobit/libite/releases/download/v2.6.2/libite-2.6.2.tar.gz
|
|
tar xf libuev-2.4.1.tar.xz
|
|
tar xf libite-2.6.2.tar.gz
|
|
(cd libuev-2.4.1 && ./configure && make -j9 && sudo make install-strip)
|
|
(cd libite-2.6.2 && ./configure && make -j9 && sudo make install-strip)
|
|
sudo ldconfig
|
|
- uses: actions/checkout@v4
|
|
- name: Static Finit
|
|
run: |
|
|
./autogen.sh
|
|
./configure --prefix= --enable-static
|
|
make -j9 V=1
|
|
- name: Regular Finit
|
|
run: |
|
|
./configure --prefix=/usr --exec-prefix= --sysconfdir=/etc --localstatedir=/var \
|
|
--enable-x11-common-plugin --enable-testserv-plugin --with-watchdog \
|
|
--with-keventd \
|
|
CFLAGS="-fsanitize=address -ggdb"
|
|
make -j9 clean
|
|
make -j9 V=1
|
|
- name: Install to /tmp
|
|
run: |
|
|
DESTDIR=/tmp make install-strip
|
|
tree /tmp || true
|
|
- name: Check dependencies
|
|
run: |
|
|
ldd /tmp/sbin/finit
|
|
size /tmp/sbin/finit
|
|
ldd /tmp/sbin/initctl
|
|
size /tmp/sbin/initctl
|
|
ldd /tmp/sbin/reboot
|
|
size /tmp/sbin/reboot
|
|
- name: Verify starting and showing usage text
|
|
run: |
|
|
sudo /tmp/sbin/finit -h
|
|
sudo /tmp/sbin/initctl -h
|
|
- name: Enable unprivileged userns (unshare)
|
|
run: |
|
|
sudo sysctl kernel.apparmor_restrict_unprivileged_userns=0
|
|
- name: Run Unit Tests
|
|
run: |
|
|
make -j1 check || (cat test/test-suite.log; false)
|
|
- name: Upload Test Results
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: finit-test-${{ matrix.compiler }}
|
|
path: test/*.log
|