Skip to content

Commit

Permalink
Merge pull request #1066 from sabaini/bug/1968369
Browse files Browse the repository at this point in the history
Add a new TestClass that verifies test permissions change on charm up…
  • Loading branch information
sabaini authored Jun 30, 2023
2 parents 5b3ffd9 + 7edf825 commit 9e5f2e8
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions zaza/openstack/charm_tests/ceph/mon/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"""Ceph-mon Testing for cinder-ceph."""

import logging
import os

import zaza.model

Expand Down Expand Up @@ -125,6 +126,30 @@ def test_500_ceph_alternatives_cleanup(self):
logging.info("... Done.")


class CephPermissionUpgradeTest(test_utils.OpenStackBaseTest):
"""Verify that the ceph mon units update permissions on upgrade."""

@classmethod
def setUpClass(cls):
"""Run class setup for running ceph mon tests."""
super().setUpClass()

def test_ceph_permission_upgrade(self):
"""Check that the charm updates permissions on charm upgrade."""
# Revoke 'osd blocklist' command
zaza.model.run_on_leader(
'ceph-mon',
'sudo -u ceph ceph auth caps client.cinder-ceph mon '
'"allow r; allow command \"osd blacklist\"" osd "allow rwx"')
charm = 'ceph-mon'
charm_path = os.getcwd() + '/' + charm + '.charm'
logging.debug("Upgrading {} to {}".format(charm, charm_path))
zaza.model.upgrade_charm(charm, path=charm_path)
auth = zaza.model.run_on_leader(
'ceph-mon', 'ceph auth get client.cinder-ceph')['Stdout']
self.assertIn('blocklist', auth)


def does_relation_exist(unit_name,
application_name,
remote_application_name,
Expand Down

0 comments on commit 9e5f2e8

Please sign in to comment.