diff --git a/kuttl-test.yaml b/kuttl-test.yaml new file mode 100644 index 0000000..c2463af --- /dev/null +++ b/kuttl-test.yaml @@ -0,0 +1,7 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestSuite +testDirs: +- ./tests/e2e/ +timeout: 180 +commands: + - command: kubectl wait --for=condition=ready --timeout=120s pod -l control-plane=controller-manager -n resource-manager-system \ No newline at end of file diff --git a/tests/e2e/crd-test/00-assert.yaml b/tests/e2e/crd-test/00-assert.yaml new file mode 100644 index 0000000..a05b9fa --- /dev/null +++ b/tests/e2e/crd-test/00-assert.yaml @@ -0,0 +1,12 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: resourcemanagers.resource-management.tikalk.com +status: + acceptedNames: + plural: resourcemanagers + singular: resourcemanager + kind: ResourceManager + listKind: ResourceManagerList + storedVersions: + - v1alpha1 diff --git a/tests/e2e/create-deployment-in-test-ns/00-assert.yaml b/tests/e2e/create-deployment-in-test-ns/00-assert.yaml new file mode 100644 index 0000000..7d33904 --- /dev/null +++ b/tests/e2e/create-deployment-in-test-ns/00-assert.yaml @@ -0,0 +1,7 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: resource-manager-controller-manager + # namespace: resource-manager-system +status: + readyReplicas: 1 \ No newline at end of file diff --git a/tests/e2e/create-deployment-in-test-ns/00-test.yaml b/tests/e2e/create-deployment-in-test-ns/00-test.yaml new file mode 100644 index 0000000..224d4fb --- /dev/null +++ b/tests/e2e/create-deployment-in-test-ns/00-test.yaml @@ -0,0 +1,21 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: resource-manager-controller-manager + # namespace: resource-manager-system +spec: + replicas: 1 + selector: + matchLabels: + control-plane: controller-manager + template: + metadata: + creationTimestamp: null + labels: + app.kubernetes.io/managed-by: tilt + control-plane: controller-manager + tilt.dev/pod-template-hash: f8e210a1f1e86600dcad + spec: + containers: + - name: manager + image: k3d-local-k8s-reg:5000/controller:tilt-f86ed2c112b2af3e \ No newline at end of file diff --git a/tests/e2e/namespace-status/00-assert.yaml b/tests/e2e/namespace-status/00-assert.yaml new file mode 100644 index 0000000..f3219b9 --- /dev/null +++ b/tests/e2e/namespace-status/00-assert.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: resource-manager-system +status: + phase: Active \ No newline at end of file diff --git a/tests/e2e/pod-status/00-assert.yaml b/tests/e2e/pod-status/00-assert.yaml new file mode 100644 index 0000000..531f485 --- /dev/null +++ b/tests/e2e/pod-status/00-assert.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Pod +metadata: + namespace: resource-manager-system +status: + phase: Running \ No newline at end of file