From 3210ce7784cb462659e7b0d29db8c40bd7b7e99f Mon Sep 17 00:00:00 2001 From: Euan Kemp Date: Sat, 23 Oct 2021 18:05:32 -0700 Subject: nixos/tests/k3s: cleanly shutdown on test success When this test was written, I don't think the explicit '.shutdown' was required, but it is now. Do so. --- nixos/tests/k3s.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nixos/tests/k3s.nix b/nixos/tests/k3s.nix index 494a3b68b59..3d1584fa2e2 100644 --- a/nixos/tests/k3s.nix +++ b/nixos/tests/k3s.nix @@ -8,9 +8,9 @@ let contents = with pkgs; [ tini coreutils busybox ]; config.Entrypoint = [ "/bin/tini" "--" "/bin/sleep" "inf" ]; }; + # Don't use the default service account because there's a race where it may + # not be created yet; make our own instead. testPodYaml = pkgs.writeText "test.yml" '' - # Don't use the default service account because there's a race where it may - # not be created yet; make our own instead. apiVersion: v1 kind: ServiceAccount metadata: @@ -38,7 +38,7 @@ in nodes = { k3s = { pkgs, ... }: { - environment.systemPackages = [ pkgs.k3s pkgs.gzip ]; + environment.systemPackages = with pkgs; [ k3s gzip ]; # k3s uses enough resources the default vm fails. virtualisation.memorySize = pkgs.lib.mkDefault 1536; @@ -74,5 +74,8 @@ in k3s.succeed("k3s kubectl apply -f ${testPodYaml}") k3s.succeed("k3s kubectl wait --for 'condition=Ready' pod/test") + k3s.succeed("k3s kubectl delete -f ${testPodYaml}") + + k3s.shutdown() ''; }) -- cgit 1.4.1