diff options
author | Euan Kemp <euank@euank.com> | 2021-10-23 18:05:32 -0700 |
---|---|---|
committer | Euan Kemp <euank@euank.com> | 2021-10-23 18:06:09 -0700 |
commit | 3210ce7784cb462659e7b0d29db8c40bd7b7e99f (patch) | |
tree | 721dc2f6c85db2bf178cc8e6db215b7cfc8f7aa3 | |
parent | b1a41bb3e87086a488ad060b510a54991a31d521 (diff) | |
download | nixpkgs-3210ce7784cb462659e7b0d29db8c40bd7b7e99f.tar nixpkgs-3210ce7784cb462659e7b0d29db8c40bd7b7e99f.tar.gz nixpkgs-3210ce7784cb462659e7b0d29db8c40bd7b7e99f.tar.bz2 nixpkgs-3210ce7784cb462659e7b0d29db8c40bd7b7e99f.tar.lz nixpkgs-3210ce7784cb462659e7b0d29db8c40bd7b7e99f.tar.xz nixpkgs-3210ce7784cb462659e7b0d29db8c40bd7b7e99f.tar.zst nixpkgs-3210ce7784cb462659e7b0d29db8c40bd7b7e99f.zip |
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.
-rw-r--r-- | nixos/tests/k3s.nix | 9 |
1 files 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() ''; }) |