Commit 81854ca6 authored by Raito Bezarius's avatar Raito Bezarius
Browse files

nixos/tests/misc: rework and take ownership



`nixosTests.misc` is an interesting smoketest as a last (cheap) line of
defense against Nix regressions.

We rework it to accept any arbitrary package manager for Lix.

Signed-off-by: default avatarRaito Bezarius <masterancpp@gmail.com>
parent a047bae9
Loading
Loading
Loading
Loading
+179 −161
Original line number Diff line number Diff line
# Miscellaneous small tests that don't warrant their own VM run.
{ pkgs, ... }:

import ./make-test-python.nix ({ lib, pkgs, ...} : let
let
  inherit (pkgs) lib;
  tests = {
    default = testsForPackage { nixPackage = pkgs.nix; };
    lix = testsForPackage { nixPackage = pkgs.lix; };
  };

  testsForPackage = args: lib.recurseIntoAttrs {
    miscFeatures = testMiscFeatures args;
    passthru.override = args': testsForPackage (args // args');
  };

  testMiscFeatures = { nixPackage, ... }: pkgs.testers.nixosTest (
  let
    foo = pkgs.writeText "foo" "Hello World";
  in {
    name = "misc";
  meta.maintainers = with lib.maintainers; [ eelco ];
    meta.maintainers = with lib.maintainers; [ raitobezarius ];

    nodes.machine =
      { lib, ... }:
@@ -40,6 +54,8 @@ in {
        boot.kernel.sysctl."vm.swappiness" = 1;
        boot.kernelParams = [ "vsyscall=emulate" ];
        system.extraDependencies = [ foo ];

        nix.package = nixPackage;
      };

    testScript =
@@ -161,4 +177,6 @@ in {
        with subtest("Test boot parameters"):
            assert "vsyscall=emulate" in machine.succeed("cat /proc/cmdline")
      '';
})
  });
  in
  tests