diff options
Diffstat (limited to 'nixos/tests')
-rw-r--r-- | nixos/tests/all-tests.nix | 1 | ||||
-rw-r--r-- | nixos/tests/fsck.nix | 12 | ||||
-rw-r--r-- | nixos/tests/hadoop/hbase.nix | 25 | ||||
-rw-r--r-- | nixos/tests/login.nix | 13 | ||||
-rw-r--r-- | nixos/tests/matrix/mjolnir.nix | 5 | ||||
-rw-r--r-- | nixos/tests/nixops/default.nix | 8 | ||||
-rw-r--r-- | nixos/tests/openldap.nix | 2 |
7 files changed, 56 insertions, 10 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index ee6b65424431..ee1f6bb8059f 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -238,6 +238,7 @@ in { freshrss-pgsql = handleTest ./freshrss-pgsql.nix {}; frr = handleTest ./frr.nix {}; fsck = handleTest ./fsck.nix {}; + fsck-systemd-stage-1 = handleTest ./fsck.nix { systemdStage1 = true; }; ft2-clone = handleTest ./ft2-clone.nix {}; mimir = handleTest ./mimir.nix {}; garage = handleTest ./garage {}; diff --git a/nixos/tests/fsck.nix b/nixos/tests/fsck.nix index 5b8b09f433a2..ccb664be080c 100644 --- a/nixos/tests/fsck.nix +++ b/nixos/tests/fsck.nix @@ -1,3 +1,9 @@ +{ system ? builtins.currentSystem +, config ? {} +, pkgs ? import ../.. { inherit system config; } +, systemdStage1 ? false +}: + import ./make-test-python.nix { name = "fsck"; @@ -11,13 +17,17 @@ import ./make-test-python.nix { autoFormat = true; }; }; + + boot.initrd.systemd.enable = systemdStage1; }; testScript = '' machine.wait_for_unit("default.target") with subtest("root fs is fsckd"): - machine.succeed("journalctl -b | grep 'fsck.ext4.*/dev/vda'") + machine.succeed("journalctl -b | grep '${if systemdStage1 + then "fsck.*vda.*clean" + else "fsck.ext4.*/dev/vda"}'") with subtest("mnt fs is fsckd"): machine.succeed("journalctl -b | grep 'fsck.*/dev/vdb.*clean'") diff --git a/nixos/tests/hadoop/hbase.nix b/nixos/tests/hadoop/hbase.nix index d9d2dac0f658..0416345682a8 100644 --- a/nixos/tests/hadoop/hbase.nix +++ b/nixos/tests/hadoop/hbase.nix @@ -53,6 +53,24 @@ with pkgs.lib; }; }; }; + thrift = { ... }:{ + services.hadoop = { + inherit coreSite; + hbase = { + inherit zookeeperQuorum; + thrift = defOpts; + }; + }; + }; + rest = { ... }:{ + services.hadoop = { + inherit coreSite; + hbase = { + inherit zookeeperQuorum; + rest = defOpts; + }; + }; + }; }; testScript = '' @@ -80,5 +98,12 @@ with pkgs.lib; assert "1 active master, 0 backup masters, 1 servers" in master.succeed("echo status | HADOOP_USER_NAME=hbase hbase shell -n") regionserver.wait_until_succeeds("echo \"create 't1','f1'\" | HADOOP_USER_NAME=hbase hbase shell -n") assert "NAME => 'f1'" in regionserver.succeed("echo \"describe 't1'\" | HADOOP_USER_NAME=hbase hbase shell -n") + + rest.wait_for_open_port(8080) + assert "${hbase.version}" in regionserver.succeed("curl http://rest:8080/version/cluster") + + thrift.wait_for_open_port(9090) ''; + + meta.maintainers = with maintainers; [ illustris ]; }) diff --git a/nixos/tests/login.nix b/nixos/tests/login.nix index 2cff38d20059..67f5764a0a16 100644 --- a/nixos/tests/login.nix +++ b/nixos/tests/login.nix @@ -13,6 +13,8 @@ import ./make-test-python.nix ({ pkgs, latestKernel ? false, ... }: }; testScript = '' + machine.start(allow_reboot = True) + machine.wait_for_unit("multi-user.target") machine.wait_until_succeeds("pgrep -f 'agetty.*tty1'") machine.screenshot("postboot") @@ -53,7 +55,14 @@ import ./make-test-python.nix ({ pkgs, latestKernel ? false, ... }: machine.screenshot("getty") with subtest("Check whether ctrl-alt-delete works"): - machine.send_key("ctrl-alt-delete") - machine.wait_for_shutdown() + boot_id1 = machine.succeed("cat /proc/sys/kernel/random/boot_id").strip() + assert boot_id1 != "" + + machine.reboot() + + boot_id2 = machine.succeed("cat /proc/sys/kernel/random/boot_id").strip() + assert boot_id2 != "" + + assert boot_id1 != boot_id2 ''; }) diff --git a/nixos/tests/matrix/mjolnir.nix b/nixos/tests/matrix/mjolnir.nix index b1ac55d951ce..c88113cb260b 100644 --- a/nixos/tests/matrix/mjolnir.nix +++ b/nixos/tests/matrix/mjolnir.nix @@ -107,7 +107,10 @@ import ../make-test-python.nix ( client = { pkgs, ... }: { environment.systemPackages = [ (pkgs.writers.writePython3Bin "create_management_room_and_invite_mjolnir" - { libraries = [ pkgs.python3Packages.matrix-nio ]; } '' + { libraries = with pkgs.python3Packages; [ + matrix-nio + ] ++ matrix-nio.optional-dependencies.e2e; + } '' import asyncio from nio import ( diff --git a/nixos/tests/nixops/default.nix b/nixos/tests/nixops/default.nix index b77ac2476398..bd00e6143639 100644 --- a/nixos/tests/nixops/default.nix +++ b/nixos/tests/nixops/default.nix @@ -30,12 +30,10 @@ let virtualisation.additionalPaths = [ pkgs.hello pkgs.figlet - - # This includes build dependencies all the way down. Not efficient, - # but we do need build deps to an *arbitrary* depth, which is hard to - # determine. - (allDrvOutputs nodes.server.config.system.build.toplevel) ]; + + # TODO: make this efficient, https://github.com/NixOS/nixpkgs/issues/180529 + system.includeBuildDependencies = true; }; server = { lib, ... }: { imports = [ ./legacy/base-configuration.nix ]; diff --git a/nixos/tests/openldap.nix b/nixos/tests/openldap.nix index 075bb5d1f640..47d6a91843f1 100644 --- a/nixos/tests/openldap.nix +++ b/nixos/tests/openldap.nix @@ -118,7 +118,7 @@ in { }; }; testScript = { nodes, ... }: let - specializations = "${nodes.machine.config.system.build.toplevel}/specialisation"; + specializations = "${nodes.machine.system.build.toplevel}/specialisation"; changeRootPw = '' dn: olcDatabase={1}mdb,cn=config changetype: modify |