nixos/irqbalance: add nixos test
This commit is contained in:
@@ -765,6 +765,7 @@ in
|
||||
invoiceplane = runTest ./invoiceplane.nix;
|
||||
iodine = runTest ./iodine.nix;
|
||||
ipv6 = runTest ./ipv6.nix;
|
||||
irqbalance = runTest ./irqbalance.nix;
|
||||
iscsi-multipath-root = runTest ./iscsi-multipath-root.nix;
|
||||
iscsi-root = runTest ./iscsi-root.nix;
|
||||
isso = runTest ./isso.nix;
|
||||
|
||||
29
nixos/tests/irqbalance.nix
Normal file
29
nixos/tests/irqbalance.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
name = "irqbalance";
|
||||
meta.maintainers = with lib.maintainers; [ h7x4 ];
|
||||
|
||||
nodes.machine =
|
||||
{ config, ... }:
|
||||
{
|
||||
virtualisation.cores = 2;
|
||||
services.irqbalance.enable = true;
|
||||
|
||||
systemd.services.irqbalance.serviceConfig.ExecStart = [
|
||||
""
|
||||
"${lib.getExe config.services.irqbalance.package} --journal --debug"
|
||||
];
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
machine.wait_for_unit("irqbalance.service")
|
||||
|
||||
machine.wait_until_succeeds("journalctl -u irqbalance.service --grep='Package 0'")
|
||||
|
||||
unmanaged_irq_count = machine.succeed("journalctl -u irqbalance.service -o cat --grep 'affinity is now unmanaged' | sort -u | wc -l")
|
||||
|
||||
# The number of unmanaged IRQs is not entirely stable, but there is likely something
|
||||
# wrong if any more that 2 queues are unmanaged
|
||||
assert int(unmanaged_irq_count) <= 2
|
||||
'';
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
libcap_ng,
|
||||
enableSystemd ? lib.meta.availableOn stdenv.hostPlatform systemdMinimal,
|
||||
systemdMinimal,
|
||||
nixosTests,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
@@ -48,6 +49,8 @@ stdenv.mkDerivation rec {
|
||||
--replace-fail ' $IRQBALANCE_ARGS' ""
|
||||
'';
|
||||
|
||||
passthru.tests.nixos = nixosTests.irqbalance;
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/Irqbalance/irqbalance";
|
||||
changelog = lib.strings.optionalString (
|
||||
|
||||
Reference in New Issue
Block a user