0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

nixosTests: migrate tests to runTests (#389964)

This commit is contained in:
Martin Weinelt 2025-03-15 20:49:33 +01:00 committed by GitHub
commit 48e041d23c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 1151 additions and 1211 deletions

View file

@ -1300,26 +1300,26 @@ in {
wrappers = handleTest ./wrappers.nix {}; wrappers = handleTest ./wrappers.nix {};
writefreely = handleTest ./web-apps/writefreely.nix {}; writefreely = handleTest ./web-apps/writefreely.nix {};
wstunnel = runTest ./wstunnel.nix; wstunnel = runTest ./wstunnel.nix;
xandikos = handleTest ./xandikos.nix {}; xandikos = runTest ./xandikos.nix;
xautolock = handleTest ./xautolock.nix {}; xautolock = runTest ./xautolock.nix;
xfce = handleTest ./xfce.nix {}; xfce = runTest ./xfce.nix;
xfce-wayland = handleTest ./xfce-wayland.nix {}; xfce-wayland = runTest ./xfce-wayland.nix;
xmonad = handleTest ./xmonad.nix {}; xmonad = runTest ./xmonad.nix;
xmonad-xdg-autostart = handleTest ./xmonad-xdg-autostart.nix {}; xmonad-xdg-autostart = runTest ./xmonad-xdg-autostart.nix;
xpadneo = handleTest ./xpadneo.nix {}; xpadneo = runTest ./xpadneo.nix;
xrdp = handleTest ./xrdp.nix {}; xrdp = runTest ./xrdp.nix;
xrdp-with-audio-pulseaudio = handleTest ./xrdp-with-audio-pulseaudio.nix {}; xrdp-with-audio-pulseaudio = runTest ./xrdp-with-audio-pulseaudio.nix;
xscreensaver = handleTest ./xscreensaver.nix {}; xscreensaver = handleTest ./xscreensaver.nix {};
xss-lock = handleTest ./xss-lock.nix {}; xss-lock = runTest ./xss-lock.nix;
xterm = handleTest ./xterm.nix {}; xterm = runTest ./xterm.nix;
xxh = handleTest ./xxh.nix {}; xxh = runTest ./xxh.nix;
yabar = handleTest ./yabar.nix {}; yabar = runTest ./yabar.nix;
ydotool = handleTest ./ydotool.nix {}; ydotool = handleTest ./ydotool.nix {};
yggdrasil = handleTest ./yggdrasil.nix {}; yggdrasil = runTest ./yggdrasil.nix;
your_spotify = handleTest ./your_spotify.nix {}; your_spotify = runTest ./your_spotify.nix;
zammad = handleTest ./zammad.nix {}; zammad = runTest ./zammad.nix;
zenohd = handleTest ./zenohd.nix {}; zenohd = runTest ./zenohd.nix;
zeronet-conservancy = handleTest ./zeronet-conservancy.nix {}; zeronet-conservancy = runTest ./zeronet-conservancy.nix;
zfs = handleTest ./zfs.nix {}; zfs = handleTest ./zfs.nix {};
zigbee2mqtt_1 = runTest { zigbee2mqtt_1 = runTest {
imports = [ ./zigbee2mqtt.nix ]; imports = [ ./zigbee2mqtt.nix ];
@ -1329,12 +1329,12 @@ in {
imports = [ ./zigbee2mqtt.nix ]; imports = [ ./zigbee2mqtt.nix ];
_module.args.package = pkgs.zigbee2mqtt_2; _module.args.package = pkgs.zigbee2mqtt_2;
}; };
zipline = handleTest ./zipline.nix {}; zipline = runTest ./zipline.nix;
zoneminder = handleTest ./zoneminder.nix {}; zoneminder = runTest ./zoneminder.nix;
zookeeper = handleTest ./zookeeper.nix {}; zookeeper = runTest ./zookeeper.nix;
zram-generator = handleTest ./zram-generator.nix {}; zram-generator = runTest ./zram-generator.nix;
zrepl = handleTest ./zrepl.nix {}; zrepl = runTest ./zrepl.nix;
zsh-history = handleTest ./zsh-history.nix {}; zsh-history = runTest ./zsh-history.nix;
zwave-js = handleTest ./zwave-js.nix {}; zwave-js = runTest ./zwave-js.nix;
zwave-js-ui = handleTest ./zwave-js-ui.nix {}; zwave-js-ui = runTest ./zwave-js-ui.nix;
} }

View file

@ -1,5 +1,4 @@
import ./make-test-python.nix ( { lib, ... }:
{ pkgs, lib, ... }:
{ {
name = "xandikos"; name = "xandikos";
@ -70,4 +69,3 @@ import ./make-test-python.nix (
) )
''; '';
} }
)

View file

@ -1,6 +1,3 @@
import ./make-test-python.nix (
{ pkgs, lib, ... }:
{ {
name = "xautolock"; name = "xautolock";
meta.maintainers = [ ]; meta.maintainers = [ ];
@ -24,4 +21,3 @@ import ./make-test-python.nix (
machine.succeed("pgrep xlock") machine.succeed("pgrep xlock")
''; '';
} }
)

View file

@ -1,5 +1,3 @@
import ./make-test-python.nix (
{ pkgs, ... }:
{ {
name = "xfce-wayland"; name = "xfce-wayland";
@ -68,4 +66,3 @@ import ./make-test-python.nix (
machine.screenshot("screen") machine.screenshot("screen")
''; '';
} }
)

View file

@ -1,5 +1,3 @@
import ./make-test-python.nix (
{ pkgs, ... }:
{ {
name = "xfce"; name = "xfce";
@ -73,4 +71,3 @@ import ./make-test-python.nix (
machine.screenshot("screen") machine.screenshot("screen")
''; '';
} }
)

View file

@ -1,4 +1,3 @@
import ./make-test-python.nix (
{ lib, ... }: { lib, ... }:
{ {
name = "xmonad-xdg-autostart"; name = "xmonad-xdg-autostart";
@ -34,11 +33,10 @@ import ./make-test-python.nix (
testScript = testScript =
{ nodes, ... }: { nodes, ... }:
let let
user = nodes.machine.config.users.users.alice; user = nodes.machine.users.users.alice;
in in
'' ''
machine.wait_for_x() machine.wait_for_x()
machine.wait_for_file("${user.home}/xdg-autostart-executed") machine.wait_for_file("${user.home}/xdg-autostart-executed")
''; '';
} }
)

View file

@ -1,4 +1,3 @@
import ./make-test-python.nix (
{ pkgs, ... }: { pkgs, ... }:
let let
@ -84,7 +83,7 @@ import ./make-test-python.nix (
testScript = testScript =
{ nodes, ... }: { nodes, ... }:
let let
user = nodes.machine.config.users.users.alice; user = nodes.machine.users.users.alice;
in in
'' ''
machine.wait_for_x() machine.wait_for_x()
@ -128,4 +127,3 @@ import ./make-test-python.nix (
machine.wait_for_file("/tmp/somefile") machine.wait_for_file("/tmp/somefile")
''; '';
} }
)

View file

@ -1,4 +1,3 @@
import ./make-test-python.nix (
{ lib, pkgs, ... }: { lib, pkgs, ... }:
{ {
name = "xpadneo"; name = "xpadneo";
@ -18,4 +17,3 @@ import ./make-test-python.nix (
machine.succeed("modinfo hid_xpadneo | grep 'version:\s\+${pkgs.linuxPackages.xpadneo.version}'") machine.succeed("modinfo hid_xpadneo | grep 'version:\s\+${pkgs.linuxPackages.xpadneo.version}'")
''; '';
} }
)

View file

@ -1,4 +1,3 @@
import ./make-test-python.nix (
{ pkgs, ... }: { pkgs, ... }:
{ {
# How to interactively test this module if the audio actually works # How to interactively test this module if the audio actually works
@ -107,4 +106,3 @@ import ./make-test-python.nix (
client.screenshot("remoterdp") client.screenshot("remoterdp")
''; '';
} }
)

View file

@ -1,4 +1,3 @@
import ./make-test-python.nix (
{ pkgs, ... }: { pkgs, ... }:
{ {
name = "xrdp"; name = "xrdp";
@ -33,7 +32,7 @@ import ./make-test-python.nix (
testScript = testScript =
{ nodes, ... }: { nodes, ... }:
let let
user = nodes.client.config.users.users.alice; user = nodes.client.users.users.alice;
in in
'' ''
start_all() start_all()
@ -57,4 +56,3 @@ import ./make-test-python.nix (
client.screenshot("remoterdp") client.screenshot("remoterdp")
''; '';
} }
)

View file

@ -1,5 +1,3 @@
import ./make-test-python.nix (
{ pkgs, lib, ... }:
{ {
name = "xss-lock"; name = "xss-lock";
meta.maintainers = [ ]; meta.maintainers = [ ];
@ -51,4 +49,3 @@ import ./make-test-python.nix (
perform_xsslock_test(custom_lockcmd, "xlock") perform_xsslock_test(custom_lockcmd, "xlock")
''; '';
} }
)

View file

@ -1,4 +1,3 @@
import ./make-test-python.nix (
{ pkgs, ... }: { pkgs, ... }:
{ {
name = "xterm"; name = "xterm";
@ -6,9 +5,7 @@ import ./make-test-python.nix (
maintainers = [ nequissimus ]; maintainers = [ nequissimus ];
}; };
nodes.machine = nodes.machine = {
{ pkgs, ... }:
{
imports = [ ./common/x11.nix ]; imports = [ ./common/x11.nix ];
services.xserver.desktopManager.xterm.enable = false; services.xserver.desktopManager.xterm.enable = false;
}; };
@ -23,4 +20,3 @@ import ./make-test-python.nix (
machine.screenshot("window") machine.screenshot("window")
''; '';
} }
)

View file

@ -1,4 +1,3 @@
import ./make-test-python.nix (
{ pkgs, lib, ... }: { pkgs, lib, ... }:
let let
@ -73,4 +72,3 @@ import ./make-test-python.nix (
client.succeed("xxh server -i /root/.ssh/id_ecdsa +hc \'echo $0\' +i +s zsh +I xxh-shell-zsh+path+${xxh-shell-zsh} | grep -Fq '/root/.xxh/.xxh/shells/xxh-shell-zsh/build/zsh-bin/bin/zsh'") client.succeed("xxh server -i /root/.ssh/id_ecdsa +hc \'echo $0\' +i +s zsh +I xxh-shell-zsh+path+${xxh-shell-zsh} | grep -Fq '/root/.xxh/.xxh/shells/xxh-shell-zsh/build/zsh-bin/bin/zsh'")
''; '';
} }
)

View file

@ -1,5 +1,3 @@
import ./make-test-python.nix (
{ pkgs, lib, ... }:
{ {
name = "yabar"; name = "yabar";
meta.maintainers = [ ]; meta.maintainers = [ ];
@ -30,4 +28,3 @@ import ./make-test-python.nix (
machine.screenshot("top_bar") machine.screenshot("top_bar")
''; '';
} }
)

View file

@ -25,7 +25,6 @@ let
danIp6 = bobPrefix + "::2"; danIp6 = bobPrefix + "::2";
in in
import ./make-test-python.nix (
{ pkgs, ... }: { pkgs, ... }:
{ {
name = "yggdrasil"; name = "yggdrasil";
@ -33,7 +32,7 @@ import ./make-test-python.nix (
maintainers = [ gazally ]; maintainers = [ gazally ];
}; };
nodes = rec { nodes = {
# Alice is listening for peerings on a specified port, # Alice is listening for peerings on a specified port,
# but has multicast peering disabled. Alice has part of her # but has multicast peering disabled. Alice has part of her
# yggdrasil config in Nix and part of it in a file. # yggdrasil config in Nix and part of it in a file.
@ -106,9 +105,7 @@ import ./make-test-python.nix (
autoStart = true; autoStart = true;
privateNetwork = true; privateNetwork = true;
hostBridge = "br0"; hostBridge = "br0";
config = config = {
{ config, pkgs, ... }:
{
networking.interfaces.eth0.ipv6 = { networking.interfaces.eth0.ipv6 = {
addresses = [ addresses = [
{ {
@ -194,4 +191,3 @@ import ./make-test-python.nix (
carol.succeed("curl --fail -g http://[${danIp6}]") carol.succeed("curl --fail -g http://[${danIp6}]")
''; '';
} }
)

View file

@ -1,4 +1,3 @@
import ./make-test-python.nix (
{ pkgs, ... }: { pkgs, ... }:
{ {
name = "your_spotify"; name = "your_spotify";
@ -33,4 +32,3 @@ import ./make-test-python.nix (
assert "<title>Your Spotify</title>" in out assert "<title>Your Spotify</title>" in out
''; '';
} }
)

View file

@ -1,4 +1,3 @@
import ./make-test-python.nix (
{ lib, pkgs, ... }: { lib, pkgs, ... }:
{ {
@ -9,9 +8,7 @@ import ./make-test-python.nix (
netali netali
]; ];
nodes.machine = nodes.machine = {
{ config, ... }:
{
virtualisation = { virtualisation = {
memorySize = 2048; memorySize = 2048;
}; };
@ -39,4 +36,3 @@ import ./make-test-python.nix (
) )
''; '';
} }
)

View file

@ -1,4 +1,3 @@
import ./make-test-python.nix (
{ pkgs, lib, ... }: { pkgs, lib, ... }:
{ {
@ -9,7 +8,6 @@ import ./make-test-python.nix (
router = router =
{ {
pkgs, pkgs,
lib,
config, config,
... ...
}: }:
@ -90,4 +88,3 @@ import ./make-test-python.nix (
client.succeed(f"curl router:8000/{be}/test | grep hello") client.succeed(f"curl router:8000/{be}/test | grep hello")
''; '';
} }
)

View file

@ -1,16 +1,18 @@
{
lib,
...
}:
let let
port = 43110; port = 43110;
in in
import ./make-test-python.nix (
{ pkgs, ... }:
{ {
name = "zeronet-conservancy"; name = "zeronet-conservancy";
meta = with pkgs.lib.maintainers; { meta = with lib.maintainers; {
maintainers = [ fgaz ]; maintainers = [ fgaz ];
}; };
nodes.machine = nodes.machine =
{ config, pkgs, ... }: { pkgs, ... }:
{ {
services.zeronet = { services.zeronet = {
enable = true; enable = true;
@ -27,4 +29,3 @@ import ./make-test-python.nix (
machine.succeed("curl --fail -H 'Accept: text/html, application/xml, */*' localhost:${toString port}/Stats") machine.succeed("curl --fail -H 'Accept: text/html, application/xml, */*' localhost:${toString port}/Stats")
''; '';
} }
)

View file

@ -1,4 +1,3 @@
import ./make-test-python.nix (
{ lib, ... }: { lib, ... }:
{ {
name = "zipline"; name = "zipline";
@ -41,4 +40,3 @@ import ./make-test-python.nix (
assert json.loads(resp)["user"]["id"] == data["user"]["id"] assert json.loads(resp)["user"]["id"] == data["user"]["id"]
''; '';
} }
)

View file

@ -1,4 +1,3 @@
import ./make-test-python.nix (
{ lib, ... }: { lib, ... }:
{ {
@ -23,4 +22,3 @@ import ./make-test-python.nix (
machine.succeed("curl --fail http://localhost:8095/") machine.succeed("curl --fail http://localhost:8095/")
''; '';
} }
)

View file

@ -1,4 +1,3 @@
import ./make-test-python.nix (
{ pkgs, ... }: { pkgs, ... }:
let let
@ -51,4 +50,3 @@ import ./make-test-python.nix (
) )
''; '';
} }
)

View file

@ -1,4 +1,4 @@
import ./make-test-python.nix { {
name = "zram-generator"; name = "zram-generator";
nodes = { nodes = {

View file

@ -1,8 +1,8 @@
import ./make-test-python.nix ({ {
name = "zrepl"; name = "zrepl";
nodes.host = nodes.host =
{ config, pkgs, ... }: { pkgs, ... }:
{ {
config = { config = {
# Prerequisites for ZFS and tests. # Prerequisites for ZFS and tests.
@ -73,4 +73,4 @@ import ./make-test-python.nix ({
"zrepl_zfs_snapshot_duration_count{filesystem=\"test\"}" in out "zrepl_zfs_snapshot_duration_count{filesystem=\"test\"}" in out
), "zrepl snapshot counter for test was not found in Prometheus output" ), "zrepl snapshot counter for test was not found in Prometheus output"
''; '';
}) }

View file

@ -1,4 +1,3 @@
import ./make-test-python.nix (
{ pkgs, ... }: { pkgs, ... }:
{ {
name = "zsh-history"; name = "zsh-history";
@ -37,4 +36,3 @@ import ./make-test-python.nix (
default.succeed("/run/current-system/sw/bin/history list | grep -q foobar") default.succeed("/run/current-system/sw/bin/history list | grep -q foobar")
''; '';
} }
)

View file

@ -1,4 +1,3 @@
import ./make-test-python.nix (
{ lib, ... }: { lib, ... }:
{ {
name = "zwave-js-ui"; name = "zwave-js-ui";
@ -28,4 +27,3 @@ import ./make-test-python.nix (
machine.wait_for_file("/var/lib/zwave-js-ui/users.json") machine.wait_for_file("/var/lib/zwave-js-ui/users.json")
''; '';
} }
)

View file

@ -1,4 +1,3 @@
import ./make-test-python.nix (
{ pkgs, lib, ... }: { pkgs, lib, ... }:
let let
@ -15,9 +14,7 @@ import ./make-test-python.nix (
meta.maintainers = with lib.maintainers; [ graham33 ]; meta.maintainers = with lib.maintainers; [ graham33 ];
nodes = { nodes = {
machine = machine = {
{ config, ... }:
{
services.zwave-js = { services.zwave-js = {
enable = true; enable = true;
serialPort = "/dev/null"; serialPort = "/dev/null";
@ -35,4 +32,3 @@ import ./make-test-python.nix (
machine.wait_until_succeeds("journalctl --since -1m --unit zwave-js --grep 'ZwaveJS server listening'") machine.wait_until_succeeds("journalctl --since -1m --unit zwave-js --grep 'ZwaveJS server listening'")
''; '';
} }
)