Skip to content

Commit 4231329

Browse files
committed
Run the full test suite on FreeBSD in CI.
The freebsd job consumes the shared setup-vm and run actions to boot a FreeBSD 13.5 guest on the Linux runner, prepares it with the packages, the fdescfs mount and the file-backed pool the suite expects, and runs pytest against the pool. The actions are pinned to the vm-tooling branch until their interface settles behind a version tag. Resource limit tests skip on this guest because enabling resource accounting requires a boot-time tunable, which the graceful rctl detection reports as unsupported.
1 parent 826d20d commit 4231329

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,42 @@ jobs:
4040
pip install --no-build-isolation jail==0.0.12
4141
- name: Run the platform-independent tests
4242
run: pytest --cov=libioc --cov-report=term
43+
44+
freebsd:
45+
name: Test suite (FreeBSD 13.5)
46+
runs-on: ubuntu-latest
47+
timeout-minutes: 60
48+
steps:
49+
- uses: actions/checkout@v7
50+
- name: Boot the FreeBSD VM
51+
uses: no-pictures/freebsd-ci/.github/actions/setup-vm@vm-tooling
52+
with:
53+
version: 13.5-RELEASE
54+
- name: Prepare the guest
55+
uses: no-pictures/freebsd-ci/.github/actions/run@vm-tooling
56+
with:
57+
sync-workspace: "false"
58+
run: |
59+
mkdir -p /usr/local/etc/pkg/repos
60+
echo 'FreeBSD: { url: "pkg+https://pkg.FreeBSD.org/${ABI}/latest" }' > /usr/local/etc/pkg/repos/FreeBSD.conf
61+
env ASSUME_ALWAYS_YES=yes pkg bootstrap -f
62+
pkg update -f
63+
PYPKG="$(pkg search -q '^py3[0-9]*-libzfs' | head -n 1 | sed 's/-libzfs.*//')"
64+
pkg install -y python3 "${PYPKG}-libzfs" "${PYPKG}-ucl" "${PYPKG}-sqlite3" "${PYPKG}-setuptools" "${PYPKG}-pip" git
65+
mount -t fdescfs null /dev/fd
66+
kldload if_epair 2>/dev/null || true
67+
kldload zfs 2>/dev/null || true
68+
mkdir -p /pools
69+
truncate -s 8G /pools/ioc-test.img
70+
zpool create -m /.ioc-test ioc-test /pools/ioc-test.img
71+
zfs set compression=lz4 ioc-test
72+
PYBIN="$(ls /usr/local/bin/ | grep -E '^python3\.[0-9]+$' | head -n 1)"
73+
"/usr/local/bin/${PYBIN}" -m venv --system-site-packages /root/venv
74+
/root/venv/bin/pip install -q -U pip setuptools wheel
75+
- name: Run the test suite
76+
uses: no-pictures/freebsd-ci/.github/actions/run@vm-tooling
77+
with:
78+
run: |
79+
/root/venv/bin/pip install -q --no-build-isolation -r requirements.txt -r requirements-test.txt
80+
/root/venv/bin/pip install -q --no-build-isolation -e .
81+
/root/venv/bin/pytest tests --zpool ioc-test

0 commit comments

Comments
 (0)