diff options
Diffstat (limited to 'nixos/tests')
-rw-r--r-- | nixos/tests/all-tests.nix | 4 | ||||
-rw-r--r-- | nixos/tests/systemd-binfmt.nix | 24 | ||||
-rw-r--r-- | nixos/tests/zoneminder.nix | 23 |
3 files changed, 50 insertions, 1 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 5caf1c958fb0..0acded892c7a 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -304,6 +304,7 @@ in syncthing-relay = handleTest ./syncthing-relay.nix {}; systemd = handleTest ./systemd.nix {}; systemd-analyze = handleTest ./systemd-analyze.nix {}; + systemd-binfmt = handleTestOn ["x86_64-linux"] ./systemd-binfmt.nix {}; systemd-boot = handleTestOn ["x86_64-linux"] ./systemd-boot.nix {}; systemd-confinement = handleTest ./systemd-confinement.nix {}; systemd-timesyncd = handleTest ./systemd-timesyncd.nix {}; @@ -348,6 +349,7 @@ in yabar = handleTest ./yabar.nix {}; yggdrasil = handleTest ./yggdrasil.nix {}; zfs = handleTest ./zfs.nix {}; - zsh-history = handleTest ./zsh-history.nix {}; + zoneminder = handleTest ./zoneminder.nix {}; zookeeper = handleTest ./zookeeper.nix {}; + zsh-history = handleTest ./zsh-history.nix {}; } diff --git a/nixos/tests/systemd-binfmt.nix b/nixos/tests/systemd-binfmt.nix new file mode 100644 index 000000000000..2a676f3da98b --- /dev/null +++ b/nixos/tests/systemd-binfmt.nix @@ -0,0 +1,24 @@ +# Teach the kernel how to run armv7l and aarch64-linux binaries, +# and run GNU Hello for these architectures. +import ./make-test-python.nix ({ pkgs, ... }: { + name = "systemd-binfmt"; + machine = { + boot.binfmt.emulatedSystems = [ + "armv7l-linux" + "aarch64-linux" + ]; + }; + + testScript = let + helloArmv7l = pkgs.pkgsCross.armv7l-hf-multiplatform.hello; + helloAarch64 = pkgs.pkgsCross.aarch64-multiplatform.hello; + in '' + machine.start() + assert "world" in machine.succeed( + "${helloArmv7l}/bin/hello" + ) + assert "world" in machine.succeed( + "${helloAarch64}/bin/hello" + ) + ''; +}) diff --git a/nixos/tests/zoneminder.nix b/nixos/tests/zoneminder.nix new file mode 100644 index 000000000000..a4e1a05ec0ee --- /dev/null +++ b/nixos/tests/zoneminder.nix @@ -0,0 +1,23 @@ +import ./make-test-python.nix ({ lib, ...}: + +{ + name = "zoneminder"; + meta.maintainers = with lib.maintainers; [ danielfullmer ]; + + machine = { ... }: + { + services.zoneminder = { + enable = true; + database.createLocally = true; + database.username = "zoneminder"; + }; + time.timeZone = "America/New_York"; + }; + + testScript = '' + machine.wait_for_unit("zoneminder.service") + machine.wait_for_unit("nginx.service") + machine.wait_for_open_port(8095) + machine.succeed("curl --fail http://localhost:8095/") + ''; +}) |