From 13a994f78db35c2f0c17ebaa93c7738b8fc6a5b4 Mon Sep 17 00:00:00 2001 From: Alex Kavanagh Date: Thu, 14 Apr 2022 10:32:30 +0100 Subject: [PATCH] Migrate charm charmcraft and for the yoga track Change-Id: I455d079ffb7ca081d8a1b54d1afcc28d5b8e1751 --- .gitignore | 1 + .zuul.yaml | 2 +- build-requirements.txt | 7 ++ charmcraft.yaml | 33 ++++++++ metadata.yaml | 1 + osci.yaml | 11 +-- rename.sh | 13 +++ requirements.txt | 9 +- src/config.yaml | 3 + src/metadata.yaml | 5 +- src/test-requirements.txt | 3 + src/tests/bundles/bionic-queens.yaml | 50 ----------- src/tests/bundles/bionic-rocky.yaml | 53 ------------ src/tests/bundles/bionic-stein.yaml | 53 ------------ src/tests/bundles/bionic-train.yaml | 53 ------------ src/tests/bundles/bionic-ussuri.yaml | 55 ------------ src/tests/bundles/focal-ussuri.yaml | 113 ------------------------- src/tests/bundles/focal-victoria.yaml | 113 ------------------------- src/tests/bundles/focal-wallaby.yaml | 113 ------------------------- src/tests/bundles/focal-xena.yaml | 24 ++++-- src/tests/bundles/focal-yoga.yaml | 24 ++++-- src/tests/bundles/hirsute-wallaby.yaml | 113 ------------------------- src/tests/bundles/impish-xena.yaml | 113 ------------------------- src/tests/bundles/jammy-yoga.yaml | 24 ++++-- src/tests/tests.yaml | 22 ++--- test-requirements.txt | 6 ++ tox.ini | 40 ++++++--- 27 files changed, 164 insertions(+), 893 deletions(-) create mode 100644 build-requirements.txt create mode 100644 charmcraft.yaml create mode 120000 metadata.yaml create mode 100755 rename.sh delete mode 100644 src/tests/bundles/bionic-queens.yaml delete mode 100644 src/tests/bundles/bionic-rocky.yaml delete mode 100644 src/tests/bundles/bionic-stein.yaml delete mode 100644 src/tests/bundles/bionic-train.yaml delete mode 100644 src/tests/bundles/bionic-ussuri.yaml delete mode 100644 src/tests/bundles/focal-ussuri.yaml delete mode 100644 src/tests/bundles/focal-victoria.yaml delete mode 100644 src/tests/bundles/focal-wallaby.yaml delete mode 100644 src/tests/bundles/hirsute-wallaby.yaml delete mode 100644 src/tests/bundles/impish-xena.yaml diff --git a/.gitignore b/.gitignore index eff4fa5..75f5f56 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ interfaces *__pycache__* *.pyc .stestr/ +*.charm diff --git a/.zuul.yaml b/.zuul.yaml index fd189e2..7dd3db9 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,3 +1,3 @@ - project: templates: - - openstack-python3-ussuri-jobs + - openstack-python3-charm-yoga-jobs diff --git a/build-requirements.txt b/build-requirements.txt new file mode 100644 index 0000000..b6d2452 --- /dev/null +++ b/build-requirements.txt @@ -0,0 +1,7 @@ +# NOTES(lourot): +# * We don't install charmcraft via pip anymore because it anyway spins up a +# container and scp the system's charmcraft snap inside it. So the charmcraft +# snap is necessary on the system anyway. +# * `tox -e build` successfully validated with charmcraft 1.2.1 + +cffi==1.14.6; python_version < '3.6' # cffi 1.15.0 drops support for py35. diff --git a/charmcraft.yaml b/charmcraft.yaml new file mode 100644 index 0000000..c9a0ed7 --- /dev/null +++ b/charmcraft.yaml @@ -0,0 +1,33 @@ +type: charm + +parts: + charm: + build-packages: + - tox + - git + - python3-dev + override-build: | + apt-get install ca-certificates -y + tox -e build-reactive + override-stage: | + echo "Copying charm to staging area: $CHARMCRAFT_STAGE" + NAME=$(ls $CHARMCRAFT_PART_BUILD/build/builds) + cp -r $CHARMCRAFT_PART_BUILD/build/builds/$NAME/* $CHARMCRAFT_STAGE/ + override-prime: | + # For some reason, the normal priming chokes on the fact that there's a + # hooks directory. + cp -r $CHARMCRAFT_STAGE/* . + +bases: + - build-on: + - name: ubuntu + channel: "20.04" + architectures: + - amd64 + run-on: + - name: ubuntu + channel: "20.04" + architectures: [amd64, s390x, ppc64el, arm64] + - name: ubuntu + channel: "22.04" + architectures: [amd64, s390x, ppc64el, arm64] diff --git a/metadata.yaml b/metadata.yaml new file mode 120000 index 0000000..0768683 --- /dev/null +++ b/metadata.yaml @@ -0,0 +1 @@ +src/metadata.yaml \ No newline at end of file diff --git a/osci.yaml b/osci.yaml index 2000d7b..56a09b1 100644 --- a/osci.yaml +++ b/osci.yaml @@ -1,13 +1,10 @@ - project: templates: - - charm-yoga-unit-jobs - - charm-yoga-functional-jobs + - charm-unit-jobs-py38 + - charm-unit-jobs-py310 - charm-xena-functional-jobs - - charm-wallaby-functional-jobs - - charm-victoria-functional-jobs - - charm-ussuri-functional-jobs - - charm-stein-functional-jobs - - charm-queens-functional-jobs + - charm-yoga-functional-jobs vars: needs_charm_build: true charm_build_name: neutron-dynamic-routing + build_type: charmcraft diff --git a/rename.sh b/rename.sh new file mode 100755 index 0000000..d0c35c9 --- /dev/null +++ b/rename.sh @@ -0,0 +1,13 @@ +#!/bin/bash +charm=$(grep "charm_build_name" osci.yaml | awk '{print $2}') +echo "renaming ${charm}_*.charm to ${charm}.charm" +echo -n "pwd: " +pwd +ls -al +echo "Removing bad downloaded charm maybe?" +if [[ -e "${charm}.charm" ]]; +then + rm "${charm}.charm" +fi +echo "Renaming charm here." +mv ${charm}_*.charm ${charm}.charm diff --git a/requirements.txt b/requirements.txt index a68620f..7755b95 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,9 +8,16 @@ # requirements.txt setuptools<50.0.0 # https://github.com/pypa/setuptools/commit/04e3df22df840c6bb244e9b27bc56750c44b7c85 +# NOTE: newer versions of cryptography require a Rust compiler to build, +# see +# * https://github.com/openstack-charmers/zaza/issues/421 +# * https://mail.python.org/pipermail/cryptography-dev/2021-January/001003.html +# +cryptography<3.4 + # Build requirements cffi==1.14.6; python_version < '3.6' # cffi 1.15.0 drops support for py35. -charm-tools==2.8.3 +git+https://github.com/juju/charm-tools#egg=charm-tools simplejson diff --git a/src/config.yaml b/src/config.yaml index e69de29..064b8fb 100644 --- a/src/config.yaml +++ b/src/config.yaml @@ -0,0 +1,3 @@ +options: + openstack-origin: + default: yoga diff --git a/src/metadata.yaml b/src/metadata.yaml index 14a87e0..87ce4de 100644 --- a/src/metadata.yaml +++ b/src/metadata.yaml @@ -7,11 +7,8 @@ description: | tags: - openstack series: -- bionic - focal -- groovy -- hirsute -- impish +- jammy subordinate: false extra-bindings: # Used to specify the OpenStack provider network interface diff --git a/src/test-requirements.txt b/src/test-requirements.txt index e771023..9c7afb7 100644 --- a/src/test-requirements.txt +++ b/src/test-requirements.txt @@ -4,6 +4,9 @@ # https://github.com/openstack-charmers/release-tools # +# Need tox to be available from tox... inception yes, but its a workaround for now +tox + # Functional Test Requirements (let Zaza's dependencies solve all dependencies here!) git+https://github.com/openstack-charmers/zaza.git#egg=zaza git+https://github.com/openstack-charmers/zaza-openstack-tests.git#egg=zaza.openstack diff --git a/src/tests/bundles/bionic-queens.yaml b/src/tests/bundles/bionic-queens.yaml deleted file mode 100644 index a297d8c..0000000 --- a/src/tests/bundles/bionic-queens.yaml +++ /dev/null @@ -1,50 +0,0 @@ -series: bionic -relations: -- [neutron-dynamic-routing, rabbitmq-server] -- [neutron-dynamic-routing, quagga] -- [keystone, mysql] -- [neutron-api, mysql] -- [neutron-api, rabbitmq-server] -- [neutron-api, keystone] -applications: - keystone: - charm: cs:~openstack-charmers-next/bionic/keystone - constraints: mem=1G - num_units: 1 - options: - haproxy-server-timeout: 90000 - haproxy-client-timeout: 90000 - haproxy-queue-timeout: 9000 - haproxy-connect-timeout: 9000 - series: bionic - mysql: - charm: cs:~openstack-charmers-next/bionic/percona-cluster - constraints: mem=4G - num_units: 1 - series: bionic - neutron-api: - charm: cs:~openstack-charmers-next/bionic/neutron-api - constraints: mem=1G - num_units: 1 - options: - flat-network-providers: physnet1 - neutron-security-groups: true - haproxy-server-timeout: 90000 - haproxy-client-timeout: 90000 - haproxy-queue-timeout: 9000 - haproxy-connect-timeout: 9000 - series: bionic - neutron-dynamic-routing: - charm: ../../../neutron-dynamic-routing - num_units: 1 - series: bionic - rabbitmq-server: - charm: cs:~openstack-charmers-next/bionic/rabbitmq-server - constraints: mem=1G - num_units: 1 - series: bionic - quagga: - charm: cs:~openstack-charmers-next/bionic/quagga - num_units: 1 - series: bionic - diff --git a/src/tests/bundles/bionic-rocky.yaml b/src/tests/bundles/bionic-rocky.yaml deleted file mode 100644 index 2057b65..0000000 --- a/src/tests/bundles/bionic-rocky.yaml +++ /dev/null @@ -1,53 +0,0 @@ -relations: -- [neutron-dynamic-routing, rabbitmq-server] -- [neutron-dynamic-routing, quagga] -- [keystone, mysql] -- [neutron-api, mysql] -- [neutron-api, rabbitmq-server] -- [neutron-api, keystone] -applications: - keystone: - charm: cs:~openstack-charmers-next/bionic/keystone - constraints: mem=1G - num_units: 1 - options: - openstack-origin: 'cloud:bionic-rocky' - haproxy-server-timeout: 90000 - haproxy-client-timeout: 90000 - haproxy-queue-timeout: 9000 - haproxy-connect-timeout: 9000 - series: bionic - mysql: - charm: cs:~openstack-charmers-next/bionic/percona-cluster - constraints: mem=4G - num_units: 1 - options: {source: 'cloud:bionic-rocky'} - series: bionic - neutron-api: - charm: cs:~openstack-charmers-next/bionic/neutron-api - constraints: mem=1G - num_units: 1 - options: - flat-network-providers: physnet1, - neutron-security-groups: true - openstack-origin: 'cloud:bionic-rocky' - haproxy-server-timeout: 90000 - haproxy-client-timeout: 90000 - haproxy-queue-timeout: 9000 - haproxy-connect-timeout: 9000 - series: bionic - neutron-dynamic-routing: - charm: ../../../neutron-dynamic-routing - num_units: 1 - options: {openstack-origin: 'cloud:bionic-rocky'} - series: bionic - rabbitmq-server: - charm: cs:~openstack-charmers-next/bionic/rabbitmq-server - constraints: mem=1G - num_units: 1 - options: {source: 'cloud:bionic-rocky'} - series: bionic - quagga: - charm: cs:~openstack-charmers-next/bionic/quagga - num_units: 1 - series: bionic diff --git a/src/tests/bundles/bionic-stein.yaml b/src/tests/bundles/bionic-stein.yaml deleted file mode 100644 index 8631af5..0000000 --- a/src/tests/bundles/bionic-stein.yaml +++ /dev/null @@ -1,53 +0,0 @@ -relations: -- [neutron-dynamic-routing, rabbitmq-server] -- [neutron-dynamic-routing, quagga] -- [keystone, mysql] -- [neutron-api, mysql] -- [neutron-api, rabbitmq-server] -- [neutron-api, keystone] -applications: - keystone: - charm: cs:~openstack-charmers-next/bionic/keystone - constraints: mem=1G - num_units: 1 - options: - openstack-origin: 'cloud:bionic-stein' - haproxy-server-timeout: 90000 - haproxy-client-timeout: 90000 - haproxy-queue-timeout: 9000 - haproxy-connect-timeout: 9000 - series: bionic - mysql: - charm: cs:~openstack-charmers-next/bionic/percona-cluster - constraints: mem=4G - num_units: 1 - options: {source: 'cloud:bionic-stein'} - series: bionic - neutron-api: - charm: cs:~openstack-charmers-next/bionic/neutron-api - constraints: mem=1G - num_units: 1 - options: - flat-network-providers: physnet1, - neutron-security-groups: true - openstack-origin: 'cloud:bionic-stein' - haproxy-server-timeout: 90000 - haproxy-client-timeout: 90000 - haproxy-queue-timeout: 9000 - haproxy-connect-timeout: 9000 - series: bionic - neutron-dynamic-routing: - charm: ../../../neutron-dynamic-routing - num_units: 1 - options: {openstack-origin: 'cloud:bionic-stein'} - series: bionic - rabbitmq-server: - charm: cs:~openstack-charmers-next/bionic/rabbitmq-server - constraints: mem=1G - num_units: 1 - options: {source: 'cloud:bionic-stein'} - series: bionic - quagga: - charm: cs:~openstack-charmers-next/bionic/quagga - num_units: 1 - series: bionic diff --git a/src/tests/bundles/bionic-train.yaml b/src/tests/bundles/bionic-train.yaml deleted file mode 100644 index c58d20c..0000000 --- a/src/tests/bundles/bionic-train.yaml +++ /dev/null @@ -1,53 +0,0 @@ -relations: -- [neutron-dynamic-routing, rabbitmq-server] -- [neutron-dynamic-routing, quagga] -- [keystone, mysql] -- [neutron-api, mysql] -- [neutron-api, rabbitmq-server] -- [neutron-api, keystone] -applications: - keystone: - charm: cs:~openstack-charmers-next/bionic/keystone - constraints: mem=1G - num_units: 1 - options: - openstack-origin: 'cloud:bionic-train' - haproxy-server-timeout: 90000 - haproxy-client-timeout: 90000 - haproxy-queue-timeout: 9000 - haproxy-connect-timeout: 9000 - series: bionic - mysql: - charm: cs:~openstack-charmers-next/bionic/percona-cluster - constraints: mem=4G - num_units: 1 - options: {source: 'cloud:bionic-train'} - series: bionic - neutron-api: - charm: cs:~openstack-charmers-next/bionic/neutron-api - constraints: mem=1G - num_units: 1 - options: - flat-network-providers: physnet1, - neutron-security-groups: true - openstack-origin: 'cloud:bionic-train' - haproxy-server-timeout: 90000 - haproxy-client-timeout: 90000 - haproxy-queue-timeout: 9000 - haproxy-connect-timeout: 9000 - series: bionic - neutron-dynamic-routing: - charm: ../../../neutron-dynamic-routing - num_units: 1 - options: {openstack-origin: 'cloud:bionic-train'} - series: bionic - rabbitmq-server: - charm: cs:~openstack-charmers-next/bionic/rabbitmq-server - constraints: mem=1G - num_units: 1 - options: {source: 'cloud:bionic-train'} - series: bionic - quagga: - charm: cs:~openstack-charmers-next/bionic/quagga - num_units: 1 - series: bionic diff --git a/src/tests/bundles/bionic-ussuri.yaml b/src/tests/bundles/bionic-ussuri.yaml deleted file mode 100644 index 0b7e9b0..0000000 --- a/src/tests/bundles/bionic-ussuri.yaml +++ /dev/null @@ -1,55 +0,0 @@ -relations: -- [neutron-dynamic-routing, rabbitmq-server] -- [neutron-dynamic-routing, quagga] -- [keystone, mysql] -- [neutron-api, mysql] -- [neutron-api, rabbitmq-server] -- [neutron-api, keystone] -applications: - keystone: - charm: cs:~openstack-charmers-next/bionic/keystone - constraints: mem=1G - num_units: 1 - options: - openstack-origin: 'cloud:bionic-ussuri' - haproxy-server-timeout: 90000 - haproxy-client-timeout: 90000 - haproxy-queue-timeout: 9000 - haproxy-connect-timeout: 9000 - series: bionic - mysql: - charm: cs:~openstack-charmers-next/bionic/percona-cluster - constraints: mem=4G - num_units: 1 - options: {source: 'cloud:bionic-ussuri'} - series: bionic - neutron-api: - charm: cs:~openstack-charmers-next/bionic/neutron-api - constraints: mem=1G - num_units: 1 - options: - manage-neutron-plugin-legacy-mode: true - neutron-plugin: ovs - flat-network-providers: physnet1, - neutron-security-groups: true - openstack-origin: 'cloud:bionic-ussuri' - haproxy-server-timeout: 90000 - haproxy-client-timeout: 90000 - haproxy-queue-timeout: 9000 - haproxy-connect-timeout: 9000 - series: bionic - neutron-dynamic-routing: - charm: ../../../neutron-dynamic-routing - num_units: 1 - options: {openstack-origin: 'cloud:bionic-ussuri'} - series: bionic - rabbitmq-server: - charm: cs:~openstack-charmers-next/bionic/rabbitmq-server - constraints: mem=1G - num_units: 1 - options: {source: 'cloud:bionic-ussuri'} - series: bionic - quagga: - charm: cs:~openstack-charmers-next/bionic/quagga - num_units: 1 - series: bionic diff --git a/src/tests/bundles/focal-ussuri.yaml b/src/tests/bundles/focal-ussuri.yaml deleted file mode 100644 index 6ce9368..0000000 --- a/src/tests/bundles/focal-ussuri.yaml +++ /dev/null @@ -1,113 +0,0 @@ -variables: - openstack-origin: &openstack-origin distro - -series: focal - -comment: -- 'machines section to decide order of deployment. database sooner = faster' -machines: - '0': - constraints: mem=3072M - '1': - constraints: mem=3072M - '2': - constraints: mem=3072M - '3': - '4': - '5': - '6': - '7': - # for quagga which has no focal support yet - series: bionic - -applications: - - keystone-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router - neutron-api-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router - - mysql-innodb-cluster: - charm: cs:~openstack-charmers-next/mysql-innodb-cluster - num_units: 3 - options: - source: *openstack-origin - to: - - '0' - - '1' - - '2' - - keystone: - charm: cs:~openstack-charmers-next/keystone - num_units: 1 - options: - openstack-origin: *openstack-origin - haproxy-server-timeout: 90000 - haproxy-client-timeout: 90000 - haproxy-queue-timeout: 9000 - haproxy-connect-timeout: 9000 - to: - - '3' - - neutron-api: - charm: cs:~openstack-charmers-next/neutron-api - num_units: 1 - options: - manage-neutron-plugin-legacy-mode: true - neutron-plugin: ovs - flat-network-providers: physnet1, - neutron-security-groups: true - openstack-origin: *openstack-origin - haproxy-server-timeout: 90000 - haproxy-client-timeout: 90000 - haproxy-queue-timeout: 9000 - haproxy-connect-timeout: 9000 - to: - - '4' - - neutron-dynamic-routing: - charm: ../../../neutron-dynamic-routing - num_units: 1 - options: - openstack-origin: *openstack-origin - to: - - '5' - - rabbitmq-server: - charm: cs:~openstack-charmers-next/rabbitmq-server - num_units: 1 - options: - source: *openstack-origin - to: - - '6' - - quagga: - charm: cs:~openstack-charmers-next/bionic/quagga - series: bionic - num_units: 1 - to: - - '7' - -relations: - - - - 'neutron-dynamic-routing:amqp' - - 'rabbitmq-server:amqp' - - - - 'neutron-dynamic-routing:bgp-speaker' - - 'quagga:bgpclient' - - - - 'keystone:shared-db' - - 'keystone-mysql-router:shared-db' - - - 'keystone-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'neutron-api:shared-db' - - 'neutron-api-mysql-router:shared-db' - - - 'neutron-api-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'neutron-api:amqp' - - 'rabbitmq-server:amqp' - - - - 'neutron-api:identity-service' - - 'keystone:identity-service' diff --git a/src/tests/bundles/focal-victoria.yaml b/src/tests/bundles/focal-victoria.yaml deleted file mode 100644 index fab5394..0000000 --- a/src/tests/bundles/focal-victoria.yaml +++ /dev/null @@ -1,113 +0,0 @@ -variables: - openstack-origin: &openstack-origin cloud:focal-victoria - -series: focal - -comment: -- 'machines section to decide order of deployment. database sooner = faster' -machines: - '0': - constraints: mem=3072M - '1': - constraints: mem=3072M - '2': - constraints: mem=3072M - '3': - '4': - '5': - '6': - '7': - # for quagga which has no focal support yet - series: bionic - -applications: - - keystone-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router - neutron-api-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router - - mysql-innodb-cluster: - charm: cs:~openstack-charmers-next/mysql-innodb-cluster - num_units: 3 - options: - source: *openstack-origin - to: - - '0' - - '1' - - '2' - - keystone: - charm: cs:~openstack-charmers-next/keystone - num_units: 1 - options: - openstack-origin: *openstack-origin - haproxy-server-timeout: 90000 - haproxy-client-timeout: 90000 - haproxy-queue-timeout: 9000 - haproxy-connect-timeout: 9000 - to: - - '3' - - neutron-api: - charm: cs:~openstack-charmers-next/neutron-api - num_units: 1 - options: - manage-neutron-plugin-legacy-mode: true - neutron-plugin: ovs - flat-network-providers: physnet1, - neutron-security-groups: true - openstack-origin: *openstack-origin - haproxy-server-timeout: 90000 - haproxy-client-timeout: 90000 - haproxy-queue-timeout: 9000 - haproxy-connect-timeout: 9000 - to: - - '4' - - neutron-dynamic-routing: - charm: ../../../neutron-dynamic-routing - num_units: 1 - options: - openstack-origin: *openstack-origin - to: - - '5' - - rabbitmq-server: - charm: cs:~openstack-charmers-next/rabbitmq-server - num_units: 1 - options: - source: *openstack-origin - to: - - '6' - - quagga: - charm: cs:~openstack-charmers-next/bionic/quagga - series: bionic - num_units: 1 - to: - - '7' - -relations: - - - - 'neutron-dynamic-routing:amqp' - - 'rabbitmq-server:amqp' - - - - 'neutron-dynamic-routing:bgp-speaker' - - 'quagga:bgpclient' - - - - 'keystone:shared-db' - - 'keystone-mysql-router:shared-db' - - - 'keystone-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'neutron-api:shared-db' - - 'neutron-api-mysql-router:shared-db' - - - 'neutron-api-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'neutron-api:amqp' - - 'rabbitmq-server:amqp' - - - - 'neutron-api:identity-service' - - 'keystone:identity-service' diff --git a/src/tests/bundles/focal-wallaby.yaml b/src/tests/bundles/focal-wallaby.yaml deleted file mode 100644 index de47786..0000000 --- a/src/tests/bundles/focal-wallaby.yaml +++ /dev/null @@ -1,113 +0,0 @@ -variables: - openstack-origin: &openstack-origin cloud:focal-wallaby - -series: focal - -comment: -- 'machines section to decide order of deployment. database sooner = faster' -machines: - '0': - constraints: mem=3072M - '1': - constraints: mem=3072M - '2': - constraints: mem=3072M - '3': - '4': - '5': - '6': - '7': - # for quagga which has no focal support yet - series: bionic - -applications: - - keystone-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router - neutron-api-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router - - mysql-innodb-cluster: - charm: cs:~openstack-charmers-next/mysql-innodb-cluster - num_units: 3 - options: - source: *openstack-origin - to: - - '0' - - '1' - - '2' - - keystone: - charm: cs:~openstack-charmers-next/keystone - num_units: 1 - options: - openstack-origin: *openstack-origin - haproxy-server-timeout: 90000 - haproxy-client-timeout: 90000 - haproxy-queue-timeout: 9000 - haproxy-connect-timeout: 9000 - to: - - '3' - - neutron-api: - charm: cs:~openstack-charmers-next/neutron-api - num_units: 1 - options: - manage-neutron-plugin-legacy-mode: true - neutron-plugin: ovs - flat-network-providers: physnet1, - neutron-security-groups: true - openstack-origin: *openstack-origin - haproxy-server-timeout: 90000 - haproxy-client-timeout: 90000 - haproxy-queue-timeout: 9000 - haproxy-connect-timeout: 9000 - to: - - '4' - - neutron-dynamic-routing: - charm: ../../../neutron-dynamic-routing - num_units: 1 - options: - openstack-origin: *openstack-origin - to: - - '5' - - rabbitmq-server: - charm: cs:~openstack-charmers-next/rabbitmq-server - num_units: 1 - options: - source: *openstack-origin - to: - - '6' - - quagga: - charm: cs:~openstack-charmers-next/bionic/quagga - series: bionic - num_units: 1 - to: - - '7' - -relations: - - - - 'neutron-dynamic-routing:amqp' - - 'rabbitmq-server:amqp' - - - - 'neutron-dynamic-routing:bgp-speaker' - - 'quagga:bgpclient' - - - - 'keystone:shared-db' - - 'keystone-mysql-router:shared-db' - - - 'keystone-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'neutron-api:shared-db' - - 'neutron-api-mysql-router:shared-db' - - - 'neutron-api-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'neutron-api:amqp' - - 'rabbitmq-server:amqp' - - - - 'neutron-api:identity-service' - - 'keystone:identity-service' diff --git a/src/tests/bundles/focal-xena.yaml b/src/tests/bundles/focal-xena.yaml index 7e9f2dc..bf6ca2f 100644 --- a/src/tests/bundles/focal-xena.yaml +++ b/src/tests/bundles/focal-xena.yaml @@ -1,3 +1,5 @@ +local_overlay_enabled: False + variables: openstack-origin: &openstack-origin cloud:focal-xena @@ -23,12 +25,14 @@ machines: applications: keystone-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router + charm: ch:mysql-router + channel: 8.0.19/edge neutron-api-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router + charm: ch:mysql-router + channel: 8.0.19/edge mysql-innodb-cluster: - charm: cs:~openstack-charmers-next/mysql-innodb-cluster + charm: ch:mysql-innodb-cluster num_units: 3 options: source: *openstack-origin @@ -36,9 +40,10 @@ applications: - '0' - '1' - '2' + channel: 8.0.19/edge keystone: - charm: cs:~openstack-charmers-next/keystone + charm: ch:keystone num_units: 1 options: openstack-origin: *openstack-origin @@ -48,9 +53,10 @@ applications: haproxy-connect-timeout: 9000 to: - '3' + channel: xena/edge neutron-api: - charm: cs:~openstack-charmers-next/neutron-api + charm: ch:neutron-api num_units: 1 options: manage-neutron-plugin-legacy-mode: true @@ -64,9 +70,10 @@ applications: haproxy-connect-timeout: 9000 to: - '4' + channel: xena/edge neutron-dynamic-routing: - charm: ../../../neutron-dynamic-routing + charm: ../../../neutron-dynamic-routing.charm num_units: 1 options: openstack-origin: *openstack-origin @@ -74,15 +81,16 @@ applications: - '5' rabbitmq-server: - charm: cs:~openstack-charmers-next/rabbitmq-server + charm: ch:rabbitmq-server num_units: 1 options: source: *openstack-origin to: - '6' + channel: 3.8/edge quagga: - charm: cs:~openstack-charmers-next/bionic/quagga + charm: ch:openstack-charmers-next-quagga series: bionic num_units: 1 to: diff --git a/src/tests/bundles/focal-yoga.yaml b/src/tests/bundles/focal-yoga.yaml index e567aef..59b4653 100644 --- a/src/tests/bundles/focal-yoga.yaml +++ b/src/tests/bundles/focal-yoga.yaml @@ -1,3 +1,5 @@ +local_overlay_enabled: False + variables: openstack-origin: &openstack-origin cloud:focal-yoga @@ -23,12 +25,14 @@ machines: applications: keystone-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router + charm: ch:mysql-router + channel: 8.0.19/edge neutron-api-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router + charm: ch:mysql-router + channel: 8.0.19/edge mysql-innodb-cluster: - charm: cs:~openstack-charmers-next/mysql-innodb-cluster + charm: ch:mysql-innodb-cluster num_units: 3 options: source: *openstack-origin @@ -36,9 +40,10 @@ applications: - '0' - '1' - '2' + channel: 8.0.19/edge keystone: - charm: cs:~openstack-charmers-next/keystone + charm: ch:keystone num_units: 1 options: openstack-origin: *openstack-origin @@ -48,9 +53,10 @@ applications: haproxy-connect-timeout: 9000 to: - '3' + channel: yoga/edge neutron-api: - charm: cs:~openstack-charmers-next/neutron-api + charm: ch:neutron-api num_units: 1 options: manage-neutron-plugin-legacy-mode: true @@ -64,9 +70,10 @@ applications: haproxy-connect-timeout: 9000 to: - '4' + channel: yoga/edge neutron-dynamic-routing: - charm: ../../../neutron-dynamic-routing + charm: ../../../neutron-dynamic-routing.charm num_units: 1 options: openstack-origin: *openstack-origin @@ -74,15 +81,16 @@ applications: - '5' rabbitmq-server: - charm: cs:~openstack-charmers-next/rabbitmq-server + charm: ch:rabbitmq-server num_units: 1 options: source: *openstack-origin to: - '6' + channel: 3.8/edge quagga: - charm: cs:~openstack-charmers-next/bionic/quagga + charm: ch:openstack-charmers-next-quagga series: bionic num_units: 1 to: diff --git a/src/tests/bundles/hirsute-wallaby.yaml b/src/tests/bundles/hirsute-wallaby.yaml deleted file mode 100644 index ca0db21..0000000 --- a/src/tests/bundles/hirsute-wallaby.yaml +++ /dev/null @@ -1,113 +0,0 @@ -variables: - openstack-origin: &openstack-origin distro - -series: hirsute - -comment: -- 'machines section to decide order of deployment. database sooner = faster' -machines: - '0': - constraints: mem=3072M - '1': - constraints: mem=3072M - '2': - constraints: mem=3072M - '3': - '4': - '5': - '6': - '7': - # for quagga which has no hirsute support yet - series: bionic - -applications: - - keystone-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router - neutron-api-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router - - mysql-innodb-cluster: - charm: cs:~openstack-charmers-next/mysql-innodb-cluster - num_units: 3 - options: - source: *openstack-origin - to: - - '0' - - '1' - - '2' - - keystone: - charm: cs:~openstack-charmers-next/keystone - num_units: 1 - options: - openstack-origin: *openstack-origin - haproxy-server-timeout: 90000 - haproxy-client-timeout: 90000 - haproxy-queue-timeout: 9000 - haproxy-connect-timeout: 9000 - to: - - '3' - - neutron-api: - charm: cs:~openstack-charmers-next/neutron-api - num_units: 1 - options: - manage-neutron-plugin-legacy-mode: true - neutron-plugin: ovs - flat-network-providers: physnet1, - neutron-security-groups: true - openstack-origin: *openstack-origin - haproxy-server-timeout: 90000 - haproxy-client-timeout: 90000 - haproxy-queue-timeout: 9000 - haproxy-connect-timeout: 9000 - to: - - '4' - - neutron-dynamic-routing: - charm: ../../../neutron-dynamic-routing - num_units: 1 - options: - openstack-origin: *openstack-origin - to: - - '5' - - rabbitmq-server: - charm: cs:~openstack-charmers-next/rabbitmq-server - num_units: 1 - options: - source: *openstack-origin - to: - - '6' - - quagga: - charm: cs:~openstack-charmers-next/bionic/quagga - series: bionic - num_units: 1 - to: - - '7' - -relations: - - - - 'neutron-dynamic-routing:amqp' - - 'rabbitmq-server:amqp' - - - - 'neutron-dynamic-routing:bgp-speaker' - - 'quagga:bgpclient' - - - - 'keystone:shared-db' - - 'keystone-mysql-router:shared-db' - - - 'keystone-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'neutron-api:shared-db' - - 'neutron-api-mysql-router:shared-db' - - - 'neutron-api-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'neutron-api:amqp' - - 'rabbitmq-server:amqp' - - - - 'neutron-api:identity-service' - - 'keystone:identity-service' diff --git a/src/tests/bundles/impish-xena.yaml b/src/tests/bundles/impish-xena.yaml deleted file mode 100644 index 568c077..0000000 --- a/src/tests/bundles/impish-xena.yaml +++ /dev/null @@ -1,113 +0,0 @@ -variables: - openstack-origin: &openstack-origin distro - -series: impish - -comment: -- 'machines section to decide order of deployment. database sooner = faster' -machines: - '0': - constraints: mem=3072M - '1': - constraints: mem=3072M - '2': - constraints: mem=3072M - '3': - '4': - '5': - '6': - '7': - # for quagga which has no impish support yet - series: bionic - -applications: - - keystone-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router - neutron-api-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router - - mysql-innodb-cluster: - charm: cs:~openstack-charmers-next/mysql-innodb-cluster - num_units: 3 - options: - source: *openstack-origin - to: - - '0' - - '1' - - '2' - - keystone: - charm: cs:~openstack-charmers-next/keystone - num_units: 1 - options: - openstack-origin: *openstack-origin - haproxy-server-timeout: 90000 - haproxy-client-timeout: 90000 - haproxy-queue-timeout: 9000 - haproxy-connect-timeout: 9000 - to: - - '3' - - neutron-api: - charm: cs:~openstack-charmers-next/neutron-api - num_units: 1 - options: - manage-neutron-plugin-legacy-mode: true - neutron-plugin: ovs - flat-network-providers: physnet1, - neutron-security-groups: true - openstack-origin: *openstack-origin - haproxy-server-timeout: 90000 - haproxy-client-timeout: 90000 - haproxy-queue-timeout: 9000 - haproxy-connect-timeout: 9000 - to: - - '4' - - neutron-dynamic-routing: - charm: ../../../neutron-dynamic-routing - num_units: 1 - options: - openstack-origin: *openstack-origin - to: - - '5' - - rabbitmq-server: - charm: cs:~openstack-charmers-next/rabbitmq-server - num_units: 1 - options: - source: *openstack-origin - to: - - '6' - - quagga: - charm: cs:~openstack-charmers-next/bionic/quagga - series: bionic - num_units: 1 - to: - - '7' - -relations: - - - - 'neutron-dynamic-routing:amqp' - - 'rabbitmq-server:amqp' - - - - 'neutron-dynamic-routing:bgp-speaker' - - 'quagga:bgpclient' - - - - 'keystone:shared-db' - - 'keystone-mysql-router:shared-db' - - - 'keystone-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'neutron-api:shared-db' - - 'neutron-api-mysql-router:shared-db' - - - 'neutron-api-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'neutron-api:amqp' - - 'rabbitmq-server:amqp' - - - - 'neutron-api:identity-service' - - 'keystone:identity-service' diff --git a/src/tests/bundles/jammy-yoga.yaml b/src/tests/bundles/jammy-yoga.yaml index d5fa9ba..43a494d 100644 --- a/src/tests/bundles/jammy-yoga.yaml +++ b/src/tests/bundles/jammy-yoga.yaml @@ -1,3 +1,5 @@ +local_overlay_enabled: False + variables: openstack-origin: &openstack-origin distro @@ -23,12 +25,14 @@ machines: applications: keystone-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router + charm: ch:mysql-router + channel: 8.0.19/edge neutron-api-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router + charm: ch:mysql-router + channel: 8.0.19/edge mysql-innodb-cluster: - charm: cs:~openstack-charmers-next/mysql-innodb-cluster + charm: ch:mysql-innodb-cluster num_units: 3 options: source: *openstack-origin @@ -36,9 +40,10 @@ applications: - '0' - '1' - '2' + channel: 8.0.19/edge keystone: - charm: cs:~openstack-charmers-next/keystone + charm: ch:keystone num_units: 1 options: openstack-origin: *openstack-origin @@ -48,9 +53,10 @@ applications: haproxy-connect-timeout: 9000 to: - '3' + channel: yoga/edge neutron-api: - charm: cs:~openstack-charmers-next/neutron-api + charm: ch:neutron-api num_units: 1 options: manage-neutron-plugin-legacy-mode: true @@ -64,9 +70,10 @@ applications: haproxy-connect-timeout: 9000 to: - '4' + channel: yoga/edge neutron-dynamic-routing: - charm: ../../../neutron-dynamic-routing + charm: ../../../neutron-dynamic-routing.charm num_units: 1 options: openstack-origin: *openstack-origin @@ -74,15 +81,16 @@ applications: - '5' rabbitmq-server: - charm: cs:~openstack-charmers-next/rabbitmq-server + charm: ch:rabbitmq-server num_units: 1 options: source: *openstack-origin to: - '6' + channel: 3.9/edge quagga: - charm: cs:~openstack-charmers-next/bionic/quagga + charm: ch:openstack-charmers-next-quagga series: bionic num_units: 1 to: diff --git a/src/tests/tests.yaml b/src/tests/tests.yaml index cda6694..2e9e78d 100644 --- a/src/tests/tests.yaml +++ b/src/tests/tests.yaml @@ -4,30 +4,18 @@ configure: - zaza.openstack.charm_tests.dragent.configure.setup gate_bundles: -- bionic-queens -- bionic-stein -- bionic-ussuri -- focal-ussuri -- focal-victoria -- focal-wallaby - focal-xena -- hirsute-wallaby -- impish-xena - -smoke_bundles: -- focal-ussuri - -dev_bundles: -- bionic-rocky -- bionic-train - focal-yoga - jammy-yoga +smoke_bundles: +- focal-yoga + +dev_bundles: [] + tests: - zaza.openstack.charm_tests.dragent.tests.DRAgentTest tests_options: force_deploy: - - hirsute-wallaby - - impish-xena - jammy-yoga diff --git a/test-requirements.txt b/test-requirements.txt index 208032f..a11a7d0 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -28,6 +28,11 @@ oslo.utils<=3.41.0;python_version<'3.6' requests>=2.18.4 charms.reactive +# Newer mock seems to have some syntax which is newer than python3.5 (e.g. +# f'{something}' +mock>=1.2,<4.0.0; python_version < '3.6' +mock>=1.2; python_version >= '3.6' + nose>=1.3.7 coverage>=3.6 git+https://github.com/openstack/charms.openstack.git#egg=charms.openstack @@ -46,3 +51,4 @@ pbr==5.6.0 # vault cryptography<3.4 # vault, keystone-saml-mellon lxml # keystone-saml-mellon hvac # vault, barbican-vault +psutil # cinder-lvm diff --git a/tox.ini b/tox.ini index faf6092..e22fe48 100644 --- a/tox.ini +++ b/tox.ini @@ -37,11 +37,24 @@ setenv = VIRTUAL_ENV={envdir} passenv = http_proxy https_proxy INTERFACE_PATH LAYER_PATH JUJU_REPOSITORY install_command = {toxinidir}/pip.sh install {opts} {packages} +allowlist_externals = + charmcraft + bash + tox + rename.sh deps = -r{toxinidir}/requirements.txt [testenv:build] basepython = python3 +deps = -r{toxinidir}/build-requirements.txt +commands = + charmcraft clean + charmcraft -v build + {toxinidir}/rename.sh + +[testenv:build-reactive] +basepython = python3 commands = charm-build --log-level DEBUG --use-lock-file-branches -o {toxinidir}/build/builds src {posargs} @@ -55,21 +68,11 @@ basepython = python3 deps = -r{toxinidir}/test-requirements.txt commands = stestr run --slowest {posargs} -[testenv:py35] -basepython = python3.5 -deps = -r{toxinidir}/test-requirements.txt -commands = stestr run --slowest {posargs} - [testenv:py36] basepython = python3.6 deps = -r{toxinidir}/test-requirements.txt commands = stestr run --slowest {posargs} -[testenv:py37] -basepython = python3.7 -deps = -r{toxinidir}/test-requirements.txt -commands = stestr run --slowest {posargs} - [testenv:py38] basepython = python3.8 deps = -r{toxinidir}/test-requirements.txt @@ -80,12 +83,29 @@ basepython = python3.9 deps = -r{toxinidir}/test-requirements.txt commands = stestr run --slowest {posargs} +[testenv:py310] +basepython = python3.10 +deps = -r{toxinidir}/test-requirements.txt +commands = stestr run --slowest {posargs} + [testenv:pep8] basepython = python3 deps = flake8==3.9.2 charm-tools==2.8.3 commands = flake8 {posargs} src unit_tests +[testenv:func-target] +# Hack to get functional tests working in the charmcraft +# world. We should fix this. +basepython = python3 +passenv = HOME TERM CS_* OS_* TEST_* +deps = -r{toxinidir}/src/test-requirements.txt +changedir = {toxinidir}/src +commands = + bash -c "if [ ! -f ../*.charm ]; then echo 'Charm does not exist. Run tox -e build'; exit 1; fi" + tox --version + tox -e func-target {posargs} + [testenv:cover] # Technique based heavily upon # https://github.com/openstack/nova/blob/master/tox.ini