Add Tempest script in helm test framework

Now, openstack-helm support "helm test" function, and It execute rally
container.
Rally also can test Tempest itself, so this fix will be add tempest
test in rally container.

Change-Id: I2c2f684f6583f2a3d9c7279a3d85cb242934e90e
Implements: blueprint add-tempest-in-helm-test
This commit is contained in:
Dae Seong Kim 2017-06-23 09:40:38 +09:00
parent b06fab9c07
commit aacd11e361
16 changed files with 69 additions and 13 deletions

View File

@ -16,6 +16,7 @@ limitations under the License.
{{- if .Values.manifests.configmap_bin }} {{- if .Values.manifests.configmap_bin }}
{{- $envAll := . }} {{- $envAll := . }}
{{- $rallyTests := .Values.conf.rally_tests }}
--- ---
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
@ -23,7 +24,7 @@ metadata:
name: cinder-bin name: cinder-bin
data: data:
rally-test.sh: | rally-test.sh: |
{{- include "helm-toolkit.scripts.rally_test" . | indent 4 }} {{ tuple $rallyTests | include "helm-toolkit.scripts.rally_test" | indent 4 }}
db-init.py: | db-init.py: |
{{- include "helm-toolkit.scripts.db_init" . | indent 4 }} {{- include "helm-toolkit.scripts.db_init" . | indent 4 }}
db-sync.sh: | db-sync.sh: |

View File

@ -70,7 +70,17 @@ metadata:
name: cinder-etc name: cinder-etc
data: data:
rally_tests.yaml: |+ rally_tests.yaml: |+
{{ if .Values.conf.rally_tests.override -}}
{{ .Values.conf.rally_tests.override | indent 4 }}
{{- else -}}
{{- if .Values.conf.rally_tests.prefix -}}
{{ .Values.conf.rally_tests.prefix | indent 4 }}
{{- end }}
{{ tuple "etc/_rally_tests.yaml.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} {{ tuple "etc/_rally_tests.yaml.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
{{- end }}
{{- if .Values.conf.rally_tests.append -}}
{{ .Values.conf.rally_tests.append | indent 4 }}
{{- end }}
cinder.conf: |+ cinder.conf: |+
{{ if .Values.conf.cinder.override -}} {{ if .Values.conf.cinder.override -}}
{{ .Values.conf.cinder.override | indent 4 }} {{ .Values.conf.cinder.override | indent 4 }}

View File

@ -26,7 +26,7 @@ labels:
release_group: null release_group: null
images: images:
test: docker.io/kolla/ubuntu-binary-rally:4.0.0 test: docker.io/kolla/ubuntu-source-rally:4.0.0
db_init: docker.io/kolla/ubuntu-source-cinder-api:3.0.3 db_init: docker.io/kolla/ubuntu-source-cinder-api:3.0.3
db_sync: docker.io/kolla/ubuntu-source-cinder-api:3.0.3 db_sync: docker.io/kolla/ubuntu-source-cinder-api:3.0.3
ks_user: docker.io/kolla/ubuntu-source-kolla-toolbox:3.0.3 ks_user: docker.io/kolla/ubuntu-source-kolla-toolbox:3.0.3
@ -236,6 +236,7 @@ conf:
rados_connect_timeout: -1 rados_connect_timeout: -1
rbd_user: "admin" rbd_user: "admin"
rally_tests: rally_tests:
run_tempest: false
override: override:
append: append:

View File

@ -16,6 +16,7 @@ limitations under the License.
{{- if .Values.manifests.configmap_bin }} {{- if .Values.manifests.configmap_bin }}
{{- $envAll := . }} {{- $envAll := . }}
{{- $rallyTests := .Values.conf.rally_tests }}
--- ---
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
@ -23,7 +24,7 @@ metadata:
name: glance-bin name: glance-bin
data: data:
rally-test.sh: | rally-test.sh: |
{{- include "helm-toolkit.scripts.rally_test" . | indent 4 }} {{ tuple $rallyTests | include "helm-toolkit.scripts.rally_test" | indent 4 }}
db-init.py: | db-init.py: |
{{- include "helm-toolkit.scripts.db_init" . | indent 4 }} {{- include "helm-toolkit.scripts.db_init" . | indent 4 }}
db-sync.sh: | db-sync.sh: |

View File

@ -27,7 +27,7 @@ labels:
release_group: null release_group: null
images: images:
test: docker.io/kolla/ubuntu-binary-rally:4.0.0 test: docker.io/kolla/ubuntu-source-rally:4.0.0
db_init: docker.io/kolla/ubuntu-source-glance-api:3.0.3 db_init: docker.io/kolla/ubuntu-source-glance-api:3.0.3
db_sync: docker.io/kolla/ubuntu-source-glance-api:3.0.3 db_sync: docker.io/kolla/ubuntu-source-glance-api:3.0.3
ks_user: docker.io/kolla/ubuntu-source-kolla-toolbox:3.0.3 ks_user: docker.io/kolla/ubuntu-source-kolla-toolbox:3.0.3
@ -57,6 +57,7 @@ bootstrap:
conf: conf:
rally_tests: rally_tests:
run_tempest: false
override: override:
append: append:
images: images:

View File

@ -14,15 +14,22 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- define "helm-toolkit.scripts.rally_test" }} {{- define "helm-toolkit.scripts.rally_test" -}}
#!/bin/bash #!/bin/bash
set -ex set -ex
{{- $rallyTests := index . 0 }}
: ${RALLY_ENV_NAME:="openstack-helm"} : ${RALLY_ENV_NAME:="openstack-helm"}
rally-manage db create rally-manage db create
rally deployment create --fromenv --name ${RALLY_ENV_NAME} rally deployment create --fromenv --name ${RALLY_ENV_NAME}
rally deployment use ${RALLY_ENV_NAME} rally deployment use ${RALLY_ENV_NAME}
rally deployment check rally deployment check
{{- if $rallyTests.run_tempest }}
rally verify create-verifier --name ${RALLY_ENV_NAME}-tempest --type tempest
SERVICE_TYPE=$(rally deployment check | grep ${RALLY_ENV_NAME} | awk -F \| '{print $3}' | tr -d ' ' | tr -d '\n')
rally verify start --pattern tempest.api.$SERVICE_TYPE*
rally verify delete-verifier --id ${RALLY_ENV_NAME}-tempest --force
{{- end }}
rally task validate /etc/rally/rally_tests.yaml rally task validate /etc/rally/rally_tests.yaml
rally task start /etc/rally/rally_tests.yaml rally task start /etc/rally/rally_tests.yaml
rally deployment destroy --deployment ${RALLY_ENV_NAME} rally deployment destroy --deployment ${RALLY_ENV_NAME}

View File

@ -16,6 +16,7 @@ limitations under the License.
{{- if .Values.manifests.configmap_bin }} {{- if .Values.manifests.configmap_bin }}
{{- $envAll := . }} {{- $envAll := . }}
{{- $rallyTests := .Values.conf.rally_tests }}
--- ---
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
@ -27,7 +28,7 @@ data:
{{ tuple "bin/_bootstrap.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} {{ tuple "bin/_bootstrap.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
{{- end }} {{- end }}
rally-test.sh: | rally-test.sh: |
{{- include "helm-toolkit.scripts.rally_test" . | indent 4 }} {{ tuple $rallyTests | include "helm-toolkit.scripts.rally_test" | indent 4 }}
db-init.py: | db-init.py: |
{{- include "helm-toolkit.scripts.db_init" . | indent 4 }} {{- include "helm-toolkit.scripts.db_init" . | indent 4 }}
db-sync.sh: | db-sync.sh: |

View File

@ -25,7 +25,7 @@ release_group: null
images: images:
bootstrap: docker.io/kolla/ubuntu-source-keystone:3.0.3 bootstrap: docker.io/kolla/ubuntu-source-keystone:3.0.3
test: docker.io/kolla/ubuntu-binary-rally:4.0.0 test: docker.io/kolla/ubuntu-source-rally:4.0.0
db_init: docker.io/kolla/ubuntu-source-keystone:3.0.3 db_init: docker.io/kolla/ubuntu-source-keystone:3.0.3
db_sync: docker.io/kolla/ubuntu-source-keystone:3.0.3 db_sync: docker.io/kolla/ubuntu-source-keystone:3.0.3
fernet_setup: docker.io/kolla/ubuntu-source-keystone:3.0.3 fernet_setup: docker.io/kolla/ubuntu-source-keystone:3.0.3
@ -241,6 +241,7 @@ jobs:
conf: conf:
rally_tests: rally_tests:
run_tempest: false
override: override:
append: append:
paste: paste:

View File

@ -16,6 +16,7 @@ limitations under the License.
{{- if .Values.manifests.configmap_bin }} {{- if .Values.manifests.configmap_bin }}
{{- $envAll := . }} {{- $envAll := . }}
{{- $rallyTests := .Values.conf.rally_tests }}
--- ---
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
@ -27,7 +28,7 @@ data:
{{ tuple "bin/_bootstrap.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} {{ tuple "bin/_bootstrap.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
{{- end }} {{- end }}
rally-test.sh: | rally-test.sh: |
{{- include "helm-toolkit.scripts.rally_test" . | indent 4 }} {{ tuple $rallyTests | include "helm-toolkit.scripts.rally_test" | indent 4 }}
db-init.py: |+ db-init.py: |+
{{- include "helm-toolkit.scripts.db_init" . | indent 4 }} {{- include "helm-toolkit.scripts.db_init" . | indent 4 }}
db-sync.sh: |+ db-sync.sh: |+

View File

@ -84,7 +84,17 @@ metadata:
name: neutron-etc name: neutron-etc
data: data:
rally_tests.yaml: |+ rally_tests.yaml: |+
{{ if .Values.conf.rally_tests.override -}}
{{ .Values.conf.rally_tests.override | indent 4 }}
{{- else -}}
{{- if .Values.conf.rally_tests.prefix -}}
{{ .Values.conf.rally_tests.prefix | indent 4 }}
{{- end }}
{{ tuple "etc/_rally_tests.yaml.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} {{ tuple "etc/_rally_tests.yaml.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
{{- end }}
{{- if .Values.conf.rally_tests.append -}}
{{ .Values.conf.rally_tests.append | indent 4 }}
{{- end }}
api-paste.ini: |+ api-paste.ini: |+
{{ if .Values.conf.paste.override -}} {{ if .Values.conf.paste.override -}}
{{ .Values.conf.paste.override | indent 4 }} {{ .Values.conf.paste.override | indent 4 }}

View File

@ -29,7 +29,7 @@ metadata:
spec: spec:
restartPolicy: Never restartPolicy: Never
initContainers: initContainers:
{{ tuple $envAll $dependencies $mounts_neutron_tests_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} {{ tuple $envAll $dependencies $mounts_neutron_tests_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 4 }}
containers: containers:
- name: {{.Release.Name}}-token-issue-test - name: {{.Release.Name}}-token-issue-test
image: {{ .Values.images.test }} image: {{ .Values.images.test }}
@ -42,6 +42,7 @@ spec:
- name: RALLY_ENV_NAME - name: RALLY_ENV_NAME
value: {{.Release.Name}} value: {{.Release.Name}}
command: command:
- bash
- /tmp/rally-test.sh - /tmp/rally-test.sh
volumeMounts: volumeMounts:
- name: neutron-etc - name: neutron-etc

View File

@ -21,7 +21,7 @@ release_group: null
images: images:
bootstrap: docker.io/kolla/ubuntu-source-neutron-server:3.0.3 bootstrap: docker.io/kolla/ubuntu-source-neutron-server:3.0.3
test: docker.io/kolla/ubuntu-binary-rally:4.0.0 test: docker.io/kolla/ubuntu-source-rally:4.0.0
db_init: docker.io/kolla/ubuntu-source-neutron-server:3.0.3 db_init: docker.io/kolla/ubuntu-source-neutron-server:3.0.3
db_sync: docker.io/kolla/ubuntu-source-neutron-server:3.0.3 db_sync: docker.io/kolla/ubuntu-source-neutron-server:3.0.3
ks_user: docker.io/kolla/ubuntu-source-kolla-toolbox:3.0.3 ks_user: docker.io/kolla/ubuntu-source-kolla-toolbox:3.0.3
@ -354,6 +354,10 @@ pod:
cpu: "2000m" cpu: "2000m"
conf: conf:
rally_tests:
run_tempest: false
override:
append:
paste: paste:
override: override:
append: append:

View File

@ -16,6 +16,7 @@ limitations under the License.
{{- if .Values.manifests.configmap_bin }} {{- if .Values.manifests.configmap_bin }}
{{- $envAll := . }} {{- $envAll := . }}
{{- $rallyTests := .Values.conf.rally_tests }}
--- ---
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
@ -23,7 +24,7 @@ metadata:
name: nova-bin name: nova-bin
data: data:
rally-test.sh: | rally-test.sh: |
{{- include "helm-toolkit.scripts.rally_test" . | indent 4 }} {{ tuple $rallyTests | include "helm-toolkit.scripts.rally_test" | indent 4 }}
db-init.py: |+ db-init.py: |+
{{- include "helm-toolkit.scripts.db_init" . | indent 4 }} {{- include "helm-toolkit.scripts.db_init" . | indent 4 }}
db-sync.sh: |+ db-sync.sh: |+

View File

@ -94,7 +94,17 @@ metadata:
name: nova-etc name: nova-etc
data: data:
rally_tests.yaml: |+ rally_tests.yaml: |+
{{ if .Values.conf.rally_tests.override -}}
{{ .Values.conf.rally_tests.override | indent 4 }}
{{- else -}}
{{- if .Values.conf.rally_tests.prefix -}}
{{ .Values.conf.rally_tests.prefix | indent 4 }}
{{- end }}
{{ tuple "etc/_rally_tests.yaml.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} {{ tuple "etc/_rally_tests.yaml.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
{{- end }}
{{- if .Values.conf.rally_tests.append -}}
{{ .Values.conf.rally_tests.append | indent 4 }}
{{- end }}
nova.conf: |+ nova.conf: |+
{{ if .Values.conf.nova.override -}} {{ if .Values.conf.nova.override -}}
{{ .Values.conf.nova.override | indent 4 }} {{ .Values.conf.nova.override | indent 4 }}

View File

@ -29,10 +29,11 @@ metadata:
spec: spec:
restartPolicy: Never restartPolicy: Never
initContainers: initContainers:
{{ tuple $envAll $dependencies $mounts_nova_tests_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} {{ tuple $envAll $dependencies $mounts_nova_tests_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 4 }}
containers: containers:
- name: {{.Release.Name}}-token-issue-test - name: {{.Release.Name}}-token-issue-test
image: {{ .Values.images.test }} image: {{ .Values.images.test }}
imagePullPolicy: {{ .Values.images.pull_policy }}
env: env:
{{- with $env := dict "ksUserSecret" .Values.secrets.identity.admin }} {{- with $env := dict "ksUserSecret" .Values.secrets.identity.admin }}
{{- include "helm-toolkit.snippets.keystone_openrc_env_vars" $env | indent 8 }} {{- include "helm-toolkit.snippets.keystone_openrc_env_vars" $env | indent 8 }}
@ -40,6 +41,7 @@ spec:
- name: RALLY_ENV_NAME - name: RALLY_ENV_NAME
value: {{.Release.Name}} value: {{.Release.Name}}
command: command:
- bash
- /tmp/rally-test.sh - /tmp/rally-test.sh
volumeMounts: volumeMounts:
- name: nova-etc - name: nova-etc

View File

@ -50,7 +50,7 @@ labels:
node_selector_value: enabled node_selector_value: enabled
images: images:
test: docker.io/kolla/ubuntu-binary-rally:4.0.0 test: docker.io/kolla/ubuntu-source-rally:4.0.0
db_init: docker.io/kolla/ubuntu-source-nova-api:3.0.3 db_init: docker.io/kolla/ubuntu-source-nova-api:3.0.3
db_sync: docker.io/kolla/ubuntu-source-nova-api:3.0.3 db_sync: docker.io/kolla/ubuntu-source-nova-api:3.0.3
ks_user: docker.io/kolla/ubuntu-source-kolla-toolbox:3.0.3 ks_user: docker.io/kolla/ubuntu-source-kolla-toolbox:3.0.3
@ -265,6 +265,10 @@ console:
vncserver_proxyclient_interface: vncserver_proxyclient_interface:
conf: conf:
rally_tests:
run_tempest: false
override:
append:
paste: paste:
override: override:
append: append: