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

View file

@ -1,5 +1,4 @@
import ./make-test-python.nix (
{ pkgs, lib, ... }:
{ lib, ... }:
{
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";
meta.maintainers = [ ];
@ -24,4 +21,3 @@ import ./make-test-python.nix (
machine.succeed("pgrep xlock")
'';
}
)

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,4 +1,3 @@
import ./make-test-python.nix (
{ pkgs, lib, ... }:
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'")
'';
}
)

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,16 +1,18 @@
{
lib,
...
}:
let
port = 43110;
in
import ./make-test-python.nix (
{ pkgs, ... }:
{
name = "zeronet-conservancy";
meta = with pkgs.lib.maintainers; {
meta = with lib.maintainers; {
maintainers = [ fgaz ];
};
nodes.machine =
{ config, pkgs, ... }:
{ pkgs, ... }:
{
services.zeronet = {
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")
'';
}
)

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,4 +1,3 @@
import ./make-test-python.nix (
{ pkgs, lib, ... }:
let
@ -15,9 +14,7 @@ import ./make-test-python.nix (
meta.maintainers = with lib.maintainers; [ graham33 ];
nodes = {
machine =
{ config, ... }:
{
machine = {
services.zwave-js = {
enable = true;
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'")
'';
}
)