From: Shilpa Jagannath Date: Mon, 15 Dec 2025 18:27:37 +0000 (-0500) Subject: test/qa: fix admin cmd X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fheads%2Fwip-shilpa-testing-main;p=ceph-ci.git test/qa: fix admin cmd Signed-off-by: Shilpa Jagannath --- diff --git a/qa/tasks/rgw_multisite.py b/qa/tasks/rgw_multisite.py index f93ca017fa2..4d6b421a976 100644 --- a/qa/tasks/rgw_multisite.py +++ b/qa/tasks/rgw_multisite.py @@ -199,6 +199,27 @@ class Cluster(multisite.Cluster): if check_retcode: assert r == 0 return s, r + + def ceph_admin(self, args = None, **kwargs): + """ ceph command """ + args = args or [] + # Build the ceph command with cluster specification + cmd = ['ceph', '--cluster', self.name] + args + + # Get the remote for this client + (remote,) = self.ctx.cluster.only(self.client).remotes.keys() + + # Run the command + check_retcode = kwargs.pop('check_retcode', True) + proc = remote.run( + args=cmd, + check_status=check_retcode, + **kwargs + ) + + if hasattr(proc, 'stdout'): + return proc.stdout.getvalue() if hasattr(proc.stdout, 'getvalue') else proc.stdout + return '' class Gateway(multisite.Gateway): """ Controls a radosgw instance using its daemon """ diff --git a/src/test/rgw/rgw_multi/multisite.py b/src/test/rgw/rgw_multi/multisite.py index 982ebe3ea7d..6deb895657e 100644 --- a/src/test/rgw/rgw_multi/multisite.py +++ b/src/test/rgw/rgw_multi/multisite.py @@ -13,6 +13,11 @@ class Cluster: def admin(self, args = None, **kwargs): """ execute a radosgw-admin command """ pass + + @abstractmethod + def ceph_admin(self, args = None, **kwargs): + """ execute a ceph command """ + pass class Gateway: """ interface to control a single radosgw instance """