diff --git a/charts/qdrant/templates/tests/test-db-interaction.yaml b/charts/qdrant/templates/tests/test-db-interaction.yaml index ed04122..7c5d9b9 100644 --- a/charts/qdrant/templates/tests/test-db-interaction.yaml +++ b/charts/qdrant/templates/tests/test-db-interaction.yaml @@ -17,9 +17,18 @@ spec: - name: test-script image: {{ .Values.chartTests.dbInteraction.image | quote }} args: ['bash', '/app/entrypoint.sh'] + {{- with .Values.chartTests.dbInteraction.containerSecurityContext }} + securityContext: + {{- toYaml . | nindent 8 }} + {{- end }} + env: + - name: HOME + value: /tmp/home volumeMounts: - mountPath: /app name: test-script + - mountPath: /tmp/home + name: home {{- if .Values.additionalVolumeMounts }} {{- toYaml .Values.additionalVolumeMounts | default "" | nindent 8 }} {{- end}} @@ -41,6 +50,8 @@ spec: - name: test-script configMap: name: "{{ include "qdrant.fullname" . }}-test-db-interaction" + - name: home + emptyDir: {} {{- if .Values.additionalVolumes }} {{- toYaml .Values.additionalVolumes | default "" | nindent 4 }} {{- end}} diff --git a/test/integration/readonly_rootfs.bats b/test/integration/readonly_rootfs.bats new file mode 100644 index 0000000..1544464 --- /dev/null +++ b/test/integration/readonly_rootfs.bats @@ -0,0 +1,8 @@ +setup_file() { + helm upgrade --install qdrant charts/qdrant -n qdrant-helm-integration --wait --set chartTests.dbInteraction.containerSecurityContext.readOnlyRootFilesystem=true +} + +@test "helm test - with read-only root filesystem" { + run helm test qdrant -n qdrant-helm-integration --logs + [ $status -eq 0 ] +}