tests: auto-login with getty

This commit is contained in:
Donovan Glover 2024-10-15 23:01:19 -04:00
parent 5db3da85a3
commit db75a7e29a
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65

View File

@ -6,7 +6,7 @@ self.inputs.nixpkgs.lib.nixos.runTest {
node.specialArgs.nix-config = self;
nodes.machine =
{ nix-config, ... }:
{ nix-config, config, ... }:
{
imports = with nix-config.nixosModules; [
shell
@ -16,21 +16,14 @@ self.inputs.nixpkgs.lib.nixos.runTest {
home-manager.sharedModules = with nix-config.homeModules; [
neovim
];
services.getty.autologinUser = config.modules.system.username;
};
testScript = # python
''
machine.wait_for_unit("default.target")
machine.send_chars("user")
machine.sleep(1)
machine.send_key("ret")
machine.sleep(1)
machine.send_chars("user")
machine.sleep(1)
machine.send_key("ret")
machine.sleep(5)
machine.send_chars("nvim hello.txt")
machine.sleep(1)
machine.send_key("ret")