-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c5b8525
commit 4521399
Showing
7 changed files
with
151 additions
and
9 deletions.
There are no files selected for viewing
File renamed without changes.
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,34 @@ | ||
name: vmtests | ||
on: | ||
pull_request: | ||
push: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
vmtests: | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
steps: | ||
- uses: actions/checkout@main | ||
- uses: DeterminateSystems/nix-installer-action@main | ||
- uses: DeterminateSystems/magic-nix-cache-action@main | ||
|
||
- name: Install system dependencies | ||
run: | | ||
export DEBIAN_FRONTEND=noninteractive | ||
sudo apt-get update && sudo apt-get -y install --no-install-recommends qemu-system-x86 qemu-guest-agent | ||
- name: Set up nix dev env | ||
run: nix develop --command echo 0 | ||
|
||
- name: Build `lightswitch` | ||
run: nix develop --ignore-environment --command bash -c 'cargo build' | ||
|
||
- name: Run kernel tests | ||
run: nix develop --command 'vmtest' |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/target | ||
flame.svg | ||
src/bpf/*_skel.rs | ||
.vmtest.log |
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
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
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,78 @@ | ||
{ pkgs }: | ||
{ | ||
kernel_5_15 = pkgs.stdenv.mkDerivation { | ||
name = "download-kernel-5.15"; | ||
src = pkgs.fetchurl { | ||
url = "https://github.com/danobi/vmtest/releases/download/test_assets/bzImage-v5.15-fedora38"; | ||
hash = "sha256-nq8W72vuNKCgO1OS6aJtAfg7AjHavRZ7WAkP7X6V610="; | ||
}; | ||
dontUnpack = true; | ||
installPhase = '' | ||
mkdir -p $out | ||
cp -r $src $out/bzImage | ||
''; | ||
}; | ||
|
||
kernel_6_0 = pkgs.stdenv.mkDerivation { | ||
name = "download-kernel-6.0"; | ||
src = pkgs.fetchurl { | ||
url = "https://github.com/danobi/vmtest/releases/download/test_assets/bzImage-v6.0-fedora38"; | ||
hash = "sha256-ZBBQ0yVUn+Isd2b+a32oMEbNo8T1v46P3rEtZ+1j9Ic="; | ||
}; | ||
dontUnpack = true; | ||
installPhase = '' | ||
mkdir -p $out | ||
cp -r $src $out/bzImage | ||
''; | ||
}; | ||
|
||
kernel_6_2 = pkgs.stdenv.mkDerivation { | ||
name = "download-kernel-6.2"; | ||
src = pkgs.fetchurl { | ||
url = "https://github.com/danobi/vmtest/releases/download/test_assets/bzImage-v6.2-fedora38"; | ||
hash = "sha256-YO2HEIWTuEEJts9JrW3V7UVR7t4J3+8On+tjdELa2m8="; | ||
}; | ||
dontUnpack = true; | ||
installPhase = '' | ||
mkdir -p $out | ||
cp -r $src $out/bzImage | ||
''; | ||
}; | ||
|
||
kernel_6_6 = pkgs.stdenv.mkDerivation { | ||
name = "download-kernel-6.6"; | ||
src = pkgs.fetchurl { | ||
url = "https://github.com/danobi/vmtest/releases/download/test_assets/bzImage-v6.6-fedora38"; | ||
hash = "sha256-6Fu16SPBITP0sI3lapkckZna6GKBn2hID038itt82jA="; | ||
}; | ||
dontUnpack = true; | ||
installPhase = '' | ||
mkdir -p $out | ||
cp -r $src $out/bzImage | ||
''; | ||
}; | ||
|
||
vmtest = pkgs.rustPlatform.buildRustPackage { | ||
name = "vmtest"; | ||
src = pkgs.fetchFromGitHub { | ||
owner = "danobi"; | ||
repo = "vmtest"; | ||
rev = "51f11bf301fea054342996802a16ed21fb5054f4"; | ||
sha256 = "sha256-qtTq0dnDHi1ITfQzKrXz+1dRMymAFBivWpjXntD09+A="; | ||
}; | ||
cargoHash = "sha256-SHjjCWz4FVVk1cczkMltRVEB3GK8jz2tVABNSlSZiUc="; | ||
# nativeCheckInputs = [ pkgs.qemu ]; | ||
|
||
# There are some errors trying to access `/build/source/tests/*`. | ||
doCheck = false; | ||
|
||
meta = with pkgs.lib; { | ||
description = "Helps run tests in virtual machines"; | ||
homepage = "https://github.com/danobi/vmtest/"; | ||
license = licenses.asl20; | ||
mainProgram = ""; | ||
maintainers = with maintainers; [ ]; | ||
platforms = platforms.linux; | ||
}; | ||
}; | ||
} |
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,19 @@ | ||
[[target]] | ||
name = "Fedora 5.15" | ||
kernel = "/nix/store/cg9wq48zz2dbvayh7sigr5smaf4dwcxp-download-kernel-5.15/bzImage" | ||
command = "/mnt/vmtest/target/debug/lightswitch --duration 0" | ||
|
||
[[target]] | ||
name = "Fedora 6.0" | ||
kernel = "/nix/store/p8xc9gqdkpfjpmcb9ja2gx6g6bd9cby7-download-kernel-6.0/bzImage" | ||
command = "/mnt/vmtest/target/debug/lightswitch --duration 0" | ||
|
||
[[target]] | ||
name = "Fedora 6.2" | ||
kernel = "/nix/store/79wzcqy12fncdf6pk1fj627ggh7v0nc7-download-kernel-6.2/bzImage" | ||
command = "/mnt/vmtest/target/debug/lightswitch --duration 0" | ||
|
||
[[target]] | ||
name = "Fedora 6.6" | ||
kernel = "/nix/store/77ixckavs2qidx1pglmlxsj6bfvjqijb-download-kernel-6.6/bzImage" | ||
command = "/mnt/vmtest/target/debug/lightswitch --duration 0" |