nixosTests.kmscon: improve term test (#488919)

This commit is contained in:
Yohann Boniface
2026-02-10 22:38:59 +00:00
committed by GitHub
+8 -2
View File
@@ -33,12 +33,18 @@
with subtest("ensure we can open a tty"):
machine.wait_for_text("machine login:")
machine.send_chars("alice\n")
machine.wait_for_text("Password:")
machine.send_chars("foobar\n")
machine.wait_for_text("alice@machine")
machine.send_chars("echo $TERM\n")
machine.wait_for_text("xterm-256color")
machine.send_chars("echo $TERM | tee /tmp/term.txt\n")
machine.wait_until_succeeds("test -s /tmp/term.txt")
term = machine.succeed("cat /tmp/term.txt").strip()
assert term == "xterm-256color", f"Unexpected TERM value: {term!r}"
machine.screenshot("tty.png")
'';
}