Helm Test: Cinder

Add rally tests in cinder helm chart.
It only test create a volume because volume driver is fake_driver.

Change-Id: Iba5df74df427a414c70dda6baf9bc7e775b1716d
Partial-Implements: blueprint implement-helm-test-for-charts
This commit is contained in:
Jaesang Lee 2017-06-23 15:15:15 +09:00
parent 8ef5d94674
commit 55c1625a4f
6 changed files with 129 additions and 0 deletions

View File

@ -17,6 +17,8 @@ kind: ConfigMap
metadata:
name: cinder-bin
data:
rally-test.sh: |
{{- include "helm-toolkit.scripts.rally_test" . | indent 4 }}
db-init.py: |
{{- include "helm-toolkit.scripts.db_init" . | indent 4 }}
db-sync.sh: |

View File

@ -44,6 +44,8 @@ kind: ConfigMap
metadata:
name: cinder-etc
data:
rally_tests.yaml: |+
{{ tuple "etc/_rally_tests.yaml.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
cinder.conf: |+
{{ if .Values.conf.cinder.override -}}
{{ .Values.conf.cinder.override | indent 4 }}

View File

@ -0,0 +1,30 @@
---
CinderVolumes.create_and_delete_volume:
- args:
size: 1
runner:
type: "constant"
times: 1
concurrency: 1
context:
users:
tenants: 1
users_per_tenant: 1
sla:
failure_rate:
max: 0
- args:
size:
min: 1
max: 5
runner:
type: "constant"
times: 1
concurrency: 1
context:
users:
tenants: 1
users_per_tenant: 1
sla:
failure_rate:
max: 0

View File

@ -0,0 +1,74 @@
# Copyright 2017 The Openstack-Helm Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
{{- $envAll := . }}
{{- $ksAdminSecret := .Values.keystone.admin_secret | default "cinder-env-keystone-admin" }}
{{- $dependencies := .Values.dependencies.tests }}
{{- $mounts_cinder_tests := .Values.mounts.cinder_tests.cinder_tests }}
{{- $mounts_cinder_tests_init := .Values.mounts.cinder_tests.init_container }}
apiVersion: v1
kind: Pod
metadata:
name: "{{.Release.Name}}-rally-test"
annotations:
"helm.sh/hook": test-success
spec:
restartPolicy: Never
initContainers:
{{ tuple $envAll $dependencies $mounts_cinder_tests_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 4 }}
containers:
- name: {{.Release.Name}}-token-issue-test
image: {{ .Values.images.test }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{- if .Values.resources.enabled }}
resources:
limits:
cpu: {{ .Values.resources.tests.limits.cpu | quote }}
memory: {{ .Values.resources.tests.limits.memory | quote }}
requests:
cpu: {{ .Values.resources.tests.requests.cpu | quote }}
memory: {{ .Values.resources.tests.requests.memory | quote }}
{{- end }}
env:
{{- with $env := dict "ksUserSecret" $ksAdminSecret }}
{{- include "helm-toolkit.snippets.keystone_openrc_env_vars" $env | indent 8 }}
{{- end }}
- name: RALLY_ENV_NAME
value: {{.Release.Name}}
command:
- bash
- /tmp/rally-test.sh
volumeMounts:
- name: cinder-etc
mountPath: /etc/rally/rally_tests.yaml
subPath: rally_tests.yaml
readOnly: true
- name: cinder-bin
mountPath: /tmp/rally-test.sh
subPath: rally-test.sh
readOnly: true
- name: rally-db
mountPath: /var/lib/rally
{{ if $mounts_cinder_tests.volumeMounts }}{{ toYaml $mounts_cinder_tests.volumeMounts | indent 8 }}{{ end }}
volumes:
- name: cinder-etc
configMap:
name: cinder-etc
- name: cinder-bin
configMap:
name: cinder-bin
- name: rally-db
emptyDir: {}
{{ if $mounts_cinder_tests.volumes }}{{ toYaml $mounts_cinder_tests.volumes | indent 4 }}{{ end }}

View File

@ -30,6 +30,7 @@ labels:
node_selector_value: enabled
images:
test: docker.io/kolla/ubuntu-binary-rally:4.0.0
db_init: 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
@ -152,6 +153,9 @@ conf:
rbd_store_chunk_size: 4
rados_connect_timeout: -1
rbd_user: "admin"
rally_tests:
override:
append:
dependencies:
db_init:
@ -224,6 +228,12 @@ dependencies:
endpoint: internal
- service: volume
endpoint: internal
tests:
services:
- service: identity
endpoint: internal
- service: volume
endpoint: internal
# We use a different layout of the endpoints here to account for versioning
# this swaps the service name and type, and should be rolled out to other
@ -377,6 +387,13 @@ resources:
limits:
memory: "1024Mi"
cpu: "2000m"
tests:
limits:
memory: "128Mi"
cpu: "500m"
requests:
memory: "128Mi"
cpu: "500m"
mounts:
cinder_api:
@ -391,3 +408,6 @@ mounts:
cinder_backup:
init_container: null
cinder_backup:
cinder_tests:
init_container: null
cinder_tests:

View File

@ -99,5 +99,6 @@ fi
helm_test_deployment keystone 600
helm_test_deployment glance 600
helm_test_deployment cinder 600
helm_test_deployment neutron 600
helm_test_deployment nova 600