nixosTests.zsh-history: migrate to runTest

Part Of #386873

Changed files
+33 -35
nixos
+1 -1
nixos/tests/all-tests.nix
···
zookeeper = handleTest ./zookeeper.nix {};
zram-generator = handleTest ./zram-generator.nix {};
zrepl = handleTest ./zrepl.nix {};
-
zsh-history = handleTest ./zsh-history.nix {};
+
zsh-history = runTest ./zsh-history.nix;
zwave-js = runTest ./zwave-js.nix;
zwave-js-ui = runTest ./zwave-js-ui.nix;
+32 -34
nixos/tests/zsh-history.nix
···
-
import ./make-test-python.nix (
-
{ pkgs, ... }:
-
{
-
name = "zsh-history";
-
meta = with pkgs.lib.maintainers; {
-
maintainers = [ ];
-
};
+
{ pkgs, ... }:
+
{
+
name = "zsh-history";
+
meta = with pkgs.lib.maintainers; {
+
maintainers = [ ];
+
};
-
nodes.default =
-
{ ... }:
-
{
-
programs = {
-
zsh.enable = true;
-
};
-
environment.systemPackages = [ pkgs.zsh-history ];
-
programs.zsh.interactiveShellInit = ''
-
source ${pkgs.zsh-history.out}/share/zsh/init.zsh
-
'';
-
users.users.root.shell = "${pkgs.zsh}/bin/zsh";
+
nodes.default =
+
{ ... }:
+
{
+
programs = {
+
zsh.enable = true;
};
+
environment.systemPackages = [ pkgs.zsh-history ];
+
programs.zsh.interactiveShellInit = ''
+
source ${pkgs.zsh-history.out}/share/zsh/init.zsh
+
'';
+
users.users.root.shell = "${pkgs.zsh}/bin/zsh";
+
};
-
testScript = ''
-
start_all()
-
default.wait_for_unit("multi-user.target")
-
default.wait_until_succeeds("pgrep -f 'agetty.*tty1'")
+
testScript = ''
+
start_all()
+
default.wait_for_unit("multi-user.target")
+
default.wait_until_succeeds("pgrep -f 'agetty.*tty1'")
-
# Login
-
default.wait_until_tty_matches("1", "login: ")
-
default.send_chars("root\n")
-
default.wait_until_tty_matches("1", r"\nroot@default\b")
+
# Login
+
default.wait_until_tty_matches("1", "login: ")
+
default.send_chars("root\n")
+
default.wait_until_tty_matches("1", r"\nroot@default\b")
-
# Generate some history
-
default.send_chars("echo foobar\n")
-
default.wait_until_tty_matches("1", "foobar")
+
# Generate some history
+
default.send_chars("echo foobar\n")
+
default.wait_until_tty_matches("1", "foobar")
-
# Ensure that command was recorded in history
-
default.succeed("/run/current-system/sw/bin/history list | grep -q foobar")
-
'';
-
}
-
)
+
# Ensure that command was recorded in history
+
default.succeed("/run/current-system/sw/bin/history list | grep -q foobar")
+
'';
+
}