Unverified Commit e608aada authored by Jörg Thalheim's avatar Jörg Thalheim Committed by GitHub
Browse files

Merge pull request #326575 from superherointj/k3s-refactor

k3s: use nixosTests.k3s as source reference for tests + minimal refactor
parents a2b5f748 e3e01232
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
# Tests whether container images are imported and auto deploying manifests work
import ../make-test-python.nix (
  {
    pkgs,
@@ -108,8 +109,8 @@ import ../make-test-python.nix (
      machine.succeed("ls /var/lib/rancher/k3s/server/manifests/hello.yaml")

      # check if container images got imported
      machine.succeed("crictl img | grep 'test\.local/pause'")
      machine.succeed("crictl img | grep 'test\.local/hello'")
      machine.wait_until_succeeds("crictl img | grep 'test\.local/pause'")
      machine.wait_until_succeeds("crictl img | grep 'test\.local/hello'")

      # check if resources of manifests got created
      machine.wait_until_succeeds("kubectl get ns foo")
+0 −4
Original line number Diff line number Diff line
@@ -7,9 +7,7 @@ let
  allK3s = lib.filterAttrs (n: _: lib.strings.hasPrefix "k3s_" n) pkgs;
in
{
  # Test whether container images are imported and auto deploying manifests work
  auto-deploy = lib.mapAttrs (_: k3s: import ./auto-deploy.nix { inherit system pkgs k3s; }) allK3s;
  # Testing K3s with Etcd backend
  etcd = lib.mapAttrs (
    _: k3s:
    import ./etcd.nix {
@@ -17,8 +15,6 @@ in
      inherit (pkgs) etcd;
    }
  ) allK3s;
  # Run a single node k3s cluster and verify a pod can run
  single-node = lib.mapAttrs (_: k3s: import ./single-node.nix { inherit system pkgs k3s; }) allK3s;
  # Run a multi-node k3s cluster and verify pod networking works across nodes
  multi-node = lib.mapAttrs (_: k3s: import ./multi-node.nix { inherit system pkgs k3s; }) allK3s;
}
+1 −0
Original line number Diff line number Diff line
# Tests K3s with Etcd backend
import ../make-test-python.nix (
  {
    pkgs,
+1 −0
Original line number Diff line number Diff line
# A test that runs a multi-node k3s cluster and verify pod networking works across nodes
import ../make-test-python.nix (
  {
    pkgs,
+1 −0
Original line number Diff line number Diff line
# A test that runs a single node k3s cluster and verify a pod can run
import ../make-test-python.nix (
  {
    pkgs,
Loading