mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 14:26:33 +01:00
3895ec33ad
In commit fbbaa4d40f
, the Zsh default
prompt has changed from "walters" to "suse". So instead of:
root@default>
... we now have:
root@default:~/ >
However, in the NixOS VM test, we are matching "root@default>", which
doesn't include the current working directory and thus eventually leads
to a test failure after timing out.
To fix this, I changed the regex to include a newline at the beginning
and made sure that the hostname ends with a word boundary. This way it
doesn't matter whether the prompt is "walters" or "suse", because after
all the test is not about the prompt but about whether the history
mechanism works (or not).
Signed-off-by: aszlig <aszlig@nix.build>
35 lines
988 B
Nix
35 lines
988 B
Nix
import ./make-test-python.nix ({ 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";
|
|
};
|
|
|
|
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")
|
|
|
|
# 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")
|
|
'';
|
|
})
|