From 4454d9ac45fb77fd29e226d2edbf7fd188825b6a Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Tue, 5 Sep 2023 19:26:37 +0200 Subject: [PATCH] add KVM tests --- .github/workflows/ci.yml | 58 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 50a6f34121..d64ec10ac4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -345,3 +345,61 @@ jobs: sleep 5 curl http://127.0.0.1:9975/help sleep 1 + + run-x86_64-kvm: + name: Run Hermit for Rust (x86_64 + kvm) + runs-on: [self-hosted] + steps: + - name: Install QEMU, NASM + run: | + sudo apt-get update + sudo apt-get install qemu-system-x86 nasm libcap-ng-dev libseccomp-dev socat + - name: Checkout hermit-rs + uses: actions/checkout@v4 + with: + repository: hermitcore/hermit-rs + submodules: true + - name: Remove hermit-kernel submodule + run: git rm -r kernel + - name: Checkout hermit-kernel + uses: actions/checkout@v4 + with: + path: kernel + - uses: mkroening/rust-toolchain-toml@main + - uses: Swatinem/rust-cache@v2 + - name: Build dev profile + run: cargo build -Zbuild-std=std,panic_abort --package rusty_demo --target x86_64-unknown-hermit + - name: Download loader + uses: dsaltares/fetch-gh-release-asset@1.1.1 + with: + repo: hermitcore/rusty-loader + file: rusty-loader-x86_64 + - name: Install uhyve + run: cargo +stable install --locked uhyve + - name: Check KVM availability + shell: bash + run: | + lscpu + kvm-ok + - name: Test debug version (Uhyve) + run: uhyve --verbose -c 1 target/x86_64-unknown-hermit/debug/rusty_demo + env: + RUST_LOG: debug + - name: Test debug profile (Qemu) + run: | + qemu-system-x86_64 -display none -smp 1 -m 128M -serial stdio \ + -enable-kvm -cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr,rdrand \ + -kernel rusty-loader-x86_64 \ + -initrd target/x86_64-unknown-hermit/debug/rusty_demo + - name: Build release profile + run: cargo build -Zbuild-std=std,panic_abort --target x86_64-unknown-hermit --package rusty_demo --release + - name: Test release version (Uhyve) + run: uhyve --verbose -c 1 target/x86_64-unknown-hermit/release/rusty_demo + env: + RUST_LOG: debug + - name: Test release profile (Qemu) + run: | + qemu-system-x86_64 -display none -smp 1 -m 128M -serial stdio \ + -enable-kvm -cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr,rdrand \ + -kernel rusty-loader-x86_64 \ + -initrd target/x86_64-unknown-hermit/release/rusty_demo