nixos/tests/zsh-history: Fix matching prompt

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>
launchpad/nixpkgs/master
aszlig 3 years ago
parent a143a6dd34
commit 3895ec33ad
No known key found for this signature in database
GPG Key ID: 684089CE67EBB691
  1. 2
      nixos/tests/zsh-history.nix

@ -23,7 +23,7 @@ import ./make-test-python.nix ({ pkgs, ...} : {
# Login
default.wait_until_tty_matches(1, "login: ")
default.send_chars("root\n")
default.wait_until_tty_matches(1, "root@default>")
default.wait_until_tty_matches(1, r"\nroot@default\b")
# Generate some history
default.send_chars("echo foobar\n")

Loading…
Cancel
Save