From 79f488332c052226154b0decbd0cf31522ad9a8e Mon Sep 17 00:00:00 2001 From: Chris MacNaughton Date: Wed, 20 Apr 2022 07:44:10 +0200 Subject: [PATCH] Updates for opendev & jammy enablement - Add .zuul.yaml to run gate testing - charmcraft: build-on 20.04 -> run-on 20.04/22.04 [*archs] - Refresh tox targets - Add jammy metadata - Default source is yoga - fix typo in ganesha-client property Change-Id: Iddf3e97078bc397ace4995f53417837445579fa3 --- .gitreview | 4 ++++ .zuul.yaml | 4 ++++ charmcraft.yaml | 17 +++++++++++++---- config.yaml | 2 +- metadata.yaml | 4 +--- osci.yaml | 13 +++++-------- src/charm.py | 2 +- tests/nfs_ganesha.py | 4 ++-- tox.ini | 5 +++++ 9 files changed, 36 insertions(+), 19 deletions(-) create mode 100644 .gitreview create mode 100644 .zuul.yaml diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..1156bab --- /dev/null +++ b/.gitreview @@ -0,0 +1,4 @@ +[gerrit] +host=review.opendev.org +port=29418 +project=openstack/charm-ceph-nfs.git diff --git a/.zuul.yaml b/.zuul.yaml new file mode 100644 index 0000000..1ffc530 --- /dev/null +++ b/.zuul.yaml @@ -0,0 +1,4 @@ +- project: + templates: + - openstack-python3-charm-yoga-jobs + - openstack-cover-jobs \ No newline at end of file diff --git a/charmcraft.yaml b/charmcraft.yaml index c879200..2321917 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -19,8 +19,17 @@ parts: apt update apt install -y ca-certificates update-ca-certificates + bases: - - name: ubuntu - channel: "20.04" - architectures: - - amd64 \ No newline at end of file + - 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] \ No newline at end of file diff --git a/config.yaml b/config.yaml index a02c7a1..00c53bc 100644 --- a/config.yaml +++ b/config.yaml @@ -10,7 +10,7 @@ options: source: type: string - default: proposed + default: yoga description: | Optional configuration to support use of additional sources such as: - ppa:myteam/ppa diff --git a/metadata.yaml b/metadata.yaml index 6f402dc..051ed1f 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -9,9 +9,7 @@ tags: - misc series: - focal - - groovy - - hirsute - - impish + - jammy subordinate: false min-juju-version: 2.7.6 extra-bindings: diff --git a/osci.yaml b/osci.yaml index 7f46aa7..3cb7149 100644 --- a/osci.yaml +++ b/osci.yaml @@ -1,6 +1,7 @@ - project: templates: - - charm-unit-jobs + - charm-unit-jobs-py38 + - charm-unit-jobs-py39 check: jobs: - focal-pacific @@ -12,12 +13,10 @@ name: focal-pacific parent: func-target dependencies: - charm-build + - charm-build - osci-lint - - tox-py35 - - tox-py36 - - tox-py37 - tox-py38 + - tox-py39 vars: tox_extra_args: focal-pacific - job: @@ -26,9 +25,7 @@ dependencies: - charm-build - osci-lint - - tox-py35 - - tox-py36 - - tox-py37 - tox-py38 + - tox-py39 vars: tox_extra_args: focal-quincy \ No newline at end of file diff --git a/src/charm.py b/src/charm.py index 126ed3a..256e498 100755 --- a/src/charm.py +++ b/src/charm.py @@ -244,7 +244,7 @@ class CephNFSCharm( @property def ganesha_client(self): - GaneshaNFS(self.client_name, self.pool_name) + return GaneshaNFS(self.client_name, self.pool_name) def request_ceph_pool(self, event): """Request pools from Ceph cluster.""" diff --git a/tests/nfs_ganesha.py b/tests/nfs_ganesha.py index 42bd962..100c221 100644 --- a/tests/nfs_ganesha.py +++ b/tests/nfs_ganesha.py @@ -111,7 +111,7 @@ class NfsGaneshaTest(unittest.TestCase): def _write_testing_file_on_instance(self, instance_name: str): zaza.utilities.generic.run_via_ssh( unit_name=instance_name, - cmd='echo "test" | sudo tee {}/test'.format(self.mount_dir)) + cmd='echo -n "test" | sudo tee {}/test'.format(self.mount_dir)) @tenacity.retry( stop=tenacity.stop_after_attempt(5), @@ -121,7 +121,7 @@ class NfsGaneshaTest(unittest.TestCase): output = run_with_juju_ssh( 'sudo cat {}/test'.format(self.mount_dir)) logging.info("Verification output: {}".format(output)) - self.assertEqual('test\r\n', output) + self.assertEqual('test', output.strip()) def test_create_share(self): logging.info("Creating a share") diff --git a/tox.ini b/tox.ini index 09f4980..c278ef6 100644 --- a/tox.ini +++ b/tox.ini @@ -65,6 +65,11 @@ basepython = python3.9 deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt +[testenv:py310] +basepython = python3.10 +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + [testenv:py3] basepython = python3 deps = -r{toxinidir}/requirements.txt