Skip to content

Commit

Permalink
more testing (#520)
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Cook <rcook@redhat.com>
  • Loading branch information
cooktheryan authored Dec 23, 2021
1 parent f1cd1bd commit 123b337
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 0 deletions.
70 changes: 70 additions & 0 deletions validate-microshift/e2e/microshift/45-create-resources.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/bin/bash
kubectl create ns uploader
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
app: uploader
name: uploader
namespace: uploader
spec:
ports:
- port: 8080
protocol: TCP
targetPort: 8080
selector:
app: uploader
status:
loadBalancer: {}
---
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: uploader
name: uploader
namespace: uploader
spec:
replicas: 1
selector:
matchLabels:
app: uploader
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: uploader
spec:
securityContext:
runAsUser: 1000580000
fsGroup: 1000580000
containers:
- image: quay.io/rcook/tools:php-demo
name: tools
ports:
- containerPort: 8080
volumeMounts:
- name: uploader-persistent
mountPath: /opt/app-root/src/uploaded
volumes:
- name: uploader-persistent
persistentVolumeClaim:
claimName: uploader-pvc
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: uploader-pvc
namespace: uploader
spec:
accessModes:
- ReadWriteOnce
storageClassName: kubevirt-hostpath-provisioner
resources:
requests:
storage: 1Gi
EOF
6 changes: 6 additions & 0 deletions validate-microshift/e2e/microshift/45-create-resources.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- timeout: 60
command: ./45-create-resources.sh
24 changes: 24 additions & 0 deletions validate-microshift/e2e/microshift/50-assert-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
timeout: 500
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: uploader
namespace: uploader
status:
readyReplicas: 1
---
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
timeout: 500
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: uploader
namespace: uploader
status:
readyReplicas: 1
10 changes: 10 additions & 0 deletions validate-microshift/e2e/microshift/55-assert-svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
timeout: 500
---
apiVersion: v1
kind: Service
metadata:
name: uploader
namespace: uploader
16 changes: 16 additions & 0 deletions validate-microshift/e2e/microshift/60-assert-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
timeout: 500
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: uploader-pvc
namespace: uploader
spec:
storageClassName: kubevirt-hostpath-provisioner
status:
accessModes:
- ReadWriteOnce
phase: Bound

0 comments on commit 123b337

Please sign in to comment.