X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=it%2Fotf.git;a=blobdiff_plain;f=otf-helm%2Fotf%2Fcharts%2Fdatabases%2Fmysqldb%2Ftemplates%2Ftests%2Ftest-configmap.yaml;fp=otf-helm%2Fotf%2Fcharts%2Fdatabases%2Fmysqldb%2Ftemplates%2Ftests%2Ftest-configmap.yaml;h=ece5a4705c1935136fcb52e821b41047c9d71764;hp=0000000000000000000000000000000000000000;hb=321c6b595a3f05db9e4327c16af85c16752f9ec2;hpb=29cd8447ada8036b91ad2ca75a3c1c3fe0d8ba55 diff --git a/otf-helm/otf/charts/databases/mysqldb/templates/tests/test-configmap.yaml b/otf-helm/otf/charts/databases/mysqldb/templates/tests/test-configmap.yaml new file mode 100644 index 0000000..ece5a47 --- /dev/null +++ b/otf-helm/otf/charts/databases/mysqldb/templates/tests/test-configmap.yaml @@ -0,0 +1,23 @@ +{{- if .Values.testFramework.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "mysql.fullname" . }}-test + namespace: {{ .Release.Namespace }} + labels: + app: {{ template "mysql.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + heritage: "{{ .Release.Service }}" + release: "{{ .Release.Name }}" +data: + run.sh: |- + {{- if .Values.ssl.enabled | and .Values.mysqlRootPassword }} + @test "Testing SSL MySQL Connection" { + mysql --host={{ template "mysql.fullname" . }} --port={{ .Values.service.port | default "3306" }} --ssl-cert=/ssl/server-cert.pem --ssl-key=ssl/server-key.pem -u root -p{{ .Values.mysqlRootPassword }} + } + {{- else if .Values.mysqlRootPassword }} + @test "Testing MySQL Connection" { + mysql --host={{ template "mysql.fullname" . }} --port={{ .Values.service.port | default "3306" }} -u root -p{{ .Values.mysqlRootPassword }} + } + {{- end }} +{{- end }}