mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-27 05:43:50 +03:00
nixosTests.tuptime: init test
This commit is contained in:
parent
b29d48acfb
commit
b7b99c93f5
@ -308,6 +308,7 @@ in
|
||||
trilium-server = handleTestOn ["x86_64-linux"] ./trilium-server.nix {};
|
||||
trezord = handleTest ./trezord.nix {};
|
||||
trickster = handleTest ./trickster.nix {};
|
||||
tuptime = handleTest ./tuptime.nix {};
|
||||
udisks2 = handleTest ./udisks2.nix {};
|
||||
upnp = handleTest ./upnp.nix {};
|
||||
uwsgi = handleTest ./uwsgi.nix {};
|
||||
|
29
nixos/tests/tuptime.nix
Normal file
29
nixos/tests/tuptime.nix
Normal file
@ -0,0 +1,29 @@
|
||||
import ./make-test-python.nix ({ pkgs, ...} : {
|
||||
name = "tuptime";
|
||||
meta = with pkgs.stdenv.lib.maintainers; {
|
||||
maintainers = [ evils ];
|
||||
};
|
||||
|
||||
machine = { pkgs, ... }: {
|
||||
imports = [ ../modules/profiles/minimal.nix ];
|
||||
services.tuptime.enable = true;
|
||||
};
|
||||
|
||||
testScript =
|
||||
''
|
||||
# see if it starts
|
||||
start_all()
|
||||
machine.wait_for_unit("multi-user.target")
|
||||
machine.succeed("tuptime | grep 'System startups:[[:blank:]]*1'")
|
||||
machine.succeed("tuptime | grep 'System uptime:[[:blank:]]*100.0%'")
|
||||
machine.shutdown()
|
||||
|
||||
# restart machine and see if it correctly reports the reboot
|
||||
machine.start()
|
||||
machine.wait_for_unit("multi-user.target")
|
||||
machine.succeed("tuptime | grep 'System startups:[[:blank:]]*2'")
|
||||
machine.succeed("tuptime | grep 'System shutdowns:[[:blank:]]*1 ok'")
|
||||
machine.shutdown()
|
||||
'';
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user