mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-11-06 02:06:46 +01:00
25bef2d8f9
The library does not depend on stdenv, that `stdenv` exposes `lib` is an artifact of the ancient origins of nixpkgs.
30 lines
873 B
Nix
30 lines
873 B
Nix
import ./make-test-python.nix ({ pkgs, ...} : {
|
|
name = "tuptime";
|
|
meta = with pkgs.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()
|
|
'';
|
|
})
|
|
|