Skip to content

Commit

Permalink
test: Add E2E test for virtiofs VM
Browse files Browse the repository at this point in the history
  • Loading branch information
scuzhanglei committed Jan 10, 2023
1 parent c5bf44f commit 514a8c7
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/e2e/create-filesystem-vm/00-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: virt.virtink.smartx.com/v1alpha1
kind: VirtualMachine
metadata:
name: ubuntu-filesystem
status:
phase: Running
conditions:
- type: Ready
status: "True"
- type: Migratable
status: "False"
59 changes: 59 additions & 0 deletions test/e2e/create-filesystem-vm/00-create-vm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
apiVersion: virt.virtink.smartx.com/v1alpha1
kind: VirtualMachine
metadata:
name: ubuntu-filesystem
spec:
readinessProbe:
httpGet:
scheme: HTTP
path: disk.img
port: 80
instance:
memory:
size: 1Gi
disks:
- name: ubuntu
- name: cloud-init
fileSystems:
- name: blank
interfaces:
- name: pod
volumes:
- name: ubuntu
containerDisk:
image: smartxworks/virtink-container-disk-ubuntu
- name: cloud-init
cloudInit:
userData: |-
#cloud-config
password: password
chpasswd: { expire: False }
ssh_pwauth: True
packages:
- nginx
runcmd:
- [ "systemctl", "enable", "--now", "nginx" ]
- [ "mount", "-t", "virtiofs", "blank", "/var/www/html" ]
- [ "chmod", "-R", "777", "/var/www/html" ]
- [ "systemctl", "restart", "nginx" ]
- name: blank
dataVolume:
volumeName: blank
networks:
- name: pod
pod: {}
---
apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
name: blank
spec:
source:
blank: {}
pvc:
storageClassName: rook-nfs-share1
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Mi

0 comments on commit 514a8c7

Please sign in to comment.