From ed15dc056d700d4d3ed31ef0df1504fcbacd2c02 Mon Sep 17 00:00:00 2001 From: Misha Sakhnov Date: Mon, 30 Sep 2024 12:20:46 +0200 Subject: [PATCH] neonvm: add smoke test to check that neonvmd is running in the vm Signed-off-by: Misha Sakhnov --- tests/e2e/vm-neonvmd/00-assert.yaml | 35 ++++++++++++++++++++++++++ tests/e2e/vm-neonvmd/00-create-vm.yaml | 24 ++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 tests/e2e/vm-neonvmd/00-assert.yaml create mode 100644 tests/e2e/vm-neonvmd/00-create-vm.yaml diff --git a/tests/e2e/vm-neonvmd/00-assert.yaml b/tests/e2e/vm-neonvmd/00-assert.yaml new file mode 100644 index 000000000..d5ea4c619 --- /dev/null +++ b/tests/e2e/vm-neonvmd/00-assert.yaml @@ -0,0 +1,35 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +timeout: 90 +commands: + - script: | + set -eux + pod="$(kubectl get neonvm -n "$NAMESPACE" example -o jsonpath='{.status.podName}')" + kubectl exec -n "$NAMESPACE" $pod -- ssh guest-vm ps aux | grep neonvmd | [ $(wc -l) -eq 1 ] || echo "neonvmd process is not found in the $pod" +--- +apiVersion: vm.neon.tech/v1 +kind: VirtualMachine +metadata: + name: example +status: + phase: Running + restartCount: 0 + conditions: + - type: Available + status: "True" + cpus: 250m + memorySize: 1Gi + sshSecretName: ssh-neonvm-example +--- +apiVersion: v1 +kind: Secret +type: kubernetes.io/ssh-auth +immutable: true +metadata: + name: ssh-neonvm-example + ownerReferences: + - apiVersion: vm.neon.tech/v1 + blockOwnerDeletion: true + controller: true + kind: VirtualMachine + name: example diff --git a/tests/e2e/vm-neonvmd/00-create-vm.yaml b/tests/e2e/vm-neonvmd/00-create-vm.yaml new file mode 100644 index 000000000..2bb3c345d --- /dev/null +++ b/tests/e2e/vm-neonvmd/00-create-vm.yaml @@ -0,0 +1,24 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +unitTest: false +--- +apiVersion: vm.neon.tech/v1 +kind: VirtualMachine +metadata: + name: example +spec: + schedulerName: autoscale-scheduler + enableSSH: true + guest: + cpus: + min: 0.25 + use: 0.25 + max: 0.25 + memorySlotSize: 1Gi + memorySlots: + min: 1 + use: 1 + max: 1 + rootDisk: + image: vm-postgres:15-bullseye + size: 1Gi