From d6c9b5efd2a1c4eee75070f4532172f3bc4f097a Mon Sep 17 00:00:00 2001 From: Eddie Torres Date: Thu, 11 Jan 2024 00:11:50 +0000 Subject: [PATCH] test Signed-off-by: Eddie Torres --- .../templates/tests/helm-tester.yaml | 8 +++++++- hack/e2e/run.sh | 9 +++++++++ tests/e2e-kubernetes/log-collector.yaml | 20 +++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 tests/e2e-kubernetes/log-collector.yaml diff --git a/charts/aws-ebs-csi-driver/templates/tests/helm-tester.yaml b/charts/aws-ebs-csi-driver/templates/tests/helm-tester.yaml index a4e2a8fae..ad3e6ddff 100644 --- a/charts/aws-ebs-csi-driver/templates/tests/helm-tester.yaml +++ b/charts/aws-ebs-csi-driver/templates/tests/helm-tester.yaml @@ -210,13 +210,19 @@ spec: SNAPSHOTS="|snapshot fields" fi export FOCUS_REGEX="\bebs.csi.aws.com\b.+(validate content|resize volume|offline PVC|AllowedTopologies|store data$SNAPSHOTS)" - kubetest2 noop --run-id='e2e-kubernetes' --test=ginkgo -- --test-package-version=$(curl -L https://dl.k8s.io/release/stable-1.28.txt) --skip-regex='\[Disruptive\]|\[Serial\]' --focus-regex="$FOCUS_REGEX" --parallel=25 --test-args='-storage.testdriver=/etc/config/manifests.yaml' + kubetest2 noop --run-id='e2e-kubernetes' --test=ginkgo -- --test-package-version=$(curl -L https://dl.k8s.io/release/stable-1.29.txt) --skip-regex='\[Disruptive\]|\[Serial\]' --focus-regex="$FOCUS_REGEX" --parallel=25 --test-args='-storage.testdriver=/etc/config/manifests.yaml' >> /workspace/ebs-csi-driver-test.log 2>&1 volumeMounts: - name: config-vol mountPath: /etc/config + - name: host-volume + mountPath: /workspace serviceAccountName: ebs-csi-driver-test volumes: - name: config-vol configMap: name: ebs-csi-driver-test + - name: host-volume + hostPath: + path: /tmp + type: DirectoryOrCreate restartPolicy: Never diff --git a/hack/e2e/run.sh b/hack/e2e/run.sh index a8a1bbf8d..1f089c66e 100755 --- a/hack/e2e/run.sh +++ b/hack/e2e/run.sh @@ -130,6 +130,15 @@ if [[ "${HELM_CT_TEST}" == true ]]; then TEST_PASSED=$? set -e set +x + echo "starting log collector pod" + sleep 30 + kubectl apply -f "${BASE_DIR}/../../tests/e2e-kubernetes/log-collector.yaml" --kubeconfig "${KUBECONFIG}" + sleep 30 + echo "ls root" + kubectl exec --kubeconfig "${KUBECONFIG}" -it log-retrieval-pod -n kube-system -- ls + echo "ls /tmp" + kubectl exec --kubeconfig "${KUBECONFIG}" -it log-retrieval-pod -n kube-system -- ls /tmp + else loudecho "Testing focus ${GINKGO_FOCUS}" diff --git a/tests/e2e-kubernetes/log-collector.yaml b/tests/e2e-kubernetes/log-collector.yaml new file mode 100644 index 000000000..e69e61292 --- /dev/null +++ b/tests/e2e-kubernetes/log-collector.yaml @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: Pod +metadata: + name: log-retrieval-pod + namespace: kube-system +spec: + containers: + - name: log-retriever + image: alpine + command: ["/bin/sh", "-c"] + args: ["tail -f /dev/null"] + volumeMounts: + - name: host-volume + mountPath: /tmp + volumes: + - name: host-volume + hostPath: + path: /tmp + type: Directory + restartPolicy: Never