kubernetes: fix flaky test and run tests as group

This commit is contained in:
Alexandru Scvortov 2021-07-30 16:16:23 +01:00
parent 13aa001562
commit 8afd31c625
9 changed files with 34 additions and 15 deletions

View File

@ -84,6 +84,9 @@ in
Restart = "on-failure";
RestartSec = 10;
};
unitConfig = {
StartLimitIntervalSec = 0;
};
};
services.kubernetes.addonManager.bootstrapAddons = mkIf isRBACEnabled

View File

@ -398,6 +398,10 @@ in
Restart = "on-failure";
RestartSec = 5;
};
unitConfig = {
StartLimitIntervalSec = 0;
};
};
services.etcd = {

View File

@ -146,6 +146,9 @@ in
User = "kubernetes";
Group = "kubernetes";
};
unitConfig = {
StartLimitIntervalSec = 0;
};
path = top.path;
};

View File

@ -337,6 +337,9 @@ in
'';
WorkingDirectory = top.dataDir;
};
unitConfig = {
StartLimitIntervalSec = 0;
};
};
# Allways include cni plugins

View File

@ -77,6 +77,9 @@ in
Restart = "on-failure";
RestartSec = 5;
};
unitConfig = {
StartLimitIntervalSec = 0;
};
};
services.kubernetes.proxy.hostname = with config.networking; mkDefault hostName;

View File

@ -79,6 +79,9 @@ in
Restart = "on-failure";
RestartSec = 5;
};
unitConfig = {
StartLimitIntervalSec = 0;
};
};
services.kubernetes.pki.certs = {

View File

@ -220,10 +220,7 @@ in
knot = handleTest ./knot.nix {};
krb5 = discoverTests (import ./krb5 {});
ksm = handleTest ./ksm.nix {};
kubernetes.dns = handleTestOn ["x86_64-linux"] ./kubernetes/dns.nix {};
# kubernetes.e2e should eventually replace kubernetes.rbac when it works
#kubernetes.e2e = handleTestOn ["x86_64-linux"] ./kubernetes/e2e.nix {};
kubernetes.rbac = handleTestOn ["x86_64-linux"] ./kubernetes/rbac.nix {};
kubernetes = handleTestOn ["x86_64-linux"] ./kubernetes {};
latestKernel.hardened = handleTest ./hardened.nix { latestKernel = true; };
latestKernel.login = handleTest ./login.nix { latestKernel = true; };
leaps = handleTest ./leaps.nix {};

View File

@ -1,7 +1,15 @@
{ system ? builtins.currentSystem }:
{ system ? builtins.currentSystem
, pkgs ? import <nixpkgs> { inherit system; }
}:
let
dns = import ./dns.nix { inherit system pkgs; };
rbac = import ./rbac.nix { inherit system pkgs; };
# TODO kubernetes.e2e should eventually replace kubernetes.rbac when it works
# e2e = import ./e2e.nix { inherit system pkgs; };
in
{
dns = import ./dns.nix { inherit system; };
# e2e = import ./e2e.nix { inherit system; }; # TODO: make it pass
# the following test(s) can be removed when e2e is working:
rbac = import ./rbac.nix { inherit system; };
dns-single-node = dns.singlenode.test;
dns-multi-node = dns.multinode.test;
rbac-single-node = rbac.singlenode.test;
rbac-multi-node = rbac.multinode.test;
}

View File

@ -97,10 +97,5 @@ stdenv.mkDerivation rec {
platforms = platforms.unix;
};
passthru.tests = with nixosTests.kubernetes; {
dns-single-node = dns.singlenode;
dns-multi-node = dns.multinode;
rbac-single-node = rbac.singlenode;
rbac-multi-node = rbac.multinode;
};
passthru.tests = nixosTests.kubernetes;
}