Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

login test: Create and use direct reads of the TTY contents. #20808

Merged
merged 1 commit into from
Nov 30, 2016

Conversation

grahamc
Copy link
Member

@grahamc grahamc commented Nov 30, 2016

Motivation for this change

The login test for 16.09 has been failing lately, for no good reason. It appears that the typing for the username alice is too soon, causing this failure. This is hard to test, since it depends on the system being under load.

I added test primitives to access the raw TTY memory and see what is on the TTY. This could possibly be used to stabilize other tests, too.

Here is an example of where the retry helped prevent a race condition:

machine: sending keys ‘alice
’
machine: sending monitor command: sendkey a
machine: sending monitor command: sendkey l
machine: sending monitor command: sendkey i
machine: sending monitor command: sendkey c
machine: sending monitor command: sendkey e
machine: sending monitor command: sendkey ret
machine: waiting for login: alice to appear on tty 2
machine: running command: fold -w 80 /dev/vcs2
machine: exit status 0
machine: running command: fold -w 80 /dev/vcs2
machine: exit status 0
Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Sorry, something went wrong.

@grahamc grahamc added 0.kind: enhancement Add something new 9.needs: port to stable A PR needs a backport to the stable release. labels Nov 30, 2016
@mention-bot
Copy link

@grahamc, thanks for your PR! By analyzing the history of the files in this pull request, we identified @edolstra, @aszlig and @bobvanderlinden to be potential reviewers.

Verified

This commit was signed with the committer’s verified signature. The key has expired.
grahamc Graham Christensen
@grahamc
Copy link
Member Author

grahamc commented Nov 30, 2016

Got a +1 from Eelco on IRC a few minutes ago.

@grahamc grahamc merged commit b28d21f into NixOS:master Nov 30, 2016
@grahamc grahamc deleted the fancy-test-tty branch November 30, 2016 16:27
@samueldr samueldr removed the 9.needs: port to stable A PR needs a backport to the stable release. label Apr 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: enhancement Add something new
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants