From 2ae1c68c7cf975f8ee9a4ab9a3e0593337d93243 Mon Sep 17 00:00:00 2001 From: Aurelien Lourot Date: Mon, 7 Feb 2022 15:24:53 +0100 Subject: [PATCH] Migrate to charmhub Adds necessary requirements, osci.yaml, charmcraft.yaml etc for migrationg to charmhub. Additionally, adds xena and yoga tests and updates the charm overlay for appropriate netapp values. local_overlay_enabled is set to True as it now defaults to False. Note that the actual functional tests are still disabled due to [1] 1 - https://bugs.launchpad.net/charm-manila-netapp/+bug/1922214 Change-Id: Ic9354434792ec1faa42406f4f3cf461a96cfc020 --- .zuul.yaml | 2 +- build-requirements.txt | 8 +- charmcraft.yaml | 34 +++ metadata.yaml | 5 +- osci.yaml | 14 ++ rename.sh | 13 ++ tests/README.md | 18 ++ tests/bundles/bionic-ussuri.yaml | 198 ------------------ .../{focal-victoria.yaml => focal-xena.yaml} | 55 +++-- .../{groovy-victoria.yaml => focal-yoga.yaml} | 57 +++-- .../{focal-ussuri.yaml => jammy-yoga.yaml} | 55 +++-- .../overlays/local-charm-overlay.yaml.j2 | 16 +- tests/tests.yaml | 14 +- tox.ini | 56 +++-- unit_tests/test_charm.py | 4 +- 15 files changed, 252 insertions(+), 297 deletions(-) create mode 100644 charmcraft.yaml create mode 100644 osci.yaml create mode 100755 rename.sh create mode 100644 tests/README.md delete mode 100644 tests/bundles/bionic-ussuri.yaml rename tests/bundles/{focal-victoria.yaml => focal-xena.yaml} (83%) rename tests/bundles/{groovy-victoria.yaml => focal-yoga.yaml} (83%) rename tests/bundles/{focal-ussuri.yaml => jammy-yoga.yaml} (84%) diff --git a/.zuul.yaml b/.zuul.yaml index fd20909..7ffc71c 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,4 +1,4 @@ - project: templates: - - openstack-python3-charm-jobs + - openstack-python3-charm-yoga-jobs - openstack-cover-jobs diff --git a/build-requirements.txt b/build-requirements.txt index 271d895..b6d2452 100644 --- a/build-requirements.txt +++ b/build-requirements.txt @@ -1 +1,7 @@ -git+https://github.com/canonical/charmcraft.git@0.10.2#egg=charmcraft +# 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..bea920d --- /dev/null +++ b/charmcraft.yaml @@ -0,0 +1,34 @@ +type: charm + +parts: + charm: + after: + - update-certificates + charm-python-packages: + # NOTE(lourot): see + # * https://github.com/canonical/charmcraft/issues/551 + - setuptools + build-packages: + - git + + update-certificates: + plugin: nil + # See https://github.com/canonical/charmcraft/issues/658 + override-build: | + apt update + apt install -y ca-certificates + update-ca-certificates + +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 index 30a398b..dd7e7a4 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -16,11 +16,8 @@ tags: - storage - file-servers series: - - bionic - focal - - groovy - - hirsute - - impish + - jammy subordinate: true provides: manila-plugin: diff --git a/osci.yaml b/osci.yaml new file mode 100644 index 0000000..5aa89fb --- /dev/null +++ b/osci.yaml @@ -0,0 +1,14 @@ +- project: + templates: + - charm-unit-jobs-py38 + - charm-unit-jobs-py310 + # More work is needed on the functional jobs; they can't pass at the + # moment as they need to set up hardware which isn't implemented yet. + # See LP: #1922214 + # - charm-xena-functional-jobs + # - charm-yoga-functional-jobs + vars: + needs_charm_build: true + charm_build_name: manila-netapp + 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/tests/README.md b/tests/README.md new file mode 100644 index 0000000..d002a1e --- /dev/null +++ b/tests/README.md @@ -0,0 +1,18 @@ +# Overview + +This directory provides Zaza test definitions and bundles to verify basic +deployment functionality from the perspective of this charm, its requirements +and its features, as exercised in a subset of the full OpenStack deployment +test bundle topology. + +Run the smoke tests with: + +```bash +cd ../ +tox -e build +tox -e func-smoke +``` + +For full details on functional testing of OpenStack charms please refer to +the [functional testing](https://docs.openstack.org/charm-guide/latest/reference/testing.html#functional-testing) +section of the OpenStack Charm Guide. diff --git a/tests/bundles/bionic-ussuri.yaml b/tests/bundles/bionic-ussuri.yaml deleted file mode 100644 index 9e690de..0000000 --- a/tests/bundles/bionic-ussuri.yaml +++ /dev/null @@ -1,198 +0,0 @@ -variables: - openstack-origin: &openstack-origin cloud:bionic-ussuri - -series: bionic - -comment: -- 'machines section to decide order of deployment. database sooner = faster' -machines: - '0': - constraints: mem=3072M - '1': - '2': - '3': - '4': - '5': - '6': - '7': - # The following units are the nova compute units - '8': - constraints: mem=4G - '9': - constraints: mem=4G - '10': - -applications: - percona-cluster: - charm: cs:~openstack-charmers-next/percona-cluster - num_units: 1 - options: - source: *openstack-origin - to: - - '0' - - nova-cloud-controller: - charm: cs:~openstack-charmers-next/nova-cloud-controller - num_units: 1 - options: - network-manager: Neutron - openstack-origin: *openstack-origin - to: - - '1' - - glance: - charm: cs:~openstack-charmers-next/glance - num_units: 1 - options: - openstack-origin: *openstack-origin - to: - - '2' - - neutron-api: - charm: cs:~openstack-charmers-next/neutron-api - num_units: 1 - options: - openstack-origin: *openstack-origin - manage-neutron-plugin-legacy-mode: true - neutron-plugin: ovs - flat-network-providers: physnet1 - neutron-security-groups: true - to: - - '3' - - neutron-openvswitch: - charm: cs:~openstack-charmers-next/neutron-openvswitch - - neutron-gateway: - charm: cs:~openstack-charmers-next/neutron-gateway - num_units: 1 - options: - openstack-origin: *openstack-origin - bridge-mappings: physnet1:br-ex - to: - - '4' - - keystone: - charm: cs:~openstack-charmers-next/keystone - 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' - - placement: - charm: cs:~openstack-charmers-next/placement - num_units: 1 - options: - openstack-origin: *openstack-origin - to: - - '7' - - nova-compute: - charm: cs:~openstack-charmers-next/nova-compute - num_units: 2 - storage: - ephemeral-device: '40G' - options: - openstack-origin: *openstack-origin - config-flags: default_ephemeral_format=ext4 - to: - - '8' - - '9' - - manila: - charm: cs:~openstack-charmers-next/manila - num_units: 1 - options: - openstack-origin: *openstack-origin - default-share-backend: netapp-ontap - to: - - '10' - - manila-netapp: - charm: ../../manila-netapp.charm - options: - share-backend-name: netapp-ontap - driver-handles-share-servers: False - - manila-netapp-dhss: - charm: ../../manila-netapp.charm - options: - share-backend-name: netapp-ontap-dhss - driver-handles-share-servers: True - -relations: - - - 'manila:shared-db' - - 'percona-cluster:shared-db' - - - 'manila' - - 'rabbitmq-server' - - - 'manila' - - 'keystone' - - - 'manila:manila-plugin' - - 'manila-netapp:manila-plugin' - - - 'manila:manila-plugin' - - 'manila-netapp-dhss:manila-plugin' - - - - 'keystone:shared-db' - - 'percona-cluster:shared-db' - - - - 'neutron-api:shared-db' - - 'percona-cluster:shared-db' - - - 'neutron-api:amqp' - - 'rabbitmq-server:amqp' - - - 'neutron-api:identity-service' - - 'keystone:identity-service' - - - 'neutron-api:neutron-api' - - 'nova-cloud-controller:neutron-api' - - - 'neutron-api:neutron-plugin-api' - - 'neutron-gateway:neutron-plugin-api' - - - - 'nova-cloud-controller:shared-db' - - 'percona-cluster:shared-db' - - - 'nova-cloud-controller:amqp' - - 'rabbitmq-server:amqp' - - - 'nova-cloud-controller:identity-service' - - 'keystone:identity-service' - - - 'nova-cloud-controller:cloud-compute' - - 'nova-compute:cloud-compute' - - - 'nova-cloud-controller:image-service' - - 'glance:image-service' - - - 'nova-cloud-controller:quantum-network-service' - - 'neutron-gateway:quantum-network-service' - - - - 'nova-compute:amqp' - - 'rabbitmq-server:amqp' - - - 'nova-compute:image-service' - - 'glance:image-service' - - - 'nova-compute:neutron-plugin' - - 'neutron-openvswitch:neutron-plugin' - - - - 'neutron-gateway:amqp' - - 'rabbitmq-server:amqp' - - - - 'neutron-openvswitch:amqp' - - 'rabbitmq-server:amqp' - - - - 'glance:shared-db' - - 'percona-cluster:shared-db' - - - 'glance:amqp' - - 'rabbitmq-server:amqp' - - - 'glance:identity-service' - - 'keystone:identity-service' - - - - 'placement:shared-db' - - 'percona-cluster:shared-db' - - - 'placement:amqp' - - 'rabbitmq-server:amqp' - - - 'placement:identity-service' - - 'keystone:identity-service' - - - 'placement:placement' - - 'nova-cloud-controller:placement' diff --git a/tests/bundles/focal-victoria.yaml b/tests/bundles/focal-xena.yaml similarity index 83% rename from tests/bundles/focal-victoria.yaml rename to tests/bundles/focal-xena.yaml index bd64d1b..ffe3d40 100644 --- a/tests/bundles/focal-victoria.yaml +++ b/tests/bundles/focal-xena.yaml @@ -1,5 +1,7 @@ variables: - openstack-origin: &openstack-origin cloud:focal-victoria + openstack-origin: &openstack-origin cloud:focal-xena + +local_overlay_enabled: True series: focal @@ -28,20 +30,26 @@ machines: applications: manila-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router + charm: ch:mysql-router + channel: latest/edge keystone-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router + charm: ch:mysql-router + channel: latest/edge neutron-api-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router + charm: ch:mysql-router + channel: latest/edge nova-cloud-controller-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router + charm: ch:mysql-router + channel: latest/edge glance-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router + charm: ch:mysql-router + channel: latest/edge placement-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router + charm: ch:mysql-router + channel: latest/edge mysql-innodb-cluster: - charm: cs:~openstack-charmers-next/mysql-innodb-cluster + charm: ch:mysql-innodb-cluster num_units: 3 options: source: *openstack-origin @@ -49,26 +57,29 @@ applications: - '0' - '1' - '2' + channel: latest/edge nova-cloud-controller: - charm: cs:~openstack-charmers-next/nova-cloud-controller + charm: ch:nova-cloud-controller num_units: 1 options: network-manager: Neutron openstack-origin: *openstack-origin to: - '3' + channel: yoga/edge glance: - charm: cs:~openstack-charmers-next/glance + charm: ch:glance num_units: 1 options: openstack-origin: *openstack-origin to: - '4' + channel: yoga/edge neutron-api: - charm: cs:~openstack-charmers-next/neutron-api + charm: ch:neutron-api num_units: 1 options: openstack-origin: *openstack-origin @@ -78,45 +89,51 @@ applications: neutron-security-groups: true to: - '5' + channel: yoga/edge neutron-openvswitch: - charm: cs:~openstack-charmers-next/neutron-openvswitch + charm: ch:neutron-openvswitch + channel: yoga/edge neutron-gateway: - charm: cs:~openstack-charmers-next/neutron-gateway + charm: ch:neutron-gateway num_units: 1 options: openstack-origin: *openstack-origin bridge-mappings: physnet1:br-ex to: - '6' + channel: yoga/edge keystone: - charm: cs:~openstack-charmers-next/keystone + charm: ch:keystone num_units: 1 options: openstack-origin: *openstack-origin to: - '7' + channel: yoga/edge rabbitmq-server: - charm: cs:~openstack-charmers-next/rabbitmq-server + charm: ch:rabbitmq-server num_units: 1 options: source: *openstack-origin to: - '8' + channel: latest/edge placement: - charm: cs:~openstack-charmers-next/placement + charm: ch:placement num_units: 1 options: openstack-origin: *openstack-origin to: - '9' + channel: yoga/edge nova-compute: - charm: cs:~openstack-charmers-next/nova-compute + charm: ch:nova-compute num_units: 2 storage: ephemeral-device: '40G' @@ -126,15 +143,17 @@ applications: to: - '10' - '11' + channel: yoga/edge manila: - charm: cs:~openstack-charmers-next/manila + charm: ch:manila num_units: 1 options: openstack-origin: *openstack-origin default-share-backend: netapp-ontap to: - '12' + channel: yoga/edge manila-netapp: charm: ../../manila-netapp.charm diff --git a/tests/bundles/groovy-victoria.yaml b/tests/bundles/focal-yoga.yaml similarity index 83% rename from tests/bundles/groovy-victoria.yaml rename to tests/bundles/focal-yoga.yaml index 02b88ad..0112f92 100644 --- a/tests/bundles/groovy-victoria.yaml +++ b/tests/bundles/focal-yoga.yaml @@ -1,7 +1,9 @@ variables: - openstack-origin: &openstack-origin distro + openstack-origin: &openstack-origin cloud:focal-yoga -series: groovy +local_overlay_enabled: True + +series: focal comment: - 'machines section to decide order of deployment. database sooner = faster' @@ -28,20 +30,26 @@ machines: applications: manila-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router + charm: ch:mysql-router + channel: latest/edge keystone-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router + charm: ch:mysql-router + channel: latest/edge neutron-api-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router + charm: ch:mysql-router + channel: latest/edge nova-cloud-controller-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router + charm: ch:mysql-router + channel: latest/edge glance-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router + charm: ch:mysql-router + channel: latest/edge placement-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router + charm: ch:mysql-router + channel: latest/edge mysql-innodb-cluster: - charm: cs:~openstack-charmers-next/mysql-innodb-cluster + charm: ch:mysql-innodb-cluster num_units: 3 options: source: *openstack-origin @@ -49,26 +57,29 @@ applications: - '0' - '1' - '2' + channel: latest/edge nova-cloud-controller: - charm: cs:~openstack-charmers-next/nova-cloud-controller + charm: ch:nova-cloud-controller num_units: 1 options: network-manager: Neutron openstack-origin: *openstack-origin to: - '3' + channel: yoga/edge glance: - charm: cs:~openstack-charmers-next/glance + charm: ch:glance num_units: 1 options: openstack-origin: *openstack-origin to: - '4' + channel: yoga/edge neutron-api: - charm: cs:~openstack-charmers-next/neutron-api + charm: ch:neutron-api num_units: 1 options: openstack-origin: *openstack-origin @@ -78,45 +89,51 @@ applications: neutron-security-groups: true to: - '5' + channel: yoga/edge neutron-openvswitch: - charm: cs:~openstack-charmers-next/neutron-openvswitch + charm: ch:neutron-openvswitch + channel: yoga/edge neutron-gateway: - charm: cs:~openstack-charmers-next/neutron-gateway + charm: ch:neutron-gateway num_units: 1 options: openstack-origin: *openstack-origin bridge-mappings: physnet1:br-ex to: - '6' + channel: yoga/edge keystone: - charm: cs:~openstack-charmers-next/keystone + charm: ch:keystone num_units: 1 options: openstack-origin: *openstack-origin to: - '7' + channel: yoga/edge rabbitmq-server: - charm: cs:~openstack-charmers-next/rabbitmq-server + charm: ch:rabbitmq-server num_units: 1 options: source: *openstack-origin to: - '8' + channel: latest/edge placement: - charm: cs:~openstack-charmers-next/placement + charm: ch:placement num_units: 1 options: openstack-origin: *openstack-origin to: - '9' + channel: yoga/edge nova-compute: - charm: cs:~openstack-charmers-next/nova-compute + charm: ch:nova-compute num_units: 2 storage: ephemeral-device: '40G' @@ -126,15 +143,17 @@ applications: to: - '10' - '11' + channel: yoga/edge manila: - charm: cs:~openstack-charmers-next/manila + charm: ch:manila num_units: 1 options: openstack-origin: *openstack-origin default-share-backend: netapp-ontap to: - '12' + channel: yoga/edge manila-netapp: charm: ../../manila-netapp.charm diff --git a/tests/bundles/focal-ussuri.yaml b/tests/bundles/jammy-yoga.yaml similarity index 84% rename from tests/bundles/focal-ussuri.yaml rename to tests/bundles/jammy-yoga.yaml index 727ba9b..27e1622 100644 --- a/tests/bundles/focal-ussuri.yaml +++ b/tests/bundles/jammy-yoga.yaml @@ -1,7 +1,9 @@ variables: openstack-origin: &openstack-origin distro -series: focal +local_overlay_enabled: True + +series: jammy comment: - 'machines section to decide order of deployment. database sooner = faster' @@ -28,20 +30,26 @@ machines: applications: manila-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router + charm: ch:mysql-router + channel: latest/edge keystone-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router + charm: ch:mysql-router + channel: latest/edge neutron-api-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router + charm: ch:mysql-router + channel: latest/edge nova-cloud-controller-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router + charm: ch:mysql-router + channel: latest/edge glance-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router + charm: ch:mysql-router + channel: latest/edge placement-mysql-router: - charm: cs:~openstack-charmers-next/mysql-router + charm: ch:mysql-router + channel: latest/edge mysql-innodb-cluster: - charm: cs:~openstack-charmers-next/mysql-innodb-cluster + charm: ch:mysql-innodb-cluster num_units: 3 options: source: *openstack-origin @@ -49,26 +57,29 @@ applications: - '0' - '1' - '2' + channel: latest/edge nova-cloud-controller: - charm: cs:~openstack-charmers-next/nova-cloud-controller + charm: ch:nova-cloud-controller num_units: 1 options: network-manager: Neutron openstack-origin: *openstack-origin to: - '3' + channel: yoga/edge glance: - charm: cs:~openstack-charmers-next/glance + charm: ch:glance num_units: 1 options: openstack-origin: *openstack-origin to: - '4' + channel: yoga/edge neutron-api: - charm: cs:~openstack-charmers-next/neutron-api + charm: ch:neutron-api num_units: 1 options: openstack-origin: *openstack-origin @@ -78,45 +89,51 @@ applications: neutron-security-groups: true to: - '5' + channel: yoga/edge neutron-openvswitch: - charm: cs:~openstack-charmers-next/neutron-openvswitch + charm: ch:neutron-openvswitch + channel: yoga/edge neutron-gateway: - charm: cs:~openstack-charmers-next/neutron-gateway + charm: ch:neutron-gateway num_units: 1 options: openstack-origin: *openstack-origin bridge-mappings: physnet1:br-ex to: - '6' + channel: yoga/edge keystone: - charm: cs:~openstack-charmers-next/keystone + charm: ch:keystone num_units: 1 options: openstack-origin: *openstack-origin to: - '7' + channel: yoga/edge rabbitmq-server: - charm: cs:~openstack-charmers-next/rabbitmq-server + charm: ch:rabbitmq-server num_units: 1 options: source: *openstack-origin to: - '8' + channel: latest/edge placement: - charm: cs:~openstack-charmers-next/placement + charm: ch:placement num_units: 1 options: openstack-origin: *openstack-origin to: - '9' + channel: yoga/edge nova-compute: - charm: cs:~openstack-charmers-next/nova-compute + charm: ch:nova-compute num_units: 2 storage: ephemeral-device: '40G' @@ -126,15 +143,17 @@ applications: to: - '10' - '11' + channel: yoga/edge manila: - charm: cs:~openstack-charmers-next/manila + charm: ch:manila num_units: 1 options: openstack-origin: *openstack-origin default-share-backend: netapp-ontap to: - '12' + channel: yoga/edge manila-netapp: charm: ../../manila-netapp.charm diff --git a/tests/bundles/overlays/local-charm-overlay.yaml.j2 b/tests/bundles/overlays/local-charm-overlay.yaml.j2 index 4b70c38..7ec2675 100644 --- a/tests/bundles/overlays/local-charm-overlay.yaml.j2 +++ b/tests/bundles/overlays/local-charm-overlay.yaml.j2 @@ -1,13 +1,13 @@ applications: manila-netapp: options: - vserver-name: {{ TEST_MANILA_NETAPP_VSERVER_NAME }} - management-address: {{ TEST_MANILA_NETAPP_MANAGEMENT_ADDRESS }} - admin-name: {{ TEST_MANILA_NETAPP_ADMIN_NAME }} - admin-password: {{ TEST_MANILA_NETAPP_ADMIN_PASSWORD }} + vserver-name: {{ TEST_NETAPP_SAN_VSERVER }} + management-address: {{ TEST_NETAPP_SAN_IP }} + admin-name: {{ TEST_NETAPP_SAN_USERNAME }} + admin-password: {{ TEST_NETAPP_SAN_PASSWORD }} manila-netapp-dhss: options: - root-volume-aggregate-name: {{ TEST_MANILA_NETAPP_ROOT_VOL_AGGR_NAME }} - management-address: {{ TEST_MANILA_NETAPP_MANAGEMENT_ADDRESS }} - admin-name: {{ TEST_MANILA_NETAPP_ADMIN_NAME }} - admin-password: {{ TEST_MANILA_NETAPP_ADMIN_PASSWORD }} + root-volume-aggregate-name: {{ TEST_NETAPP_ROOT_VOL_AGGR_NAME }} + management-address: {{ TEST_NETAPP_SAN_IP }} + admin-name: {{ TEST_NETAPP_SAN_USERNAME }} + admin-password: {{ TEST_NETAPP_SAN_PASSWORD }} diff --git a/tests/tests.yaml b/tests/tests.yaml index 9ff985d..4125ce6 100644 --- a/tests/tests.yaml +++ b/tests/tests.yaml @@ -1,15 +1,16 @@ charm_name: manila-netapp gate_bundles: -- bionic-ussuri -- focal-ussuri -- focal-victoria -- groovy-victoria + - focal-xena + +dev_bundles: + - focal-yoga + - jammy-yoga # WARNING(lourot): func-smoke has been temporarily disabled in tox.ini. See # rationale there. smoke_bundles: -- bionic-ussuri +- focal-xena target_deploy_status: {} @@ -29,4 +30,5 @@ tests: tests_options: force_deploy: - - groovy-victoria + - jammy-yoga + diff --git a/tox.ini b/tox.ini index 09e4245..173345e 100644 --- a/tox.ini +++ b/tox.ini @@ -15,8 +15,12 @@ skip_missing_interpreters = False # * It is also necessary to pin virtualenv as a newer virtualenv would still # lead to fetching the latest pip in the func* tox targets, see # https://stackoverflow.com/a/38133283 +# * It is necessary to declare setuptools as a dependency otherwise tox will +# fail very early at not being able to load it. The version pinning is in +# line with `pip.sh`. requires = pip < 20.3 virtualenv < 20.0 + setuptools < 50.0.0 # NOTE: https://wiki.canonical.com/engineering/OpenStack/InstallLatestToxOnOsci minversion = 3.2.0 @@ -27,38 +31,44 @@ setenv = VIRTUAL_ENV={envdir} install_command = pip install {opts} {packages} commands = stestr run --slowest {posargs} -whitelist_externals = +allowlist_externals = git bash + charmcraft + rename.sh passenv = HOME TERM CS_* OS_* TEST_* deps = -r{toxinidir}/test-requirements.txt -[testenv:py35] -basepython = python3.5 -# python3.5 is irrelevant on a bionic+ charm. -deps = -commands = /bin/true - -[testenv:py36] -basepython = python3.6 -deps = -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt - -[testenv:py37] -basepython = python3.7 -deps = -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt - -[testenv:py38] -basepython = python3.8 -deps = -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt [testenv:py3] basepython = python3 deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt +[testenv:py36] +basepython = python3.6 +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt +commands = stestr run --slowest {posargs} + +[testenv:py38] +basepython = python3.8 +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt +commands = stestr run --slowest {posargs} + +[testenv:py39] +basepython = python3.9 +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt +commands = stestr run --slowest {posargs} + +[testenv:py310] +basepython = python3.10 +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt +commands = stestr run --slowest {posargs} + [testenv:pep8] basepython = python3 deps = -r{toxinidir}/requirements.txt @@ -101,7 +111,9 @@ commands = {posargs} basepython = python3 deps = -r{toxinidir}/build-requirements.txt commands = - charmcraft build --verbose + charmcraft clean + charmcraft -v build + {toxinidir}/rename.sh [testenv:func-noop] basepython = python3 diff --git a/unit_tests/test_charm.py b/unit_tests/test_charm.py index 99e4b71..e8bf55f 100644 --- a/unit_tests/test_charm.py +++ b/unit_tests/test_charm.py @@ -9,7 +9,7 @@ from unittest import ( mock, TestCase, ) -from ops.model import ActiveStatus, BlockedStatus, MaintenanceStatus +from ops.model import ActiveStatus, BlockedStatus, UnknownStatus from ops.testing import Harness import charm @@ -98,7 +98,7 @@ class TestManilaNetappCharm(TestCase): _get_loader.assert_not_called() _send_backend_config.assert_not_called() _install_pkgs.assert_called_once_with() - self.assertEqual(self.harness.charm.unit.status, MaintenanceStatus('')) + self.assertEqual(self.harness.charm.unit.status, UnknownStatus()) # Validate workflow with complete relation data rel_id = self.harness.add_relation('manila-plugin', 'manila')