Add functional testing gate

Add functional test and Zuul configuration for execution in the
OpenDev check/gate jobs.

Change-Id: I24ea2c9938082275a5358802cc7619c78f1d1395
This commit is contained in:
James Page 2022-10-31 14:58:28 +01:00
parent 04d6b4a427
commit 7e99d0460c
6 changed files with 248 additions and 2 deletions

View File

@ -2,3 +2,6 @@
templates:
- openstack-python3-charm-yoga-jobs
- openstack-cover-jobs
- microk8s-func-test
vars:
charm_build_name: ovn-relay-k8s

View File

@ -1,7 +1,5 @@
- project:
templates:
- charm-unit-jobs-py38
- charm-unit-jobs-py310
- charm-publish-jobs
vars:
needs_charm_build: true

View File

@ -8,3 +8,7 @@ coverage
mock
flake8
stestr
git+https://github.com/openstack-charmers/zaza.git#egg=zaza
git+https://github.com/openstack-charmers/zaza-openstack-tests.git#egg=zaza.openstack
git+https://opendev.org/openstack/tempest.git#egg=tempest
ops

140
tests/bundles/xena.yaml Normal file
View File

@ -0,0 +1,140 @@
bundle: kubernetes
applications:
traefik:
charm: ch:traefik-k8s
channel: edge
scale: 1
trust: true
traefik-public:
charm: ch:traefik-k8s
channel: edge
scale: 1
trust: true
options:
kubernetes-service-annotations: metallb.universe.tf/address-pool=public
mysql:
charm: ch:mysql-k8s
channel: edge
scale: 1
trust: false
rabbitmq:
charm: ch:rabbitmq-k8s
channel: edge
scale: 1
trust: true
keystone:
charm: ch:keystone-k8s
channel: edge
scale: 1
trust: true
options:
admin-role: admin
storage:
fernet-keys: 5M
credential-keys: 5M
glance:
charm: ch:glance-k8s
channel: edge
scale: 1
trust: true
storage:
local-repository: 5G
nova:
charm: ch:nova-k8s
channel: edge
scale: 1
trust: true
placement:
charm: ch:placement-k8s
channel: edge
scale: 1
trust: true
neutron:
charm: ch:neutron-k8s
channel: edge
scale: 1
trust: true
ovn-central:
charm: ch:ovn-central-k8s
channel: edge
scale: 1
trust: true
ovn-relay:
charm: ../../ovn-relay-k8s.charm
scale: 1
trust: true
resources:
ovn-sb-db-server-image: kolla/ubuntu-binary-ovn-sb-db-server:xena
vault:
charm: ch:icey-vault-k8s
channel: stable
scale: 1
resources:
vault-image: vault
relations:
- - mysql:database
- keystone:database
- - traefik:ingress
- keystone:ingress-internal
- - traefik-public:ingress
- keystone:ingress-public
- - mysql:database
- glance:database
- - rabbitmq:amqp
- glance:amqp
- - keystone:identity-service
- glance:identity-service
- - traefik:ingress
- glance:ingress-internal
- - traefik-public:ingress
- glance:ingress-public
- - mysql:database
- nova:database
- - mysql:database
- nova:api-database
- - mysql:database
- nova:cell-database
- - rabbitmq:amqp
- nova:amqp
- - keystone:identity-service
- nova:identity-service
- - traefik:ingress
- nova:ingress-internal
- - traefik-public:ingress
- nova:ingress-public
- - mysql:database
- placement:database
- - keystone:identity-service
- placement:identity-service
- - traefik:ingress
- placement:ingress-internal
- - traefik-public:ingress
- placement:ingress-public
- - mysql:database
- neutron:database
- - rabbitmq:amqp
- neutron:amqp
- - keystone:identity-service
- neutron:identity-service
- - traefik:ingress
- neutron:ingress-internal
- - traefik-public:ingress
- neutron:ingress-public
- - vault:insecure-certificates
- neutron:certificates
- - neutron:ovsdb-cms
- ovn-central:ovsdb-cms
- - vault:insecure-certificates
- ovn-central:certificates
- - vault:insecure-certificates
- ovn-relay:certificates
- - ovn-relay:ovsdb-cms
- ovn-central:ovsdb-cms

73
tests/tests.yaml Normal file
View File

@ -0,0 +1,73 @@
gate_bundles:
- xena
smoke_bundles:
- xena
configure:
- zaza.openstack.charm_tests.keystone.setup.wait_for_all_endpoints
- zaza.openstack.charm_tests.keystone.setup.add_tempest_roles
- zaza.openstack.charm_tests.nova.setup.create_flavors
- zaza.openstack.charm_tests.nova.setup.manage_ssh_key
# - zaza.openstack.charm_tests.glance.setup.add_lts_image
# - zaza.openstack.charm_tests.glance.setup.add_cirros_image
# - zaza.openstack.charm_tests.glance.setup.add_cirros_alt_image
tests:
- zaza.openstack.charm_tests.tempest.tests.TempestTestWithKeystoneMinimal
tests_options:
trust:
- xena
ignore_hard_deploy_errors:
- xena
tempest:
default:
smoke: True
exclude-list:
- "tempest.api.image.v2.test_images.BasicOperationsImagesTest.test_register_upload_get_image_file"
- "tempest.api.compute.security_groups.test_security_group_rules.SecurityGroupRulesTestJSON.test_security_group_rules_create"
- "tempest.api.compute.security_groups.test_security_group_rules.SecurityGroupRulesTestJSON.test_security_group_rules_list"
- "tempest.api.compute.security_groups.test_security_groups.SecurityGroupsTestJSON.test_security_groups_create_list_delete"
- "tempest.api.compute.servers.test_server_actions.ServerActionsTestJSON"
- "tempest.api.compute.servers.test_create_server.ServersTestManualDisk"
- "tempest.api.compute.servers.test_server_addresses.ServerAddressesTestJSON"
- "tempest.api.compute.servers.test_create_server.ServersTestJSON"
- "tempest.scenario.test_server_multinode.TestServerMultinode.test_schedule_to_all_nodes"
- "tempest.scenario.test_server_basic_ops.TestServerBasicOps.test_server_basic_ops"
- "tempest.api.compute.servers.test_attach_interfaces.AttachInterfacesUnderV243Test.test_add_remove_fixed_ip"
target_deploy_status:
traefik:
workload-status: active
workload-status-message-regex: '^$'
traefik-public:
workload-status: active
workload-status-message-regex: '^$'
rabbitmq:
workload-status: active
workload-status-message-regex: '^$'
nova:
workload-status: active
workload-status-message-regex: '^$'
glance:
workload-status: active
workload-status-message-regex: '^$'
neutron:
workload-status: active
workload-status-message-regex: '^$'
ovn-central:
workload-status: active
workload-status-message-regex: '^$'
keystone:
workload-status: active
workload-status-message-regex: '^$'
mysql:
workload-status: active
workload-status-message-regex: '^$'
placement:
workload-status: active
workload-status-message-regex: '^$'
vault:
workload-status: active
workload-status-message-regex: '^$'
ovn-relay:
workload-status: active
workload-status-message-regex: '^$'

28
tox.ini
View File

@ -83,6 +83,34 @@ commands =
coverage xml -o cover/coverage.xml
coverage report
[testenv:func-noop]
basepython = python3
commands =
functest-run-suite --help
[testenv:func]
basepython = python3
commands =
functest-run-suite --keep-model
[testenv:func-smoke]
basepython = python3
setenv =
TEST_MODEL_SETTINGS = automatically-retry-hooks=true
TEST_MAX_RESOLVE_COUNT = 5
commands =
functest-run-suite --keep-model --smoke
[testenv:func-dev]
basepython = python3
commands =
functest-run-suite --keep-model --dev
[testenv:func-target]
basepython = python3
commands =
functest-run-suite --keep-model --bundle {posargs}
[coverage:run]
branch = True
concurrency = multiprocessing