From bdfd78b4e79f6a5604f9bd0a7c7beb5f37ad3d6e Mon Sep 17 00:00:00 2001 From: Darla Ahlert Date: Tue, 29 Aug 2017 15:18:53 -0500 Subject: [PATCH] Add Tempest Chart Add basic functioning tempest chart for testing of OpenStack services. This also adds an experimental gate for running a multinode deployment with tempest Change-Id: Id4bb3447345719133e5862514dfd5bc5bac5677d --- .zuul.yaml | 12 + tempest/Chart.yaml | 25 ++ tempest/requirements.yaml | 18 ++ tempest/templates/_helpers.tpl | 25 ++ tempest/templates/bin/_run-tests.sh.tpl | 25 ++ tempest/templates/configmap-bin.yaml | 29 +++ tempest/templates/configmap-etc.yaml | 60 +++++ tempest/templates/job-ks-user.yaml | 20 ++ tempest/templates/job-run-tests.yaml | 109 +++++++++ tempest/templates/pvc-tempest.yaml | 30 +++ tempest/templates/secret-keystone.yaml | 30 +++ tempest/values.yaml | 224 ++++++++++++++++++ tools/deployment/multinode/900-tempest.sh | 92 +++++++ .../playbooks/multinode-tempest-deploy.yaml | 112 +++++++++ tools/images/tempest/Dockerfile | 24 ++ tools/images/tempest/Makefile | 38 +++ tools/overrides/releases/newton/kolla.yaml | 1 + tools/overrides/releases/ocata/kolla.yaml | 1 + tools/overrides/releases/ocata/loci.yaml | 1 + 19 files changed, 876 insertions(+) create mode 100644 tempest/Chart.yaml create mode 100644 tempest/requirements.yaml create mode 100644 tempest/templates/_helpers.tpl create mode 100644 tempest/templates/bin/_run-tests.sh.tpl create mode 100644 tempest/templates/configmap-bin.yaml create mode 100644 tempest/templates/configmap-etc.yaml create mode 100644 tempest/templates/job-ks-user.yaml create mode 100644 tempest/templates/job-run-tests.yaml create mode 100644 tempest/templates/pvc-tempest.yaml create mode 100644 tempest/templates/secret-keystone.yaml create mode 100644 tempest/values.yaml create mode 100755 tools/deployment/multinode/900-tempest.sh create mode 100644 tools/gate/playbooks/multinode-tempest-deploy.yaml create mode 100644 tools/images/tempest/Dockerfile create mode 100644 tools/images/tempest/Makefile diff --git a/.zuul.yaml b/.zuul.yaml index be2d127117..4d6bec0f43 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -124,6 +124,11 @@ - ^.*\.rst$ - ^doc/.*$ - ^releasenotes/.*$ + - openstack-helm-multinode-tempest: + irrelevant-files: + - ^.*\.rst$ + - ^doc/.*$ + - ^releasenotes/.*$ - job: name: openstack-helm-linter @@ -265,3 +270,10 @@ zuul_osh_extra_helm_args_relative_path: --values=./tools/overrides/releases/ocata/kolla.yaml parent: openstack-helm-dev-deploy run: tools/gate/playbooks/dev-deploy-ceph.yaml + +- job: + timeout: 10800 + name: openstack-helm-multinode-tempest + parent: openstack-helm-multinode + nodeset: openstack-helm-five-node-ubuntu + run: tools/gate/playbooks/multinode-tempest-deploy.yaml diff --git a/tempest/Chart.yaml b/tempest/Chart.yaml new file mode 100644 index 0000000000..33c0396ef2 --- /dev/null +++ b/tempest/Chart.yaml @@ -0,0 +1,25 @@ +# 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. + +apiVersion: v1 +description: OpenStack-Helm Tempest +name: tempest +version: 0.1.0 +home: https://docs.openstack.org/developer/tempest +icon: https://www.openstack.org/themes/openstack/images/project-mascots/tempest/OpenStack_Project_tempest_vertical.png +sources: + - https://git.openstack.org/cgit/openstack/tempest + - https://git.openstack.org/cgit/openstack/openstack-helm +maintainers: + - name: OpenStack-Helm Authors diff --git a/tempest/requirements.yaml b/tempest/requirements.yaml new file mode 100644 index 0000000000..53782e69b2 --- /dev/null +++ b/tempest/requirements.yaml @@ -0,0 +1,18 @@ +# 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. + +dependencies: + - name: helm-toolkit + repository: http://localhost:8879/charts + version: 0.1.0 diff --git a/tempest/templates/_helpers.tpl b/tempest/templates/_helpers.tpl new file mode 100644 index 0000000000..87c82dde2b --- /dev/null +++ b/tempest/templates/_helpers.tpl @@ -0,0 +1,25 @@ +{{/* +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. +*/}} + +# This function helps define blacklist and whitelist files for tempest +# It ingests a list and creates the appropriate regex files for the whitelist +# and blacklist + +{{- define "tempest.utils.to_regex_file" -}} +{{- range $test_regex := . -}} +{{ $test_regex }} +{{ end -}} +{{- end -}} diff --git a/tempest/templates/bin/_run-tests.sh.tpl b/tempest/templates/bin/_run-tests.sh.tpl new file mode 100644 index 0000000000..7d0bb34525 --- /dev/null +++ b/tempest/templates/bin/_run-tests.sh.tpl @@ -0,0 +1,25 @@ +#!/bin/bash + +{{/* +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. +*/}} + +set -ex + +tempest cleanup --init-saved-state + +{{ .Values.conf.script }} + +tempest cleanup diff --git a/tempest/templates/configmap-bin.yaml b/tempest/templates/configmap-bin.yaml new file mode 100644 index 0000000000..bb40516840 --- /dev/null +++ b/tempest/templates/configmap-bin.yaml @@ -0,0 +1,29 @@ +{{/* +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. +*/}} + +{{- if .Values.manifests.configmap_bin }} +{{- $envAll := . }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: tempest-bin +data: + ks-user.sh: | +{{- include "helm-toolkit.scripts.keystone_user" . | indent 4 }} + run-tests.sh: | +{{ tuple "bin/_run-tests.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} +{{- end }} diff --git a/tempest/templates/configmap-etc.yaml b/tempest/templates/configmap-etc.yaml new file mode 100644 index 0000000000..0982ea465a --- /dev/null +++ b/tempest/templates/configmap-etc.yaml @@ -0,0 +1,60 @@ +{{/* +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. +*/}} + +{{- if .Values.manifests.configmap_etc }} +{{- $envAll := . }} + +{{- if empty .Values.conf.tempest.auth.admin_username -}} +{{- set .Values.conf.tempest.auth "admin_username" .Values.endpoints.identity.auth.admin.username | quote | trunc 0 -}} +{{- end -}} +{{- if empty .Values.conf.tempest.auth.admin_password -}} +{{- set .Values.conf.tempest.auth "admin_password" .Values.endpoints.identity.auth.admin.password | quote | trunc 0 -}} +{{- end -}} +{{- if empty .Values.conf.tempest.auth.admin_project_name -}} +{{- set .Values.conf.tempest.auth "admin_project_name" .Values.endpoints.identity.auth.admin.project_name | quote | trunc 0 -}} +{{- end -}} +{{- if empty .Values.conf.tempest.auth.admin_domain_name -}} +{{- set .Values.conf.tempest.auth "admin_domain_name" .Values.endpoints.identity.auth.admin.user_domain_name | quote | trunc 0 -}} +{{- end -}} +{{- if empty .Values.conf.tempest.auth.admin_domain_scope -}} +{{- set .Values.conf.tempest.auth "admin_domain_scope" .Values.endpoints.identity.auth.admin.user_domain_name | quote | trunc 0 -}} +{{- end -}} + +{{- if empty .Values.conf.tempest.identity.uri_v3 -}} +{{- tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.tempest.identity "uri_v3" | quote | trunc 0 -}} +{{- end -}} + +{{- if empty .Values.conf.tempest.identity.region -}} +{{- set .Values.conf.tempest.identity "region" .Values.endpoints.identity.auth.admin.region_name | quote | trunc 0 -}} +{{- end -}} + +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: tempest-etc +data: + tempest.conf: |+ +{{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.tempest | indent 4 }} +{{ if not (empty .Values.conf.blacklist) }} + test-blacklist: |+ +{{ include "tempest.utils.to_regex_file" .Values.conf.blacklist | indent 4 }} +{{ end }} +{{ if not (empty .Values.conf.whitelist) }} + test-whitelist: |+ +{{ include "tempest.utils.to_regex_file" .Values.conf.whitelist | indent 4 }} +{{ end }} +{{- end }} diff --git a/tempest/templates/job-ks-user.yaml b/tempest/templates/job-ks-user.yaml new file mode 100644 index 0000000000..8c8260ab67 --- /dev/null +++ b/tempest/templates/job-ks-user.yaml @@ -0,0 +1,20 @@ +{{/* +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. +*/}} + +{{- if .Values.manifests.job_ks_user }} +{{- $ksUserJob := dict "envAll" . "serviceName" "tempest" -}} +{{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }} +{{- end }} diff --git a/tempest/templates/job-run-tests.yaml b/tempest/templates/job-run-tests.yaml new file mode 100644 index 0000000000..c6e94c3814 --- /dev/null +++ b/tempest/templates/job-run-tests.yaml @@ -0,0 +1,109 @@ +{{/* +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. +*/}} + +{{- if .Values.manifests.job_run_tests }} + +{{- $envAll := . }} +{{- $dependencies := .Values.dependencies.static.run_tests }} + +{{- $serviceAccountName := "tempest-run-tests" }} +{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: tempest-run-tests +spec: + template: + metadata: + labels: +{{ tuple $envAll "tempest" "run-tests" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} + spec: + serviceAccountName: {{ $serviceAccountName }} + restartPolicy: OnFailure + nodeSelector: + {{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }} + initContainers: +{{ tuple $envAll $dependencies list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} + - name: tempest-run-tests-init + image: {{ .Values.images.tags.tempest_run_tests }} + imagePullPolicy: {{ .Values.images.tags.pull_policy }} + {{ tuple $envAll $envAll.Values.pod.resources.jobs.run_tests | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} + securityContext: + runAsUser: 0 + command: + - chown + - -R + - "root:" + - /var/lib/tempest/data + volumeMounts: + - name: tempest-reports + mountPath: /var/lib/tempest/data + containers: + - name: tempest-run-tests + image: {{ .Values.images.tags.tempest_run_tests }} + imagePullPolicy: {{ .Values.images.tags.pull_policy }} +{{ tuple $envAll $envAll.Values.pod.resources.jobs.run_tests | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} + command: + - /tmp/run-tests.sh + env: +{{- with $env := dict "ksUserSecret" .Values.secrets.identity.admin }} +{{- include "helm-toolkit.snippets.keystone_openrc_env_vars" $env | indent 12 }} +{{- end }} + volumeMounts: + - name: tempest-bin + mountPath: /tmp/run-tests.sh + subPath: run-tests.sh + readOnly: true + - name: etctempest + mountPath: /etc/tempest + - name: tempest-etc + mountPath: /etc/tempest/tempest.conf + subPath: tempest.conf + readOnly: true +{{ if not (empty .Values.conf.blacklist) }} + - name: tempest-etc + mountPath: /etc/tempest/test-blacklist + subPath: test-blacklist + readOnly: true +{{- end }} +{{ if not (empty .Values.conf.whitelist) }} + - name: tempest-etc + mountPath: /etc/tempest/test-whitelist + subPath: test-whitelist + readOnly: true +{{- end }} + - name: tempest-reports + mountPath: /var/lib/tempest/data + volumes: + - name: etctempest + emptyDir: {} + - name: tempest-etc + configMap: + name: tempest-etc + defaultMode: 0444 + - name: tempest-bin + configMap: + name: tempest-bin + defaultMode: 0555 + - name: tempest-reports + {{- if not .Values.pvc.enabled }} + emptyDir: {} + {{- else }} + persistentVolumeClaim: + claimName: {{ .Values.pvc.name }} + {{- end }} +{{- end }} diff --git a/tempest/templates/pvc-tempest.yaml b/tempest/templates/pvc-tempest.yaml new file mode 100644 index 0000000000..dd120bd522 --- /dev/null +++ b/tempest/templates/pvc-tempest.yaml @@ -0,0 +1,30 @@ +# {{/* +# 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. +# */}} + +{{- if .Values.manifests.pvc }} + +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ .Values.pvc.name }} +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.pvc.requests.storage }} + storageClassName: {{ .Values.pvc.storage_class }} +{{- end }} diff --git a/tempest/templates/secret-keystone.yaml b/tempest/templates/secret-keystone.yaml new file mode 100644 index 0000000000..7248a4091d --- /dev/null +++ b/tempest/templates/secret-keystone.yaml @@ -0,0 +1,30 @@ +{{/* +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. +*/}} + +{{- if .Values.manifests.secret_keystone }} +{{- $envAll := . }} +{{- range $key1, $userClass := tuple "admin" "tempest" }} +{{- $secretName := index $envAll.Values.secrets.identity $userClass }} +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ $secretName }} +type: Opaque +data: +{{- tuple $userClass "internal" $envAll | include "helm-toolkit.snippets.keystone_secret_openrc" | indent 2 -}} +{{- end }} +{{- end }} diff --git a/tempest/values.yaml b/tempest/values.yaml new file mode 100644 index 0000000000..3845ced63f --- /dev/null +++ b/tempest/values.yaml @@ -0,0 +1,224 @@ +# 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. + +labels: + job: + node_selector_key: openstack-control-plane + node_selector_value: enabled + +images: + tags: + dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.2.1 + tempest_run_tests: docker.io/kolla/ubuntu-source-tempest:3.0.3 + ks_user: docker.io/openstackhelm/heat:newton + pull_policy: "IfNotPresent" + +pod: + user: + tempest: + uid: 1000 + resources: + enabled: false + jobs: + ks_user: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + run_tests: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + +dependencies: + static: + ks_user: + services: + - service: identity + endpoint: internal + run_tests: + jobs: + - tempest-ks-user + services: + - service: identity + endpoint: internal + +conf: + script: | + tempest run --smoke + # The following sections can be used to blacklist and whitelist specific tests. + # If either section is not empty, it will be used to create an entry in the + # tempest-etc configmap and will be mounted into the tempest-run-tests pod + # blacklist: + # - (?:tempest\.api\.identity\.admin\.v3\.test_groups\.GroupsV3TestJSON\.test_list_groups) + # - (?:tempest\.api\.image\.v2\.test_images\.ListSharedImagesTest\.test_list_images_param_member_status) + # - (?:tempest\.scenario\.test_encrypted_cinder_volumes\.TestEncryptedCinderVolumes\.test_encrypted_cinder_volumes_cryptsetup) + # - (?:tempest\.scenario\.test_encrypted_cinder_volumes\.TestEncryptedCinderVolumes\.test_encrypted_cinder_volumes_luks) + # - (?:tempest\.api\.network\.test_networks\.NetworksIpV6Test\.test_external_network_visibility) + # - (?:tempest\.api\.network\.test_networks\.NetworksTest\.test_external_network_visibility) + # - (?:tempest\.scenario\.test_network_v6\.TestGettingAddress\.test_dualnet_multi_prefix_slaac) + # - (?:tempest\.scenario\.test_network_v6\.TestGettingAddress\.test_dualnet_multi_prefix_dhcpv6_stateless) + # - (?:tempest\.scenario\.test_network_basic_ops\.TestNetworkBasicOps\.test_update_router_admin_state) + # - (?:tempest\.scenario\.test_network_basic_ops\.TestNetworkBasicOps\.test_router_rescheduling) + # - (?:tempest\.scenario\.test_network_basic_ops\.TestNetworkBasicOps\.test_update_instance_port_admin_state) + # whitelist: + # - (?:tempest\.api\.identity\.admin\.v3\.test_groups\.GroupsV3TestJSON\.test_list_groups) + # - (?:tempest\.api\.image\.v2\.test_images\.ListSharedImagesTest\.test_list_images_param_member_status) + # - (?:tempest\.scenario\.test_encrypted_cinder_volumes\.TestEncryptedCinderVolumes\.test_encrypted_cinder_volumes_cryptsetup) + # - (?:tempest\.scenario\.test_encrypted_cinder_volumes\.TestEncryptedCinderVolumes\.test_encrypted_cinder_volumes_luks) + # - (?:tempest\.api\.network\.test_networks\.NetworksIpV6Test\.test_external_network_visibility) + # - (?:tempest\.api\.network\.test_networks\.NetworksTest\.test_external_network_visibility) + # - (?:tempest\.scenario\.test_network_v6\.TestGettingAddress\.test_dualnet_multi_prefix_slaac) + # - (?:tempest\.scenario\.test_network_v6\.TestGettingAddress\.test_dualnet_multi_prefix_dhcpv6_stateless) + # - (?:tempest\.scenario\.test_network_basic_ops\.TestNetworkBasicOps\.test_update_router_admin_state) + # - (?:tempest\.scenario\.test_network_basic_ops\.TestNetworkBasicOps\.test_router_rescheduling) + # - (?:tempest\.scenario\.test_network_basic_ops\.TestNetworkBasicOps\.test_update_instance_port_admin_state) + tempest: + auth: + use_dynamic_credentials: true + admin_domain_scope: true + tempest_roles: admin, _member_ + min_compute_nodes: 1 + identity: + auth_version: v3 + identity-feature-enabled: + api_v2: false + api_v3: true + image: + http_image: "http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img" + container_formats: bare + disk_formats: raw + network: + dns_servers: 10.96.0.10 + project_networks_reachable: false + shared_physical_network: true + network-feature-enabled: + floating_ips: true + api_extensions: + - default-subnetpools + - network-ip-availability + - network_availability_zone + - auto-allocated-topology + - ext-gw-mode + - binding + - agent + - subnet_allocation + - l3_agent_scheduler + - tag + - external-net + - flavors + - net-mtu + - availability_zone + - quotas + - l3-ha + - provider + - multi-provider + - address-scope + - extraroute + - subnet-service-types + - standard-attr-timestamp + - service-type + - l3-flavors + - port-security + - extra_dhcp_opt + - standard-attr-revisions + - pagination + - sorting + - security-group + - dhcp_agent_scheduler + - router_availability_zone + - rbac-policies + - standard-attr-description + - router + - allowed-address-pairs + - project-id + - dvr + service_available: + cinder: true + glance: true + # The following services are marked as unavailable by default. The default + # tempest image used includes a bug resulting in failed network tests that + # wasn't fixed in newton. Swift is disabled by default as the swift chart + # isn't complete + neutron: false + nova: false + swift: false + validation: + connect_method: floating + volume: + disk_formats: raw + backend_name: rbd1 + storage_protocol: rbd + volume-feature-enabled: + api_v1: False + api_v3: True + +pvc: + enabled: true + name: pvc-tempest + requests: + storage: 2Gi + storage_class: general + +secrets: + identity: + admin: tempest-keystone-admin + tempest: tempest-keystone-user + +endpoints: + cluster_domain_suffix: cluster.local + identity: + name: keystone + auth: + admin: + region_name: RegionOne + username: admin + password: password + project_name: admin + user_domain_name: default + project_domain_name: default + tempest: + role: admin + region_name: RegionOne + username: tempest + password: password + project_name: service + user_domain_name: default + project_domain_name: default + hosts: + default: keystone-api + public: keystone + host_fqdn_override: + default: null + path: + default: /v3 + scheme: + default: http + port: + admin: + default: 35357 + api: + default: 80 + +manifests: + configmap_bin: true + configmap_etc: true + job_ks_user: true + job_run_tests: true + secret_keystone: true diff --git a/tools/deployment/multinode/900-tempest.sh b/tools/deployment/multinode/900-tempest.sh new file mode 100755 index 0000000000..68d114fb18 --- /dev/null +++ b/tools/deployment/multinode/900-tempest.sh @@ -0,0 +1,92 @@ +#!/bin/bash + +# 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. + +set -xe + +#NOTE: Pull images and lint chart +make pull-images tempest + +#NOTE: Deploy command +export OS_CLOUD=openstack_helm + +export OSH_EXT_NET_NAME="public" +export OSH_EXT_SUBNET_NAME="public-subnet" +export OSH_EXT_SUBNET="172.24.4.0/24" +export OSH_BR_EX_ADDR="172.24.4.1/24" +openstack stack create --wait \ + --parameter network_name=${OSH_EXT_NET_NAME} \ + --parameter physical_network_name=public \ + --parameter subnet_name=${OSH_EXT_SUBNET_NAME} \ + --parameter subnet_cidr=${OSH_EXT_SUBNET} \ + --parameter subnet_gateway=${OSH_BR_EX_ADDR%/*} \ + -t ./tools/gate/files/heat-public-net-deployment.yaml \ + heat-public-net-deployment + +export OSH_PRIVATE_SUBNET_POOL="10.0.0.0/8" +export OSH_PRIVATE_SUBNET_POOL_NAME="shared-default-subnetpool" +export OSH_PRIVATE_SUBNET_POOL_DEF_PREFIX="24" +openstack stack create --wait \ + --parameter subnet_pool_name=${OSH_PRIVATE_SUBNET_POOL_NAME} \ + --parameter subnet_pool_prefixes=${OSH_PRIVATE_SUBNET_POOL} \ + --parameter subnet_pool_default_prefix_length=${OSH_PRIVATE_SUBNET_POOL_DEF_PREFIX} \ + -t ./tools/gate/files/heat-subnet-pool-deployment.yaml \ + heat-subnet-pool-deployment + +IMAGE_NAME=$(openstack image show -f value -c name \ + $(openstack image list -f csv | awk -F ',' '{ print $2 "," $1 }' | \ + grep "^\"Cirros" | head -1 | awk -F ',' '{ print $2 }' | tr -d '"')) +FLAVOR_ID=$(openstack flavor show m1.tiny -f value -c id) +IMAGE_ID=$(openstack image show "${IMAGE_NAME}" -f value -c id) +NETWORK_ID=$(openstack network show public -f value -c id) + +if [ "x$(systemd-detect-virt)" == "xnone" ]; then + HYPERVISOR_TYPE="qemu" +fi + +#NOTE: Deploy tempest +tee /tmp/tempest.yaml << EOF +conf: + tempest: + compute: + flavor_ref: ${FLAVOR_ID} + image_ref: ${IMAGE_ID} + image_ref_alt: ${IMAGE_ID} + hypervisor_type: ${HYPERVISOR_TYPE} + network: + default_network: ${OSH_PRIVATE_SUBNET_POOL} + project_network_cidr: 172.0.4.0/16 + floating_network_name: "public" + public_network_id: ${NETWORK_ID} + validation: + image_ssh_user: "cirros" + image_ssh_password: "gocubsgo" + network_for_ssh: "public" + floating_ip_range: ${OSH_EXT_SUBNET} +pvc: + enabled: false +EOF + +envsubst < /tmp/tempest.yaml + +helm upgrade --install tempest ./tempest \ + --namespace=openstack \ + --values=/tmp/tempest.yaml + +#NOTE: Wait for deploy +./tools/deployment/common/wait-for-pods.sh openstack 2400 + +#NOTE: Validate Deployment info +kubectl get -n openstack jobs --show-all diff --git a/tools/gate/playbooks/multinode-tempest-deploy.yaml b/tools/gate/playbooks/multinode-tempest-deploy.yaml new file mode 100644 index 0000000000..e6f68777be --- /dev/null +++ b/tools/gate/playbooks/multinode-tempest-deploy.yaml @@ -0,0 +1,112 @@ +# 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. + +- hosts: primary + tasks: + - name: Setup OS and K8s Clients + shell: | + set -xe; + ./tools/deployment/multinode/010-setup-client.sh + args: + chdir: "{{ zuul.project.src_dir }}" + - name: Deploy Ingress + shell: | + set -xe; + ./tools/deployment/multinode/020-ingress.sh + args: + chdir: "{{ zuul.project.src_dir }}" + - name: Deploy Ceph + shell: | + set -xe; + ./tools/deployment/multinode/030-ceph.sh + args: + chdir: "{{ zuul.project.src_dir }}" + - name: Setup openstack namespace for ceph + shell: | + set -xe; + ./tools/deployment/multinode/040-ceph-ns-activate.sh + args: + chdir: "{{ zuul.project.src_dir }}" + - name: Deploy MariaDB + shell: | + set -xe; + ./tools/deployment/multinode/050-mariadb.sh + args: + chdir: "{{ zuul.project.src_dir }}" + - name: Deploy RabbitMQ + shell: | + set -xe; + ./tools/deployment/multinode/060-rabbitmq.sh + args: + chdir: "{{ zuul.project.src_dir }}" + - name: Deploy Memcached + shell: | + set -xe; + ./tools/deployment/multinode/070-memcached.sh + args: + chdir: "{{ zuul.project.src_dir }}" + - name: Deploy Keystone + shell: | + set -xe; + ./tools/deployment/multinode/080-keystone.sh + args: + chdir: "{{ zuul.project.src_dir }}" + - name: Deploy Keystone RadosGW endpoints and user + shell: | + set -xe; + ./tools/deployment/multinode/090-ceph-radosgateway.sh + args: + chdir: "{{ zuul.project.src_dir }}" + - name: Deploy Glance + shell: | + set -xe; + ./tools/deployment/multinode/100-glance.sh + args: + chdir: "{{ zuul.project.src_dir }}" + - name: Deploy Cinder + shell: | + set -xe; + ./tools/deployment/multinode/110-cinder.sh + args: + chdir: "{{ zuul.project.src_dir }}" + - name: Deploy OpenVswitch + shell: | + set -xe; + ./tools/deployment/multinode/120-openvswitch.sh + args: + chdir: "{{ zuul.project.src_dir }}" + - name: Deploy Libvirt + shell: | + set -xe; + ./tools/deployment/multinode/130-libvirt.sh + args: + chdir: "{{ zuul.project.src_dir }}" + - name: Deploy ComputeKit + shell: | + set -xe; + ./tools/deployment/multinode/140-compute-kit.sh + args: + chdir: "{{ zuul.project.src_dir }}" + - name: Deploy Heat + shell: | + set -xe; + ./tools/deployment/multinode/150-heat.sh + args: + chdir: "{{ zuul.project.src_dir }}" + - name: Deploy Tempest + shell: | + set -xe; + ./tools/deployment/multinode/900-tempest.sh + args: + chdir: "{{ zuul.project.src_dir }}" diff --git a/tools/images/tempest/Dockerfile b/tools/images/tempest/Dockerfile new file mode 100644 index 0000000000..2a3e3c8fed --- /dev/null +++ b/tools/images/tempest/Dockerfile @@ -0,0 +1,24 @@ +FROM ubuntu:16.04 + +RUN set -ex ;\ + export DEBIAN_FRONTEND=noninteractive ;\ + apt-get update ;\ + apt-get upgrade -y ;\ + apt-get install netbase -y ;\ + apt-get install --no-install-recommends -y \ + python-dev \ + build-essential \ + python-pip \ + git ;\ + git clone https://git.openstack.org/openstack/tempest ;\ + git clone https://git.openstack.org/openstack/cinder-tempest-plugin ;\ + git clone https://git.openstack.org/openstack/heat-tempest-plugin ;\ + git clone https://git.openstack.org/openstack/keystone-tempest-plugin ;\ + git clone https://git.openstack.org/openstack/neutron-tempest-plugin ;\ + pip install -U setuptools ;\ + pip install wheel ;\ + pip install -e tempest/ \ + cinder-tempest-plugin/ \ + heat-tempest-plugin/ \ + keystone-tempest-plugin/ \ + neutron-tempest-plugin/ ;\ diff --git a/tools/images/tempest/Makefile b/tools/images/tempest/Makefile new file mode 100644 index 0000000000..07211155a4 --- /dev/null +++ b/tools/images/tempest/Makefile @@ -0,0 +1,38 @@ +# 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. + +# It's necessary to set this because some environments don't link sh -> bash. +SHELL := /bin/bash + +DOCKER_REGISTRY ?= docker.io +IMAGE_NAME ?= tempest +IMAGE_PREFIX ?= openstackhelm +IMAGE_TAG ?= plugins +LABEL ?= putlabelshere + +IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG} + +# Build Deckhand Docker image for this project +.PHONY: images +images: build_$(IMAGE_NAME) + +# Make targets intended for use by the primary targets above. +.PHONY: build_$(IMAGE_NAME) +build_$(IMAGE_NAME): + docker build \ + --network=host \ + --force-rm \ + --label $(LABEL) \ + -t $(IMAGE) \ + . diff --git a/tools/overrides/releases/newton/kolla.yaml b/tools/overrides/releases/newton/kolla.yaml index 8f7e82d714..a7029ba6aa 100644 --- a/tools/overrides/releases/newton/kolla.yaml +++ b/tools/overrides/releases/newton/kolla.yaml @@ -81,6 +81,7 @@ images: senlin_api: 'docker.io/kolla/ubuntu-source-senlin-api:3.0.3' senlin_db_sync: 'docker.io/kolla/ubuntu-source-senlin-api:3.0.3' senlin_engine: 'docker.io/kolla/ubuntu-source-senlin-engine:3.0.3' + tempest: 'docker.io/kolla/ubuntu-source-tempest:3.0.3' test: 'docker.io/kolla/ubuntu-source-rally:4.0.0' pod: user: diff --git a/tools/overrides/releases/ocata/kolla.yaml b/tools/overrides/releases/ocata/kolla.yaml index 735fabe236..8471f45e76 100644 --- a/tools/overrides/releases/ocata/kolla.yaml +++ b/tools/overrides/releases/ocata/kolla.yaml @@ -78,6 +78,7 @@ images: senlin_api: 'docker.io/kolla/ubuntu-source-senlin-api:ocata' senlin_db_sync: 'docker.io/kolla/ubuntu-source-senlin-api:ocata' senlin_engine: 'docker.io/kolla/ubuntu-source-senlin-engine:ocata' + tempest: 'docker.io/kolla/ubuntu-source-tempest:4.0.3' test: 'docker.io/kolla/ubuntu-source-rally:4.0.0' pod: #NOTE(portdirect): see https://github.com/openstack/kolla/blob/f62f5ae2fa5e7808722f9b37b48a50b39c20b46d/kolla/common/config.py#L695-L998 diff --git a/tools/overrides/releases/ocata/loci.yaml b/tools/overrides/releases/ocata/loci.yaml index ae4c7ff17b..16fb945a67 100644 --- a/tools/overrides/releases/ocata/loci.yaml +++ b/tools/overrides/releases/ocata/loci.yaml @@ -76,4 +76,5 @@ images: senlin_api: 'docker.io/openstackhelm/senlin:ocata' senlin_db_sync: 'docker.io/openstackhelm/senlin:ocata' senlin_engine: 'docker.io/openstackhelm/senlin:ocata' + tempest: 'docker.io/kolla/ubuntu-source-tempest:4.0.3' test: 'docker.io/kolla/ubuntu-source-rally:4.0.0'