nixosTests.kmscon: improve term test

This commit is contained in:
ccicnce113424
2026-02-10 09:33:13 +08:00
parent 06d12de35a
commit 8eee01e480
+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")
'';
}