From f033cd3f205f120cf2afb0892067df534933650e Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Sat, 31 Oct 2020 21:02:03 -0700 Subject: [PATCH] qa: accept client returning pool id for layout Resolving this failure: 2020-10-30T22:52:25.898 INFO:tasks.cephfs_test_runner:test_subvolume_group_create_with_desired_data_pool_layout (tasks.cephfs.test_volumes.TestSubvolumeGroups) ... FAIL 2020-10-30T22:52:25.898 INFO:tasks.cephfs_test_runner: 2020-10-30T22:52:25.899 INFO:tasks.cephfs_test_runner:====================================================================== 2020-10-30T22:52:25.899 INFO:tasks.cephfs_test_runner:FAIL: test_subvolume_group_create_with_desired_data_pool_layout (tasks.cephfs.test_volumes.TestSubvolumeGroups) 2020-10-30T22:52:25.899 INFO:tasks.cephfs_test_runner:---------------------------------------------------------------------- 2020-10-30T22:52:25.899 INFO:tasks.cephfs_test_runner:Traceback (most recent call last): 2020-10-30T22:52:25.900 INFO:tasks.cephfs_test_runner: File "/home/teuthworker/src/github.com_batrick_ceph_cephfs-qa-reorg/qa/tasks/cephfs/test_volumes.py", line 568, in test_subvolume_group_create_with_desired_data_pool_layout 2020-10-30T22:52:25.900 INFO:tasks.cephfs_test_runner: self.assertEqual(desired_pool, new_pool) 2020-10-30T22:52:25.900 INFO:tasks.cephfs_test_runner:AssertionError: '34' != 'new_pool' 2020-10-30T22:52:25.900 INFO:tasks.cephfs_test_runner:- 34 2020-10-30T22:52:25.900 INFO:tasks.cephfs_test_runner:+ new_pool Fixes: https://tracker.ceph.com/issues/23718 Signed-off-by: Patrick Donnelly --- qa/tasks/cephfs/test_volumes.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/qa/tasks/cephfs/test_volumes.py b/qa/tasks/cephfs/test_volumes.py index c325b96b39f..e5181cf56b5 100644 --- a/qa/tasks/cephfs/test_volumes.py +++ b/qa/tasks/cephfs/test_volumes.py @@ -11,6 +11,7 @@ from hashlib import md5 from textwrap import dedent from tasks.cephfs.cephfs_test_case import CephFSTestCase +from tasks.cephfs.fuse_mount import FuseMount from teuthology.exceptions import CommandFailedError log = logging.getLogger(__name__) @@ -557,7 +558,7 @@ class TestSubvolumeGroups(TestVolumesHelper): self.assertNotEqual(default_pool, new_pool) # add data pool - self.fs.add_data_pool(new_pool) + newid = self.fs.add_data_pool(new_pool) # create group specifying the new data pool as its pool layout self._fs_cmd("subvolumegroup", "create", self.volname, group2, @@ -565,7 +566,10 @@ class TestSubvolumeGroups(TestVolumesHelper): group2_path = self._get_subvolume_group_path(self.volname, group2) desired_pool = self.mount_a.getfattr(group2_path, "ceph.dir.layout.pool") - self.assertEqual(desired_pool, new_pool) + try: + self.assertEqual(desired_pool, new_pool) + except AssertionError: + self.assertEqual(int(desired_pool), newid) # old kernel returns id self._fs_cmd("subvolumegroup", "rm", self.volname, group1) self._fs_cmd("subvolumegroup", "rm", self.volname, group2) @@ -869,7 +873,7 @@ class TestSubvolumes(TestVolumesHelper): self.assertNotEqual(default_pool, new_pool) # add data pool - self.fs.add_data_pool(new_pool) + newid = self.fs.add_data_pool(new_pool) # create subvolume specifying the new data pool as its pool layout self._fs_cmd("subvolume", "create", self.volname, subvol2, "--group_name", group, @@ -877,7 +881,10 @@ class TestSubvolumes(TestVolumesHelper): subvol2_path = self._get_subvolume_path(self.volname, subvol2, group_name=group) desired_pool = self.mount_a.getfattr(subvol2_path, "ceph.dir.layout.pool") - self.assertEqual(desired_pool, new_pool) + try: + self.assertEqual(desired_pool, new_pool) + except AssertionError: + self.assertEqual(int(desired_pool), newid) # old kernel returns id self._fs_cmd("subvolume", "rm", self.volname, subvol2, group) self._fs_cmd("subvolume", "rm", self.volname, subvol1, group) @@ -3050,7 +3057,7 @@ class TestSubvolumeSnapshotClones(TestVolumesHelper): # add data pool new_pool = "new_pool" - self.fs.add_data_pool(new_pool) + newid = self.fs.add_data_pool(new_pool) # create subvolume self._fs_cmd("subvolume", "create", self.volname, subvolume) @@ -3075,7 +3082,10 @@ class TestSubvolumeSnapshotClones(TestVolumesHelper): subvol_path = self._get_subvolume_path(self.volname, clone) desired_pool = self.mount_a.getfattr(subvol_path, "ceph.dir.layout.pool") - self.assertEqual(desired_pool, new_pool) + try: + self.assertEqual(desired_pool, new_pool) + except AssertionError: + self.assertEqual(int(desired_pool), newid) # old kernel returns id # remove subvolumes self._fs_cmd("subvolume", "rm", self.volname, subvolume) -- 2.39.5