forked from sched-ext/sched_ext
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
- Loading branch information
Andrea Righi
committed
May 3, 2024
1 parent
227b79e
commit 2313d73
Showing
3 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Add custom kernel configs here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
# | ||
# Run a test for TIMEOUT seconds inside virtme-ng and catch potential errors. | ||
|
||
# Maximum time the test run. | ||
TEST_TIMEOUT=30 | ||
|
||
# Maximum timeout for the guest run (this is used to hard-shutdown the guest in | ||
# case of system hangs). | ||
GUEST_TIMEOUT=60 | ||
|
||
# Test command to run | ||
TEST_CMD="uname -r" | ||
|
||
# Check if virtme-ng is available. | ||
if [ ! -x `which vng` ]; then | ||
echo "vng not found, please install virtme-ng to enable testing" | ||
exit 1 | ||
fi | ||
|
||
# NOTE: virtme-ng automatically runs the kernel from the current working | ||
# directory by default. | ||
# | ||
rm -f /tmp/output | ||
(timeout --foreground --preserve-status ${GUEST_TIMEOUT} \ | ||
vng --force-9p --disable-microvm --verbose -- \ | ||
"timeout --foreground --preserve-status ${TEST_TIMEOUT} ${TEST_CMD}" \ | ||
2>&1 </dev/null || true) | tee /tmp/output | ||
sed -n -e '/\bBUG:/q1' \ | ||
-e '/\bWARNING:/q1' /tmp/output | ||
res=$? | ||
if [ ${res} -ne 0 ]; then | ||
echo "FAIL" | ||
exit 1 | ||
else | ||
echo "OK" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: test-kernel | ||
run-name: ${{ github.actor }} PR run | ||
on: [pull_request, push] | ||
jobs: | ||
test-kernel: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
### OTHER REPOS #### | ||
|
||
# Hard turn-off interactive mode | ||
- run: echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections | ||
|
||
# Refresh packages list | ||
- run: sudo apt update | ||
|
||
### DOWNLOAD AND INSTALL DEPENDENCIES ### | ||
|
||
# Download dependencies packaged by Ubuntu | ||
- run: sudo apt -y install gcc make git coreutils cmake elfutils libelf-dev libunwind-dev libzstd-dev linux-headers-generic linux-tools-common linux-tools-generic ninja-build python3-pip python3-requests qemu-kvm udev iproute2 busybox-static libvirt-clients kbd kmod file rsync zstd pahole flex bison cpio libcap-dev libelf-dev python3-dev cargo rustc | ||
|
||
# Checkout repository | ||
- uses: actions/checkout@v4 | ||
|
||
# Install virtme-ng | ||
- run: pip install virtme-ng | ||
|
||
### END DEPENDENCIES ### | ||
|
||
# Build a minimal kernel using virtme-ng | ||
- run: vng -v --build --config .github/workflows/kernel.config | ||
|
||
# Boot test the kernel | ||
- run: .github/workflows/run-kernel |