python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / nixos / tests / user-activation-scripts.nix
blob5df072ce0508a9837bf98b5e0bcdfd05732fa83d
1 import ./make-test-python.nix ({ lib, ... }: {
2   name = "user-activation-scripts";
3   meta = with lib.maintainers; { maintainers = [ chkno ]; };
5   nodes.machine = {
6     system.userActivationScripts.foo = "mktemp ~/user-activation-ran.XXXXXX";
7     users.users.alice = {
8       initialPassword = "pass1";
9       isNormalUser = true;
10     };
11   };
13   testScript = ''
14     def verify_user_activation_run_count(n):
15         machine.succeed(
16             '[[ "$(find /home/alice/ -name user-activation-ran.\\* | wc -l)" == %s ]]' % n
17         )
20     machine.wait_for_unit("multi-user.target")
21     machine.wait_for_unit("getty@tty1.service")
22     machine.wait_until_tty_matches("1", "login: ")
23     machine.send_chars("alice\n")
24     machine.wait_until_tty_matches("1", "Password: ")
25     machine.send_chars("pass1\n")
26     machine.send_chars("touch login-ok\n")
27     machine.wait_for_file("/home/alice/login-ok")
28     verify_user_activation_run_count(1)
30     machine.succeed("/run/current-system/bin/switch-to-configuration test")
31     verify_user_activation_run_count(2)
32   '';