Skip to content

Commit

Permalink
neonvm: add smoke test to check that neonvmd is running in the vm
Browse files Browse the repository at this point in the history
Signed-off-by: Misha Sakhnov <[email protected]>
  • Loading branch information
mikhail-sakhnov authored and sharnoff committed Sep 30, 2024
1 parent 76551d0 commit ed15dc0
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/e2e/vm-neonvmd/00-assert.yaml
Original file line number Diff line number Diff line change
@@ -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
24 changes: 24 additions & 0 deletions tests/e2e/vm-neonvmd/00-create-vm.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ed15dc0

Please sign in to comment.