Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fenio committed Jun 28, 2024
1 parent 3a78458 commit 2575b8d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 15 deletions.
28 changes: 18 additions & 10 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ jobs:

- name: Prepare test PVCs and PODs
run: |
kubectl apply -f pkg/plugin/test/pvc.yaml
kubectl apply -f pkg/plugin/test/test-pod.yaml
kubectl apply -f test/pvc-1.yaml
kubectl apply -f test/pvc-2.yaml
kubectl apply -f test/pod-1.yaml
- name: Install SSHFS
run: sudo apt-get update && sudo apt-get install -y sshfs --no-install-recommends --no-install-suggests
Expand All @@ -65,15 +66,22 @@ jobs:

- name: Run tests
run: |
./bin/pv-mounter mount default test-pvc foo
touch foo/dupa
ls -l foo/dupa
./bin/pv-mounter clean default test-pvc foo
- name: Delete pod and PVC
echo 'Shared PVC with RWO access mode'
./bin/pv-mounter mount default pvc-1 foo
touch foo/bar
ls -l foo/bar
./bin/pv-mounter clean default pvc-1 foo
echo 'Unmounted PVC with RWO access mode'
./bin/pv-mounter mount default pvc-2 foo
touch foo/bar
ls -l foo/bar
./bin/pv-mounter clean default pvc-2 foo
- name: Delete PODs and PVCs
run: |
kubectl delete -f pkg/plugin/test/test-pod.yaml
kubectl delete -f pkg/plugin/test/pvc.yaml
kubectl delete -f test/pod-1.yaml
kubectl delete -f test/pvc-1.yaml
kubectl delete -f test/pvc-2.yaml
- name: Delete cluster
run: kind delete cluster
Expand Down
6 changes: 3 additions & 3 deletions pkg/plugin/test/test-pod.yaml → test/pod-1.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apiVersion: v1
kind: Pod
metadata:
name: test-pod
name: pod-1
spec:
containers:
- name: test-container
- name: container-1
image: busybox
command: [ "sleep", "3600" ]
volumeMounts:
Expand All @@ -13,5 +13,5 @@ spec:
volumes:
- name: test-volume
persistentVolumeClaim:
claimName: test-pvc
claimName: pvc-1

4 changes: 2 additions & 2 deletions pkg/plugin/test/pvc.yaml → test/pvc-1.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: test-pvc
name: pvc-1
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storage: 10Mi

11 changes: 11 additions & 0 deletions test/pvc-2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-2
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Mi

0 comments on commit 2575b8d

Please sign in to comment.