From: John Spray Date: Mon, 9 Nov 2015 13:16:36 +0000 (+0000) Subject: tasks/cephfs: clear extra auth ids on test start X-Git-Tag: v10.2.6~165^2^2~220^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7a19b6dc0dcaed2eb459bc9e8a4649f4efed9724;p=ceph.git tasks/cephfs: clear extra auth ids on test start Because new volumeclient tests will be creating IDs instead of modifying the default ones. Signed-off-by: John Spray --- diff --git a/tasks/cephfs/cephfs_test_case.py b/tasks/cephfs/cephfs_test_case.py index 500cd765589d..98ca5fdb5b7b 100644 --- a/tasks/cephfs/cephfs_test_case.py +++ b/tasks/cephfs/cephfs_test_case.py @@ -132,13 +132,21 @@ class CephFSTestCase(unittest.TestCase): self.fs.mon_manager.raw_cluster_cmd("osd", "blacklist", "rm", addr) # In case some test messed with auth caps, reset them - for mount in self.mounts: + client_mount_ids = [m.client_id for m in self.mounts] + for client_id in client_mount_ids: self.fs.mon_manager.raw_cluster_cmd_result( - 'auth', 'caps', "client.{0}".format(mount.client_id), + 'auth', 'caps', "client.{0}".format(client_id), 'mds', 'allow', 'mon', 'allow r', 'osd', 'allow rw pool={0}'.format(self.fs.get_data_pool_name())) + # In case there were any extra auth identities around from a previous + # test, delete them + for entry in self.auth_list(): + ent_type, ent_id = entry['entity'].split(".") + if ent_type == "client" and ent_id not in client_mount_ids and ent_id != "admin": + self.fs.mon_manager.raw_cluster_cmd("auth", "del", entry['entity']) + self.fs.mds_restart() self.fs.wait_for_daemons() if not self.mount_a.is_mounted():