Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new TestClass that verifies test permissions change on charm up… #1066

Merged
merged 1 commit into from Jun 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 25 additions & 0 deletions zaza/openstack/charm_tests/ceph/mon/tests.py
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