diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d30717d..cdd6687 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -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 @@ -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 diff --git a/pkg/plugin/test/test-pod.yaml b/test/pod-1.yaml similarity index 77% rename from pkg/plugin/test/test-pod.yaml rename to test/pod-1.yaml index d82509a..bdf590c 100644 --- a/pkg/plugin/test/test-pod.yaml +++ b/test/pod-1.yaml @@ -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: @@ -13,5 +13,5 @@ spec: volumes: - name: test-volume persistentVolumeClaim: - claimName: test-pvc + claimName: pvc-1 diff --git a/pkg/plugin/test/pvc.yaml b/test/pvc-1.yaml similarity index 77% rename from pkg/plugin/test/pvc.yaml rename to test/pvc-1.yaml index 64f0314..3f5c41a 100644 --- a/pkg/plugin/test/pvc.yaml +++ b/test/pvc-1.yaml @@ -1,11 +1,11 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: test-pvc + name: pvc-1 spec: accessModes: - ReadWriteOnce resources: requests: - storage: 1Gi + storage: 10Mi diff --git a/test/pvc-2.yaml b/test/pvc-2.yaml new file mode 100644 index 0000000..c9465f3 --- /dev/null +++ b/test/pvc-2.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: pvc-2 +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Mi +