VM smoke test for static-server image disabled: no KVM in CI runner #1

Open
opened 2026-02-18 12:50:25 +00:00 by toph · 0 comments
Owner

The checks.x86_64-linux.smoke in deploy-static-site/images/flake.nix was written as a NixOS VM test that loads the built Docker image, starts the container, and verifies that /foo routes to foo.html.

It was replaced with a runCommand test that only tests the static-web-server binary directly — not the actual image packaging.

Root cause: The CI runner has the nixos-test feature but not kvm. NixOS VM tests require kvm.

Fix options:

  • Enable KVM on the Forgejo Actions runner on alvin
  • Or run the VM test on a host that has KVM (e.g. endurance)

Original VM test that should be restored:

checks.${system}.smoke = pkgs.testers.nixosTest {
  name = "static-server-smoke";
  nodes.machine = { ... }: {
    virtualisation.docker.enable = true;
  };
  testScript = '
    machine.start()
    machine.wait_for_unit("docker.service")
    machine.succeed("docker load < ${staticServer}")
    machine.succeed(
      "docker run -d --name site -p 8080:8080 static-server:latest"
      " /bin/bash -c 'mkdir -p /var/www"
      " && printf index > /var/www/index.html"
      " && printf foo > /var/www/foo.html"
      " && exec static-web-server --port 8080 --root /var/www'"
    )
    machine.wait_until_succeeds("curl -sf http://localhost:8080/")
    machine.succeed("curl -sf http://localhost:8080/foo | grep -q foo")
  '';
};
The `checks.x86_64-linux.smoke` in `deploy-static-site/images/flake.nix` was written as a NixOS VM test that loads the built Docker image, starts the container, and verifies that `/foo` routes to `foo.html`. It was replaced with a `runCommand` test that only tests the `static-web-server` binary directly — not the actual image packaging. **Root cause:** The CI runner has the `nixos-test` feature but not `kvm`. NixOS VM tests require `kvm`. **Fix options:** - Enable KVM on the Forgejo Actions runner on alvin - Or run the VM test on a host that has KVM (e.g. endurance) **Original VM test that should be restored:** ```nix checks.${system}.smoke = pkgs.testers.nixosTest { name = "static-server-smoke"; nodes.machine = { ... }: { virtualisation.docker.enable = true; }; testScript = ' machine.start() machine.wait_for_unit("docker.service") machine.succeed("docker load < ${staticServer}") machine.succeed( "docker run -d --name site -p 8080:8080 static-server:latest" " /bin/bash -c 'mkdir -p /var/www" " && printf index > /var/www/index.html" " && printf foo > /var/www/foo.html" " && exec static-web-server --port 8080 --root /var/www'" ) machine.wait_until_succeeds("curl -sf http://localhost:8080/") machine.succeed("curl -sf http://localhost:8080/foo | grep -q foo") ''; }; ```
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: toph/ci-actions#1
No description provided.