From afe19f24baf3983a42f6213c04efc20307c286d2 Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Thu, 23 Apr 2020 21:08:23 -0400 Subject: [PATCH] qa/tasks/cephfs/test_volumes: to make sure the size is int type Fix "Error EINVAL: invalid size option '4915200.0'". In pytho2 int/2 will get a int type result, but in python3 it maybe a float type. Fixes: https://tracker.ceph.com/issues/45247 Signed-off-by: Xiubo Li --- qa/tasks/cephfs/test_volumes.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qa/tasks/cephfs/test_volumes.py b/qa/tasks/cephfs/test_volumes.py index 766e957b5d0..681993527e5 100644 --- a/qa/tasks/cephfs/test_volumes.py +++ b/qa/tasks/cephfs/test_volumes.py @@ -364,7 +364,7 @@ class TestVolumes(CephFSTestCase): self.assertNotEqual(subvolpath, None) # shrink the subvolume - nsize = osize/2 + nsize = osize // 2 self._fs_cmd("subvolume", "resize", self.volname, subvolname, str(nsize)) # verify the quota @@ -456,7 +456,7 @@ class TestVolumes(CephFSTestCase): self.assertEqual(usedsize, susedsize) # shrink the subvolume - nsize = usedsize/2 + nsize = usedsize // 2 try: self._fs_cmd("subvolume", "resize", self.volname, subvolname, str(nsize)) except CommandFailedError: @@ -496,7 +496,7 @@ class TestVolumes(CephFSTestCase): self.assertEqual(usedsize, susedsize) # shrink the subvolume - nsize = usedsize/2 + nsize = usedsize // 2 try: self._fs_cmd("subvolume", "resize", self.volname, subvolname, str(nsize), "--no_shrink") except CommandFailedError as ce: @@ -531,7 +531,7 @@ class TestVolumes(CephFSTestCase): self.mount_a.write_n_mb(os.path.join(subvolpath, filename), file_size) # create a file of size 5MB and try write more - file_size=file_size/2 + file_size=file_size // 2 number_of_files=1 log.debug("filling subvolume {0} with {1} file of size {2}MB".format(subvolname, number_of_files, @@ -2156,7 +2156,7 @@ class TestVolumes(CephFSTestCase): self.fs.add_data_pool(new_pool) self.fs.mon_manager.raw_cluster_cmd("osd", "pool", "set-quota", new_pool, - "max_bytes", "{0}".format(pool_capacity / 4)) + "max_bytes", "{0}".format(pool_capacity // 4)) # schedule a clone self._fs_cmd("subvolume", "snapshot", "clone", self.volname, subvolume, snapshot, clone1, "--pool_layout", new_pool) -- 2.39.5