Skip to content

per x86_64 kernel integration test #308

per x86_64 kernel integration test

per x86_64 kernel integration test #308

Workflow file for this run

name: 'per x86_64 kernel integration test'
on:
schedule:
# Run job once a week on saturday at 8:15 AM.
- cron: '15 8 * * 6'
push:
branches: [ main ]
pull_request:
branches: [ '**' ]
jobs:
build-initramfs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22
id: go
- name: compile tests
# bluebox works best with statically linked binaries. So we compile all the tests in this
# code base into a statically linked executable.
run: |
go test -ldflags='-extldflags=-static' -trimpath -tags 'osusergo netgo static_build linux integration' -c
- name: build initramfs
# Install bluebox and generate a initramfs.cpio with the previously created statically linked
# tests embedded.
run: |
go install github.com/florianl/bluebox@latest
bluebox -e go-tc.test
- name: upload initramfs for tests
# Upload the generated initramfs.cpio and make it available for the parallel per-kernel tests.
uses: actions/upload-artifact@v4
with:
name: initramfs
path: |
initramfs.cpio
per-kernel-tests:
needs: build-initramfs
runs-on: ubuntu-latest
strategy:
matrix:
kernel-version: ["4.9", "4.14", "4.19", "5.4", "5.10", "5.15", "6.1", "6.6", "6.7"]
steps:
- name: add Docker repo
run: |
# From https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
- name: install dependencies
# Make sure required software packages are available.
run: |
sudo apt --yes update
sudo apt --yes install --no-install-recommends qemu-system-x86 docker-buildx-plugin
- name: get initramfs
# Fetch the initramfs.cpio that was created in the previous step.
uses: actions/download-artifact@v4
with:
name: initramfs
- name: fetch and unpack Linux kernel
# Fetch the public kernel image that will be used in this test run.
# Inspired by extract_oci_image from cilium/ebpf.
run: |
mkdir /tmp/ci-kernel
echo "FROM ghcr.io/cilium/ci-kernels:${{ matrix.kernel-version }}" | docker buildx build --quiet --pull --output="/tmp/ci-kernel" -
- name: run tests on kernel
# Run the tests.
run: |
qemu-system-x86_64 -nographic -append "console=ttyS0" -m 2G -kernel /tmp/ci-kernel/boot/vmlinuz -initrd initramfs.cpio | tee log.txt
grep PASS log.txt