about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2021-07-02 20:45:35 +0200
committeraszlig <aszlig@nix.build>2021-07-02 21:01:49 +0200
commit3895ec33adaf692e50eecd2d347c55f81ab7da10 (patch)
treee2471dc5713a580ddce9e6c6f38cb1bef061092d /nixos
parenta143a6dd34cd72fe24962988c7eccb97b1173fac (diff)
downloadnixlib-3895ec33adaf692e50eecd2d347c55f81ab7da10.tar
nixlib-3895ec33adaf692e50eecd2d347c55f81ab7da10.tar.gz
nixlib-3895ec33adaf692e50eecd2d347c55f81ab7da10.tar.bz2
nixlib-3895ec33adaf692e50eecd2d347c55f81ab7da10.tar.lz
nixlib-3895ec33adaf692e50eecd2d347c55f81ab7da10.tar.xz
nixlib-3895ec33adaf692e50eecd2d347c55f81ab7da10.tar.zst
nixlib-3895ec33adaf692e50eecd2d347c55f81ab7da10.zip
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>
Diffstat (limited to 'nixos')
-rw-r--r--nixos/tests/zsh-history.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/tests/zsh-history.nix b/nixos/tests/zsh-history.nix
index 3109c3f65081..355687798406 100644
--- a/nixos/tests/zsh-history.nix
+++ b/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")