Skip to content

Commit

Permalink
Add error when running non-kvm vm
Browse files Browse the repository at this point in the history
Change-Id: Id4ec187543e73997eba7cd374d7db2c73a206c6f
  • Loading branch information
ThoFrank committed Dec 19, 2024
1 parent 905fcae commit dcf0867
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions nix/IntegrationTests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
, self
, system
}:
pkgs.nixosTest {
pkgs.testers.runNixOSTest {
name = "referenceApp-integration-test";

nodes.machine = { config, pkgs, ... }: {
Expand Down Expand Up @@ -45,9 +45,15 @@ pkgs.nixosTest {

};

testScript = { nodes, ... }: ''
testScript = { nodes, ... }: /* python */''
machine.wait_for_unit("default.target")
machine.succeed("ifconfig vcan0")
virt = machine.succeed("systemd-detect-virt").strip()
if virt != 'kvm':
# should interactive test works and 'nix flake check' fail, you probably need to update the permissions on /dev/kvm
# if 'sudo -u nixbld1 touch /dev/kvm' fails
# you need to run 'sudo setfacl -m g:nixbld:rw- /dev/kvm'
raise Exception(f"Tests need to be run with kvm. Only found {virt}")
machine.succeed("ls $OPENBSW_SRC | grep README.md")
machine.succeed("cd $OPENBSW_SRC/test/pyTest && pytest -s --target=posix_ci")
'';
Expand Down

0 comments on commit dcf0867

Please sign in to comment.