about summary refs log tree commit diff
path: root/pkgs/applications/networking/cluster/rke2/default.nix
diff options
context:
space:
mode:
authorMogeko <zhengjunyi@live.com>2024-05-11 06:50:27 +0200
committerMogeko <zhengjunyi@live.com>2024-05-28 12:39:38 +0800
commitb8e5799a635291007d2fdbed704e84a76294223d (patch)
treecbbbb4a84bd0eee028ba184fb80885c42d4a8df9 /pkgs/applications/networking/cluster/rke2/default.nix
parenta642efcdab1402e45db5aa2bbff7b24322679219 (diff)
nixos/tests/rke2: add tests for single-node and multi-node
For multi-node test, create a 3-node cluster (2 server nodes and 1 agent node) to test the connection between nodes.

Setup `passthru.tests`.
Diffstat (limited to 'pkgs/applications/networking/cluster/rke2/default.nix')
-rw-r--r--pkgs/applications/networking/cluster/rke2/default.nix9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkgs/applications/networking/cluster/rke2/default.nix b/pkgs/applications/networking/cluster/rke2/default.nix
index a2ddd220dc939..2ac749148f0f0 100644
--- a/pkgs/applications/networking/cluster/rke2/default.nix
+++ b/pkgs/applications/networking/cluster/rke2/default.nix
@@ -58,6 +58,15 @@ buildGoModule rec {
 
   passthru.updateScript = nix-update-script { };
 
+  passthru.tests = {
+    version = testers.testVersion {
+      package = rke2;
+      version = "v${version}";
+    };
+  } // lib.optionalAttrs stdenv.isLinux {
+    inherit (nixosTests) rke2;
+  };
+
   meta = with lib; {
     homepage = "https://github.com/rancher/rke2";
     description = "RKE2, also known as RKE Government, is Rancher's next-generation Kubernetes distribution.";