nixos/tests/atop: fix version regex, add timeout

This commit is contained in:
ghpzin 2024-08-19 23:04:24 +03:00
parent 64481d023a
commit 6acc9befef
No known key found for this signature in database

View File

@ -24,7 +24,7 @@ let assertions = rec {
with subtest("binary should report the correct version"): with subtest("binary should report the correct version"):
pkgver = "${pkgs.atop.version}" pkgver = "${pkgs.atop.version}"
ver = re.sub(r'(?s)^Version: (\d\.\d\.\d).*', r'\1', machine.succeed("atop -V")) ver = re.sub(r'(?s)^Version: (\d+\.\d+\.\d+).*', r'\1', machine.succeed("atop -V"))
assert ver == pkgver, f"Version is `{ver}`, expected `{pkgver}`" assert ver == pkgver, f"Version is `{ver}`, expected `{pkgver}`"
''; '';
atoprc = contents: atoprc = contents:
@ -103,6 +103,9 @@ let assertions = rec {
machine.fail("type -p atopgpud") machine.fail("type -p atopgpud")
''; '';
}; };
meta = {
timeout = 600;
};
in in
{ {
justThePackage = makeTest { justThePackage = makeTest {
@ -120,6 +123,7 @@ in
(netatop false) (netatop false)
(atopgpu false) (atopgpu false)
]; ];
inherit meta;
}; };
defaults = makeTest { defaults = makeTest {
name = "atop-defaults"; name = "atop-defaults";
@ -138,6 +142,7 @@ in
(netatop false) (netatop false)
(atopgpu false) (atopgpu false)
]; ];
inherit meta;
}; };
minimal = makeTest { minimal = makeTest {
name = "atop-minimal"; name = "atop-minimal";
@ -159,6 +164,7 @@ in
(netatop false) (netatop false)
(atopgpu false) (atopgpu false)
]; ];
inherit meta;
}; };
netatop = makeTest { netatop = makeTest {
name = "atop-netatop"; name = "atop-netatop";
@ -178,6 +184,7 @@ in
(netatop true) (netatop true)
(atopgpu false) (atopgpu false)
]; ];
inherit meta;
}; };
atopgpu = makeTest { atopgpu = makeTest {
name = "atop-atopgpu"; name = "atop-atopgpu";
@ -197,6 +204,7 @@ in
(netatop false) (netatop false)
(atopgpu true) (atopgpu true)
]; ];
inherit meta;
}; };
everything = makeTest { everything = makeTest {
name = "atop-everything"; name = "atop-everything";
@ -222,5 +230,6 @@ in
(netatop true) (netatop true)
(atopgpu true) (atopgpu true)
]; ];
inherit meta;
}; };
} }