From 004576e82b7541b0c100f33a7a6b590c651f5a5d Mon Sep 17 00:00:00 2001 From: Alex Kavanagh Date: Fri, 9 Feb 2024 18:15:47 +0000 Subject: [PATCH] Updates for caracal testing support These updates, on the master branch, are to support testing the caracal packages and support of the charms for caracal. They do NOT lock the charms down, and don't change the testing branches to stable branches. Change-Id: If3fd48454e7959fdd6e2e1708b80a97c76576063 --- charmcraft.yaml | 6 --- charmhelpers/contrib/openstack/context.py | 3 +- charmhelpers/contrib/openstack/utils.py | 25 +++--------- charmhelpers/fetch/ubuntu.py | 10 +++++ metadata.yaml | 10 ++--- tests/bundles/jammy-antelope.yaml | 2 +- tests/bundles/jammy-bobcat.yaml | 2 +- ...{mantic-bobcat.yaml => jammy-caracal.yaml} | 6 +-- ...lunar-antelope.yaml => noble-caracal.yaml} | 4 +- tests/tests.yaml | 38 +++++++++---------- 10 files changed, 45 insertions(+), 61 deletions(-) rename tests/bundles/{mantic-bobcat.yaml => jammy-caracal.yaml} (92%) rename tests/bundles/{lunar-antelope.yaml => noble-caracal.yaml} (97%) diff --git a/charmcraft.yaml b/charmcraft.yaml index 58e7c161..79551bcd 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -32,9 +32,3 @@ bases: - name: ubuntu channel: "22.04" architectures: [amd64, s390x, ppc64el, arm64] - - name: ubuntu - channel: "23.04" - architectures: [amd64, s390x, ppc64el, arm64] - - name: ubuntu - channel: "23.10" - architectures: [amd64, s390x, ppc64el, arm64] diff --git a/charmhelpers/contrib/openstack/context.py b/charmhelpers/contrib/openstack/context.py index 42f15032..1e667fb0 100644 --- a/charmhelpers/contrib/openstack/context.py +++ b/charmhelpers/contrib/openstack/context.py @@ -545,7 +545,7 @@ class IdentityServiceContext(OSContextGenerator): 'internal_auth_url': internal_auth_url, }) - # we keep all veriables in ctxt for compatibility and + # we keep all variables in ctxt for compatibility and # add nested dictionary for keystone_authtoken generic # templating if keystonemiddleware_os_release: @@ -557,6 +557,7 @@ class IdentityServiceContext(OSContextGenerator): # NOTE(jamespage) this is required for >= icehouse # so a missing value just indicates keystone needs # upgrading + ctxt['admin_user_id'] = _resolve('service_user_id') ctxt['admin_tenant_id'] = _resolve('service_tenant_id') ctxt['admin_domain_id'] = _resolve('service_domain_id') return ctxt diff --git a/charmhelpers/contrib/openstack/utils.py b/charmhelpers/contrib/openstack/utils.py index e98be2c5..da711c65 100644 --- a/charmhelpers/contrib/openstack/utils.py +++ b/charmhelpers/contrib/openstack/utils.py @@ -161,6 +161,7 @@ OPENSTACK_CODENAMES = OrderedDict([ ('2022.2', 'zed'), ('2023.1', 'antelope'), ('2023.2', 'bobcat'), + ('2024.1', 'caracal'), ]) # The ugly duckling - must list releases oldest to newest @@ -416,17 +417,6 @@ def get_os_version_codename(codename, version_map=OPENSTACK_CODENAMES, error_out(e) -def get_os_version_codename_swift(codename): - '''Determine OpenStack version number of swift from codename.''' - # for k, v in six.iteritems(SWIFT_CODENAMES): - for k, v in SWIFT_CODENAMES.items(): - if k == codename: - return v[-1] - e = 'Could not derive swift version for '\ - 'codename: %s' % codename - error_out(e) - - def get_swift_codename(version): '''Determine OpenStack codename that corresponds to swift version.''' codenames = [k for k, v in SWIFT_CODENAMES.items() if version in v] @@ -585,7 +575,6 @@ def get_installed_os_version(): return openstack_release().get('OPENSTACK_CODENAME') -@cached def openstack_release(): """Return /etc/os-release in a dict.""" d = {} @@ -847,14 +836,10 @@ def openstack_upgrade_available(package): if not cur_vers: # The package has not been installed yet do not attempt upgrade return False - if "swift" in package: - codename = get_os_codename_install_source(src) - avail_vers = get_os_version_codename_swift(codename) - else: - try: - avail_vers = get_os_version_install_source(src) - except Exception: - avail_vers = cur_vers + try: + avail_vers = get_os_version_install_source(src) + except Exception: + avail_vers = cur_vers apt.init() return apt.version_compare(avail_vers, cur_vers) >= 1 diff --git a/charmhelpers/fetch/ubuntu.py b/charmhelpers/fetch/ubuntu.py index 1be992c4..d0089eb7 100644 --- a/charmhelpers/fetch/ubuntu.py +++ b/charmhelpers/fetch/ubuntu.py @@ -246,6 +246,14 @@ CLOUD_ARCHIVE_POCKETS = { 'bobcat/proposed': 'jammy-proposed/bobcat', 'jammy-bobcat/proposed': 'jammy-proposed/bobcat', 'jammy-proposed/bobcat': 'jammy-proposed/bobcat', + # caracal + 'caracal': 'jammy-updates/caracal', + 'jammy-caracal': 'jammy-updates/caracal', + 'jammy-caracal/updates': 'jammy-updates/caracal', + 'jammy-updates/caracal': 'jammy-updates/caracal', + 'caracal/proposed': 'jammy-proposed/caracal', + 'jammy-caracal/proposed': 'jammy-proposed/caracal', + 'jammy-proposed/caracal': 'jammy-proposed/caracal', # OVN 'focal-ovn-22.03': 'focal-updates/ovn-22.03', @@ -279,6 +287,7 @@ OPENSTACK_RELEASES = ( 'zed', 'antelope', 'bobcat', + 'caracal', ) @@ -308,6 +317,7 @@ UBUNTU_OPENSTACK_RELEASE = OrderedDict([ ('kinetic', 'zed'), ('lunar', 'antelope'), ('mantic', 'bobcat'), + ('noble', 'caracal'), ]) diff --git a/metadata.yaml b/metadata.yaml index 295f0a84..b8d02654 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -7,13 +7,11 @@ description: | implements OpenStack's Identity API. docs: https://discourse.charmhub.io/t/keystone-docs-index/10527 tags: -- openstack -- identity -- misc + - openstack + - identity + - misc series: -- jammy -- lunar -- mantic + - jammy extra-bindings: public: admin: diff --git a/tests/bundles/jammy-antelope.yaml b/tests/bundles/jammy-antelope.yaml index 06eb8d98..86307957 100644 --- a/tests/bundles/jammy-antelope.yaml +++ b/tests/bundles/jammy-antelope.yaml @@ -54,7 +54,7 @@ applications: openstack-origin: *openstack-origin to: - '6' - channel: latest/edge + channel: 2024.1/edge relations: diff --git a/tests/bundles/jammy-bobcat.yaml b/tests/bundles/jammy-bobcat.yaml index 2fea5645..7c663aa4 100644 --- a/tests/bundles/jammy-bobcat.yaml +++ b/tests/bundles/jammy-bobcat.yaml @@ -54,7 +54,7 @@ applications: openstack-origin: *openstack-origin to: - '6' - channel: latest/edge + channel: 2024.1/edge relations: diff --git a/tests/bundles/mantic-bobcat.yaml b/tests/bundles/jammy-caracal.yaml similarity index 92% rename from tests/bundles/mantic-bobcat.yaml rename to tests/bundles/jammy-caracal.yaml index 49575181..e1463d90 100644 --- a/tests/bundles/mantic-bobcat.yaml +++ b/tests/bundles/jammy-caracal.yaml @@ -1,7 +1,7 @@ variables: - openstack-origin: &openstack-origin distro + openstack-origin: &openstack-origin cloud:jammy-caracal -series: mantic +series: jammy comment: - 'machines section to decide order of deployment. database sooner = faster' @@ -54,7 +54,7 @@ applications: openstack-origin: *openstack-origin to: - '6' - channel: latest/edge + channel: 2024.1/edge relations: diff --git a/tests/bundles/lunar-antelope.yaml b/tests/bundles/noble-caracal.yaml similarity index 97% rename from tests/bundles/lunar-antelope.yaml rename to tests/bundles/noble-caracal.yaml index 998d0c9e..14196db8 100644 --- a/tests/bundles/lunar-antelope.yaml +++ b/tests/bundles/noble-caracal.yaml @@ -1,7 +1,7 @@ variables: openstack-origin: &openstack-origin distro -series: lunar +series: noble comment: - 'machines section to decide order of deployment. database sooner = faster' @@ -54,7 +54,7 @@ applications: openstack-origin: *openstack-origin to: - '6' - channel: latest/edge + channel: 2024.1/edge relations: diff --git a/tests/tests.yaml b/tests/tests.yaml index 43d79cdb..50664bc2 100644 --- a/tests/tests.yaml +++ b/tests/tests.yaml @@ -1,47 +1,43 @@ charm_name: keystone smoke_bundles: -- jammy-antelope - + - jammy-caracal gate_bundles: -- jammy-antelope - + - jammy-antelope + - jammy-bobcat + - jammy-caracal dev_bundles: -- jammy-bobcat -- lunar-antelope -- mantic-bobcat - + - noble-caracal comment: | the glance configure job validates operation of identity-service relation. The policyd test is generic and validates the policy.d overrides work configure: -- vault: - - zaza.openstack.charm_tests.vault.setup.auto_initialize_no_validation_no_wait -- keystone: - - zaza.openstack.charm_tests.keystone.setup.wait_for_cacert + - vault: + - zaza.openstack.charm_tests.vault.setup.auto_initialize_no_validation_no_wait + - keystone: + - zaza.openstack.charm_tests.keystone.setup.wait_for_cacert + - zaza.openstack.charm_tests.glance.setup.add_lts_image + - zaza.openstack.charm_tests.keystone.setup.add_demo_user - zaza.openstack.charm_tests.glance.setup.add_lts_image - zaza.openstack.charm_tests.keystone.setup.add_demo_user -- zaza.openstack.charm_tests.glance.setup.add_lts_image -- zaza.openstack.charm_tests.keystone.setup.add_demo_user tests: -- keystone: + - keystone: + - zaza.openstack.charm_tests.keystone.tests.AuthenticationAuthorizationTest + - zaza.openstack.charm_tests.keystone.tests.CharmOperationTest + - zaza.openstack.charm_tests.keystone.tests.SecurityTests + - zaza.openstack.charm_tests.policyd.tests.KeystoneTests - zaza.openstack.charm_tests.keystone.tests.AuthenticationAuthorizationTest - zaza.openstack.charm_tests.keystone.tests.CharmOperationTest - zaza.openstack.charm_tests.keystone.tests.SecurityTests - zaza.openstack.charm_tests.policyd.tests.KeystoneTests -- zaza.openstack.charm_tests.keystone.tests.AuthenticationAuthorizationTest -- zaza.openstack.charm_tests.keystone.tests.CharmOperationTest -- zaza.openstack.charm_tests.keystone.tests.SecurityTests -- zaza.openstack.charm_tests.policyd.tests.KeystoneTests tests_options: policyd: service: keystone force_deploy: - - lunar-antelope - - mantic-bobcat + - noble-caracal target_deploy_status: vault: workload-status: blocked