at 25.11-pre 918 B view raw
1import ./make-test-python.nix ( 2 { pkgs, ... }: 3 { 4 name = "tuptime"; 5 meta = with pkgs.lib.maintainers; { 6 maintainers = [ evils ]; 7 }; 8 9 nodes.machine = 10 { pkgs, ... }: 11 { 12 imports = [ ../modules/profiles/minimal.nix ]; 13 services.tuptime.enable = true; 14 }; 15 16 testScript = '' 17 # see if it starts 18 start_all() 19 machine.wait_for_unit("multi-user.target") 20 machine.succeed("tuptime | grep 'System startups:[[:blank:]]*1'") 21 machine.succeed("tuptime | grep 'System uptime:[[:blank:]]*100.0%'") 22 machine.shutdown() 23 24 # restart machine and see if it correctly reports the reboot 25 machine.start() 26 machine.wait_for_unit("multi-user.target") 27 machine.succeed("tuptime | grep 'System startups:[[:blank:]]*2'") 28 machine.succeed("tuptime | grep 'System shutdowns:[[:blank:]]*1 ok'") 29 machine.shutdown() 30 ''; 31 } 32)