at 25.11-pre 1.5 kB view raw
1import ./make-test-python.nix ( 2 { 3 pkgs, 4 latestKernel ? false, 5 ... 6 }: 7 { 8 name = "greetd-no-shadow"; 9 meta = with pkgs.lib.maintainers; { 10 maintainers = [ ]; 11 }; 12 13 nodes.machine = 14 { pkgs, lib, ... }: 15 { 16 17 users.users.alice = { 18 isNormalUser = true; 19 group = "alice"; 20 password = "foobar"; 21 }; 22 users.groups.alice = { }; 23 24 # This means login(1) breaks, so we must use greetd/agreety instead. 25 security.shadow.enable = false; 26 27 services.greetd = { 28 enable = true; 29 settings = { 30 default_session = { 31 command = "${pkgs.greetd.greetd}/bin/agreety --cmd bash"; 32 }; 33 }; 34 }; 35 }; 36 37 testScript = '' 38 machine.start() 39 40 machine.wait_for_unit("multi-user.target") 41 machine.wait_until_succeeds("pgrep -f 'agretty.*tty1'") 42 machine.screenshot("postboot") 43 44 with subtest("Log in as alice on a virtual console"): 45 machine.wait_until_tty_matches("1", "login: ") 46 machine.send_chars("alice\n") 47 machine.wait_until_tty_matches("1", "login: alice") 48 machine.wait_until_succeeds("pgrep login") 49 machine.wait_until_tty_matches("1", "Password: ") 50 machine.send_chars("foobar\n") 51 machine.wait_until_succeeds("pgrep -u alice bash") 52 machine.send_chars("touch done\n") 53 machine.wait_for_file("/home/alice/done") 54 ''; 55 } 56)