Add reef functests to CI

Via the jammy-bobcat UCA

Don't rely on feature branch, vendor in context adapter instead

Change-Id: Ifc5f04ce2259d19cb120a1434a2f80b178bd4dc3
This commit is contained in:
Peter Sabaini 2023-10-03 12:38:12 +02:00
parent 1b28a0daed
commit f5e6b57787
5 changed files with 107 additions and 3 deletions

View File

@ -7,6 +7,7 @@
- focal-pacific
- focal-quincy
- jammy-quincy
- jammy-reef
- lunar-quincy
- mantic-quincy
vars:
@ -41,6 +42,13 @@
- focal-quincy
vars:
tox_extra_args: -- jammy-quincy
- job:
name: jammy-reef
parent: func-target
dependencies:
- focal-quincy
vars:
tox_extra_args: -- jammy-reef
- job:
name: lunar-quincy
parent: func-target

View File

@ -2,5 +2,5 @@
ops <= 1.6.0
git+https://github.com/juju/charm-helpers.git#egg=charmhelpers
git+https://opendev.org/openstack/charm-ops-interface-ceph-client#egg=interface_ceph_client
git+https://github.com/ChrisMacNaughton/charm-ops-openstack.git@feature/charm-instance-to-relation-adapter#egg=ops_openstack
git+https://opendev.org/openstack/charm-ops-openstack#egg=ops_openstack
git+https://opendev.org/openstack/charm-interface-hacluster#egg=interface_hacluster

View File

@ -101,8 +101,53 @@ class CephNFSContext(object):
return socket.gethostname()
class CephNFSAdapters(
class OpenStackContextAdapters(
ops_openstack.adapters.OpenStackRelationAdapters):
"""
Augmentation of OpenStackRelationAdapters that also includes contexts.
Proposed for upstreaming
https://review.opendev.org/c/openstack/charm-ops-openstack/+/897238
"""
relation_adapters = {}
def __init__(self, relations, charm_instance,
options_instance=None, contexts=None):
"""
:param relations: List of instances of relation classes
:param options: Configuration class to use (DEPRECATED)
:param options_instance: Instance of Configuration class to use
:param charm_instance: optional charm_instance that is captured as a
weakref for use on the adapter.
:param contexts: Optional list of contexts
"""
super().__init__(
relations, charm_instance,
options_instance=options_instance
)
if contexts is None:
contexts = ()
self._contexts = set()
for context in contexts:
self.add_context(context)
def __iter__(self):
"""
Iterate over the relations and contexts presented to the charm.
"""
for ref in self._relations.union(self._contexts):
yield ref, getattr(self, ref)
def add_context(self, context):
"""Add the context to this adapters instance.
:param relation: a RAW context
"""
setattr(self, context.name, context)
self._contexts.add(context.name)
class CephNFSAdapters(OpenStackContextAdapters):
"""Collection of relation adapters."""
relation_adapters = {

View File

@ -0,0 +1,50 @@
options:
source: &source cloud:jammy-bobcat
local_overlay_enabled: False
series: jammy
applications:
ubuntu:
charm: cs:ubuntu
num_units: 2
ceph-nfs:
charm: ../../ceph-nfs.charm
num_units: 2
options:
source: *source
ceph-osd:
charm: ch:ceph-osd
channel: latest/edge
num_units: 3
storage:
osd-devices: '2,10G'
options:
source: *source
ceph-mon:
charm: ch:ceph-mon
channel: latest/edge
num_units: 3
options:
monitor-count: '3'
expected-osd-count: 6
source: *source
ceph-fs:
charm: ch:ceph-fs
channel: latest/edge
num_units: 2
options:
source: *source
hacluster:
charm: ch:hacluster
channel: 2.4/edge
options:
cluster_count: 2
relations:
- - 'ceph-mon:client'
- 'ceph-nfs:ceph-client'
- - 'ceph-osd:mon'
- 'ceph-mon:osd'
- - 'ceph-fs'
- 'ceph-mon'
- - 'ceph-nfs:ha'
- 'hacluster:ha'

View File

@ -2,7 +2,8 @@ charm_name: ceph-nfs
gate_bundles:
- focal-quincy
- focal-pacific
- jammy-pacific
- jammy-quincy
- jammy-reef
- mantic-quincy
smoke_bundles:
- focal-pacific