Neutron: Helm test functionaility using Rally

This PS adds 'helm test' functionality using Rally to Neutron

Change-Id: I6e89aca1870704368b4dc1f8ad93f8ba563002c1
Partial-Implements: blueprint implement-helm-test-for-charts
External-Tracking-Id: OSH-89
This commit is contained in:
Pete Birley 2017-06-22 15:47:19 -05:00
parent 960613e5c6
commit 653f7ed3e4
6 changed files with 374 additions and 0 deletions

View File

@ -17,6 +17,8 @@ kind: ConfigMap
metadata:
name: neutron-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

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

View File

@ -0,0 +1,295 @@
---
NeutronNetworks.create_and_delete_networks:
- args:
network_create_args: {}
context:
quotas:
neutron:
network: -1
users:
tenants: 1
users_per_tenant: 1
runner:
concurrency: 1
times: 1
type: constant
sla:
failure_rate:
max: 0
NeutronNetworks.create_and_delete_ports:
- args:
network_create_args: {}
port_create_args: {}
ports_per_network: 10
context:
network: {}
quotas:
neutron:
network: -1
port: -1
users:
tenants: 1
users_per_tenant: 1
runner:
concurrency: 1
times: 1
type: constant
sla:
failure_rate:
max: 0
NeutronNetworks.create_and_delete_routers:
- args:
network_create_args: {}
router_create_args: {}
subnet_cidr_start: 1.1.0.0/30
subnet_create_args: {}
subnets_per_network: 2
context:
network: {}
quotas:
neutron:
network: -1
router: -1
subnet: -1
users:
tenants: 1
users_per_tenant: 1
runner:
concurrency: 1
times: 1
type: constant
sla:
failure_rate:
max: 0
NeutronNetworks.create_and_delete_subnets:
- args:
network_create_args: {}
subnet_cidr_start: 1.1.0.0/30
subnet_create_args: {}
subnets_per_network: 2
context:
network: {}
quotas:
neutron:
network: -1
subnet: -1
users:
tenants: 1
users_per_tenant: 1
runner:
concurrency: 1
times: 1
type: constant
sla:
failure_rate:
max: 0
NeutronNetworks.create_and_list_routers:
- args:
network_create_args: {}
router_create_args: {}
subnet_cidr_start: 1.1.0.0/30
subnet_create_args: {}
subnets_per_network: 2
context:
network: {}
quotas:
neutron:
network: -1
router: -1
subnet: -1
users:
tenants: 3
users_per_tenant: 3
runner:
concurrency: 1
times: 1
type: constant
sla:
failure_rate:
max: 0
NeutronNetworks.create_and_list_subnets:
- args:
network_create_args: {}
subnet_cidr_start: 1.1.0.0/30
subnet_create_args: {}
subnets_per_network: 2
context:
network: {}
quotas:
neutron:
network: -1
subnet: -1
users:
tenants: 1
users_per_tenant: 1
runner:
concurrency: 1
times: 1
type: constant
sla:
failure_rate:
max: 0
NeutronNetworks.create_and_show_network:
- args:
network_create_args: {}
context:
quotas:
neutron:
network: -1
users:
tenants: 1
users_per_tenant: 1
runner:
concurrency: 1
times: 1
type: constant
sla:
failure_rate:
max: 0
NeutronNetworks.create_and_update_networks:
- args:
network_create_args: {}
network_update_args:
admin_state_up: false
name: _updated
context:
quotas:
neutron:
network: -1
users:
tenants: 1
users_per_tenant: 1
runner:
concurrency: 1
times: 1
type: constant
sla:
failure_rate:
max: 0
NeutronNetworks.create_and_update_ports:
- args:
network_create_args: {}
port_create_args: {}
port_update_args:
admin_state_up: false
device_id: dummy_id
device_owner: dummy_owner
name: _port_updated
ports_per_network: 5
context:
network: {}
quotas:
neutron:
network: -1
port: -1
users:
tenants: 1
users_per_tenant: 1
runner:
concurrency: 1
times: 1
type: constant
sla:
failure_rate:
max: 0
NeutronNetworks.create_and_update_routers:
- args:
network_create_args: {}
router_create_args: {}
router_update_args:
admin_state_up: false
name: _router_updated
subnet_cidr_start: 1.1.0.0/30
subnet_create_args: {}
subnets_per_network: 2
context:
network: {}
quotas:
neutron:
network: -1
router: -1
subnet: -1
users:
tenants: 1
users_per_tenant: 1
runner:
concurrency: 1
times: 1
type: constant
sla:
failure_rate:
max: 0
NeutronNetworks.create_and_update_subnets:
- args:
network_create_args: {}
subnet_cidr_start: 1.4.0.0/16
subnet_create_args: {}
subnet_update_args:
enable_dhcp: false
name: _subnet_updated
subnets_per_network: 2
context:
network: {}
quotas:
neutron:
network: -1
subnet: -1
users:
tenants: 1
users_per_tenant: 1
runner:
concurrency: 1
times: 1
type: constant
sla:
failure_rate:
max: 0
NeutronNetworks.list_agents:
- args:
agent_args: {}
context:
users:
tenants: 1
users_per_tenant: 1
runner:
concurrency: 1
times: 1
type: constant
sla:
failure_rate:
max: 0
NeutronSecurityGroup.create_and_list_security_groups:
- args:
security_group_create_args: {}
context:
quotas:
neutron:
security_group: -1
users:
tenants: 1
users_per_tenant: 1
runner:
concurrency: 1
times: 1
type: constant
sla:
failure_rate:
max: 0
NeutronSecurityGroup.create_and_update_security_groups:
- args:
security_group_create_args: {}
security_group_update_args: {}
context:
quotas:
neutron:
security_group: -1
users:
tenants: 1
users_per_tenant: 1
runner:
concurrency: 1
times: 1
type: constant
sla:
failure_rate:
max: 0

View File

@ -0,0 +1,64 @@
# 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 "neutron-env-keystone-admin" }}
{{- $dependencies := .Values.dependencies.tests }}
{{- $mounts_neutron_tests := .Values.mounts.neutron_tests.neutron_tests }}
{{- $mounts_neutron_tests_init := .Values.mounts.neutron_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_neutron_tests_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
containers:
- name: {{.Release.Name}}-token-issue-test
image: {{ .Values.images.test }}
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:
- /tmp/rally-test.sh
volumeMounts:
- name: neutron-etc
mountPath: /etc/rally/rally_tests.yaml
subPath: rally_tests.yaml
readOnly: true
- name: neutron-bin
mountPath: /tmp/rally-test.sh
subPath: rally-test.sh
readOnly: true
- name: rally-db
mountPath: /var/lib/rally
{{ if $mounts_neutron_tests.volumeMounts }}{{ toYaml $mounts_neutron_tests.volumeMounts | indent 8 }}{{ end }}
volumes:
- name: neutron-etc
configMap:
name: neutron-etc
- name: neutron-bin
configMap:
name: neutron-bin
defaultMode: 0555
- name: rally-db
emptyDir: {}
{{ if $mounts_neutron_tests.volumes }}{{ toYaml $mounts_neutron_tests.volumes | indent 4 }}{{ end }}

View File

@ -21,6 +21,7 @@ replicas:
server: 1
images:
test: docker.io/kolla/ubuntu-binary-rally:4.0.0
db_init: 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
@ -207,6 +208,12 @@ dependencies:
endpoint: internal
daemonset:
- ovs-agent
tests:
services:
- service: network
endpoint: internal
- service: compute
endpoint: internal
resources:
enabled: false
@ -529,3 +536,6 @@ mounts:
neutron_ovs_agent:
init_container: null
neutron_ovs_agent:
neutron_tests:
init_container: null
neutron_tests:

View File

@ -55,3 +55,4 @@ fi
helm_test_deployment keystone 600
helm_test_deployment glance 600
helm_test_deployment neutron 600