Neutron: Update force purge of test project to be less aggressive

This PS updates the os purge of the test project to be an optional
operator driven choice, as they will also need to ensure
the project is unique to neutron testing.

Additionally this updates the purge image to be driven by the
charts values.yaml, as with every other image in OSH.

Change-Id: I46807f7c4922a1b411386641eddbd8957ab56f05
Signed-off-by: Pete Birley <pete@port.direct>
This commit is contained in:
Pete Birley 2019-09-26 12:24:11 -05:00
parent b4d673a90e
commit b1f8446e5b
4 changed files with 24 additions and 18 deletions

View File

@ -16,12 +16,7 @@
set -ex
while [ ! -f /tmp/pod-tmp/test_done.log ]
do
sleep 2s
done
ospurge --purge-project $OS_TEST_PROJECT_NAME
openstack quota set $OS_TEST_PROJECT_NAME --networks $NETWORK_QUOTA --ports $PORT_QUOTA --routers $ROUTER_QUOTA --subnets $SUBNET_QUOTA --secgroups $SEC_GROUP_QUOTA
if openstack project show "${OS_TEST_PROJECT_NAME}"; then
ospurge --purge-project "${OS_TEST_PROJECT_NAME}"
openstack quota set "${OS_TEST_PROJECT_NAME}" --networks "${NETWORK_QUOTA}" --ports "${PORT_QUOTA}" --routers "${ROUTER_QUOTA}" --subnets "${SUBNET_QUOTA}" --secgroups "${SEC_GROUP_QUOTA}"
fi

View File

@ -83,6 +83,6 @@ data:
{{ tuple "bin/_neutron-ironic-agent.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
rabbit-init.sh: |
{{- include "helm-toolkit.scripts.rabbit_init" . | indent 4 }}
neutron-cleanup.sh: |
{{ tuple "bin/_neutron-cleanup.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
neutron-test-force-cleanup.sh: |
{{ tuple "bin/_neutron-test-force-cleanup.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
{{- end }}

View File

@ -63,9 +63,9 @@ spec:
{{- end }}
- name: SERVICE_OS_ROLE
value: {{ .Values.endpoints.identity.auth.test.role | quote }}
containers:
{{ if $envAll.Values.conf.rally_tests.force_project_purge }}
- name: {{ .Release.Name }}-reset
image: openstackhelm/ospurge
{{ tuple $envAll "purge_test" | include "helm-toolkit.snippets.image" | indent 6 }}
env:
{{- with $env := dict "ksUserSecret" .Values.secrets.identity.admin }}
{{- include "helm-toolkit.snippets.keystone_openrc_env_vars" $env | indent 8 }}
@ -85,14 +85,17 @@ spec:
value: {{ (first (index .Values.conf.rally_tests.tests "NeutronNetworks.create_and_delete_subnets")).context.quotas.neutron.subnet | quote }}
- name: SEC_GROUP_QUOTA
value: {{ (first (index .Values.conf.rally_tests.tests "NeutronSecurityGroup.create_and_list_security_groups")).context.quotas.neutron.security_group | quote }}
command: ["/bin/bash", "-c", "/tmp/neutron-cleanup.sh"]
command:
- /tmp/neutron-test-force-cleanup.sh
volumeMounts:
- name: neutron-bin
mountPath: /tmp/neutron-cleanup.sh
subPath: neutron-cleanup.sh
mountPath: /tmp/neutron-test-force-cleanup.sh
subPath: neutron-test-force-cleanup.sh
readOnly: true
- name: pod-tmp
mountPath: /tmp/pod-tmp
{{ end }}
containers:
- name: {{ .Release.Name }}-test
{{ tuple $envAll "test" | include "helm-toolkit.snippets.image" | indent 6 }}
{{ tuple $envAll $envAll.Values.pod.resources.jobs.tests | include "helm-toolkit.snippets.kubernetes_resources" | indent 6 }}
@ -105,8 +108,8 @@ spec:
{{- end }}
- name: RALLY_ENV_NAME
value: {{.Release.Name}}
command: ["/bin/bash", "-c"]
args: ["/tmp/rally-test.sh; touch /tmp/test_done.log"]
command:
- /tmp/rally-test.sh
volumeMounts:
- name: pod-tmp
mountPath: /tmp

View File

@ -23,6 +23,7 @@ images:
tags:
bootstrap: docker.io/openstackhelm/heat:ocata-ubuntu_xenial
test: docker.io/xrally/xrally-openstack:1.3.0
purge_test: docker.io/openstackhelm/ospurge:latest
db_init: docker.io/openstackhelm/heat:ocata-ubuntu_xenial
neutron_db_sync: docker.io/openstackhelm/neutron:ocata-ubuntu_xenial
db_drop: docker.io/openstackhelm/heat:ocata-ubuntu_xenial
@ -742,6 +743,7 @@ pod:
conf:
rally_tests:
force_project_purge: false
run_tempest: false
tests:
NeutronNetworks.create_and_delete_networks:
@ -2212,6 +2214,12 @@ endpoints:
region_name: RegionOne
username: neutron-test
password: password
# NOTE: this project will be purged and reset if
# conf.rally_tests.force_project_purge is set to true
# which may be required upon test failure, but be aware that this will
# expunge all openstack objects, so if this is used a seperate project
# should be used for each helm test, and also it should be ensured
# that this project is not in use by other tenants
project_name: test
user_domain_name: service
project_domain_name: service