forked from converged-computing/oras-csi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathe2e.bats
31 lines (22 loc) · 1.22 KB
/
e2e.bats
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bats
# This is run relative to the root
EXAMPLES_DIR=examples/basic/pod
SLEEP_TIME=10
@test "basic pod test" {
kubectl apply -f ${EXAMPLES_DIR}/pod.yaml
sleep ${SLEEP_TIME}
# This test is looking inside our pod to the requested mount point
kubectl exec -it my-csi-app-inline -- ls /mnt/oras | grep container.sif
pod=$(kubectl get -n kube-system pods -o json | jq -r .items[].metadata.name | grep csi)
echo pod is ${pod}
# These tests are looking inside the csi driver pod!
# Top level has the namespace of the pod
kubectl exec -it -n kube-system ${pod} -c csi-oras-plugin -- ls /pv_data | grep default
# Next level is the container URI (repository name + tag)
kubectl exec -it -n kube-system ${pod} -c csi-oras-plugin -- ls /pv_data/default | grep ghcr-io-singularityhub-github-ci-latest
# Next level is the container URI (repository name + tag)
kubectl exec -it -n kube-system ${pod} -c csi-oras-plugin -- ls /pv_data/default | grep ghcr-io-singularityhub-github-ci-latest
# And then the container.sif
kubectl exec -it -n kube-system ${pod} -c csi-oras-plugin -- ls /pv_data/default/ghcr-io-singularityhub-github-ci-latest | grep container.sif
kubectl delete -f ${EXAMPLES_DIR}/pod.yaml
}