nixos/tests/zsh-history: Fix matching prompt
In commit fbbaa4d40f73a5350671f286b07ab3dc58f07321, 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>
commit3895ec33adaf692e50eecd2d347c55f81ab7da10
authoraszlig <aszlig@nix.build>
dateFri 2 Jul 2021, 20:45 (5 years ago)
parenta143a6d
nixos/tests/zsh-history.nix+1−1
@@ -23,7 +23,7 @@ import ./make-test-python.nix ({ pkgs, ...} : {
2323 # Login
2424 default.wait_until_tty_matches(1, "login: ")
2525 default.send_chars("root\n")
26− default.wait_until_tty_matches(1, "root@default>")
26+ default.wait_until_tty_matches(1, r"\nroot@default\b")
2727
2828 # Generate some history
2929 default.send_chars("echo foobar\n")