From c937693896f3250202c4aa3ec4925a47fda3bfaa Mon Sep 17 00:00:00 2001 From: oviner Date: Mon, 15 Jan 2024 19:08:50 +0200 Subject: [PATCH 1/7] GSS BZ-2120944 Test Large Omap Objects FS Meta Data Signed-off-by: oviner --- .../test_large_omap_objects_fs_meta_data.py | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py diff --git a/tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py b/tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py new file mode 100644 index 00000000000..d5fe8a7b33c --- /dev/null +++ b/tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py @@ -0,0 +1,72 @@ +import logging +import pytest + + +from ocs_ci.ocs import constants +from ocs_ci.framework.pytest_customization.marks import brown_squad +from ocs_ci.framework.testlib import ( + ManageTest, + tier2, + bugzilla, + skipif_ocs_version, + skipif_external_mode, + ignore_leftovers, +) + +log = logging.getLogger(__name__) + + +@brown_squad +@tier2 +@ignore_leftovers +@bugzilla("2120944") +@skipif_external_mode +@skipif_ocs_version("<4.12") +@pytest.mark.polarion_id("OCS-XXXX") +class TestLargeOmapObjectsFsMetaData(ManageTest): + """ + Test Large Omap Objects FS Meta Data + + """ + + @pytest.fixture(autouse=True) + def teardown(self, request): + def finalizer(): + try: + self.pod_obj.exec_cmd_on_pod("ls") + except Exception as e: + log.info(f"Exception: {e}") + + request.addfinalizer(finalizer) + + def test_large_omap_objects_fs_meta_data(self, pvc_factory, pod_factory): + """ + Test Process: + 1.Create pvc with ceph-fs storage class + 2.Create NGINX pod + + """ + pvc_obj = pvc_factory( + interface=constants.CEPHFILESYSTEM, + size="20", + ) + pod_dict_path = constants.NGINX_POD_YAML + raw_block_pv = False + log.info( + f"Created new pod sc_name={constants.CEPHFILESYSTEM} size=20Gi, " + f"access_mode={constants.ACCESS_MODE_RWX}, volume_mode={constants.VOLUME_MODE_FILESYSTEM}" + ) + self.pod_obj = pod_factory( + interface=constants.CEPHFILESYSTEM, + pvc=pvc_obj, + status=constants.STATUS_RUNNING, + pod_dict_path=pod_dict_path, + raw_block_pv=raw_block_pv, + ) + self.pod_obj.exec_cmd_on_pod( + command=""" + touch dir/file{0..11000} ; create 11000 files (> mds_bal_split_size) + mkdir dir/.snap/snap_a + rm -rf dir/file{0..11000} + """ + ) From 4b500472348bda7f157e2bb7013b74b4f4d65f0a Mon Sep 17 00:00:00 2001 From: oviner Date: Sun, 28 Jan 2024 19:40:40 +0200 Subject: [PATCH 2/7] Added bash script Signed-off-by: oviner --- .../test_large_omap_objects_fs_meta_data.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py b/tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py index d5fe8a7b33c..a4899f21d25 100644 --- a/tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py +++ b/tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py @@ -4,6 +4,7 @@ from ocs_ci.ocs import constants from ocs_ci.framework.pytest_customization.marks import brown_squad +from ocs_ci.ocs.cluster import ceph_health_check from ocs_ci.framework.testlib import ( ManageTest, tier2, @@ -32,10 +33,7 @@ class TestLargeOmapObjectsFsMetaData(ManageTest): @pytest.fixture(autouse=True) def teardown(self, request): def finalizer(): - try: - self.pod_obj.exec_cmd_on_pod("ls") - except Exception as e: - log.info(f"Exception: {e}") + ceph_health_check(tries=40, delay=30) request.addfinalizer(finalizer) @@ -44,6 +42,8 @@ def test_large_omap_objects_fs_meta_data(self, pvc_factory, pod_factory): Test Process: 1.Create pvc with ceph-fs storage class 2.Create NGINX pod + 3.Create large number of files under a directory exceeding the mds configuration mds_bal_split_size. + 4.Verify ceph status is ok """ pvc_obj = pvc_factory( @@ -63,10 +63,8 @@ def test_large_omap_objects_fs_meta_data(self, pvc_factory, pod_factory): pod_dict_path=pod_dict_path, raw_block_pv=raw_block_pv, ) - self.pod_obj.exec_cmd_on_pod( - command=""" - touch dir/file{0..11000} ; create 11000 files (> mds_bal_split_size) - mkdir dir/.snap/snap_a - rm -rf dir/file{0..11000} - """ + cmd = ( + "mkdir -p dir3/.snap; for n in {1..100}; do touch dir3/file{0..11000}; " + "mkdir -p dir3/.snap/snap_$n; rm -f dir3/file{0..11000}; done" ) + self.pod_obj.exec_sh_cmd_on_pod(command=cmd, sh="bash") From 729ee9bbd1ef5ebba2aa8c2fe70d540260817587 Mon Sep 17 00:00:00 2001 From: oviner Date: Sun, 28 Jan 2024 19:42:04 +0200 Subject: [PATCH 3/7] Added bash script Signed-off-by: oviner --- .../z_cluster/test_large_omap_objects_fs_meta_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py b/tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py index a4899f21d25..49011357850 100644 --- a/tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py +++ b/tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py @@ -33,7 +33,7 @@ class TestLargeOmapObjectsFsMetaData(ManageTest): @pytest.fixture(autouse=True) def teardown(self, request): def finalizer(): - ceph_health_check(tries=40, delay=30) + ceph_health_check(tries=10, delay=30) request.addfinalizer(finalizer) From 1d1cbfd5c59f1920b8105d3903d2867189513591 Mon Sep 17 00:00:00 2001 From: oviner Date: Tue, 6 Feb 2024 15:30:21 +0200 Subject: [PATCH 4/7] fix code Signed-off-by: oviner --- .../z_cluster/test_large_omap_objects_fs_meta_data.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py b/tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py index 49011357850..db2717ef3dc 100644 --- a/tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py +++ b/tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py @@ -10,8 +10,6 @@ tier2, bugzilla, skipif_ocs_version, - skipif_external_mode, - ignore_leftovers, ) log = logging.getLogger(__name__) @@ -19,11 +17,9 @@ @brown_squad @tier2 -@ignore_leftovers @bugzilla("2120944") -@skipif_external_mode @skipif_ocs_version("<4.12") -@pytest.mark.polarion_id("OCS-XXXX") +@pytest.mark.polarion_id("OCS-5425") class TestLargeOmapObjectsFsMetaData(ManageTest): """ Test Large Omap Objects FS Meta Data @@ -64,7 +60,7 @@ def test_large_omap_objects_fs_meta_data(self, pvc_factory, pod_factory): raw_block_pv=raw_block_pv, ) cmd = ( - "mkdir -p dir3/.snap; for n in {1..100}; do touch dir3/file{0..11000}; " - "mkdir -p dir3/.snap/snap_$n; rm -f dir3/file{0..11000}; done" + "mkdir -p /var/lib/www/html/dir3/.snap; for n in {1..100}; do touch /var/lib/www/html/dir3/file{0..11000}; " + "mkdir -p /var/lib/www/html/dir3/.snap/snap_$n; rm -f /var/lib/www/html/dir3/file{0..11000}; done" ) self.pod_obj.exec_sh_cmd_on_pod(command=cmd, sh="bash") From be8fc0c6d7c565402185a8e0b997ed23a93c51c3 Mon Sep 17 00:00:00 2001 From: oviner Date: Sun, 25 Feb 2024 13:37:15 +0200 Subject: [PATCH 5/7] Added log for script explaination Signed-off-by: oviner --- .../z_cluster/test_large_omap_objects_fs_meta_data.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py b/tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py index db2717ef3dc..727af2ef2f5 100644 --- a/tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py +++ b/tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py @@ -59,6 +59,9 @@ def test_large_omap_objects_fs_meta_data(self, pvc_factory, pod_factory): pod_dict_path=pod_dict_path, raw_block_pv=raw_block_pv, ) + log.info( + "Create large number of files under a directory exceeding the mds configuration mds_bal_split_size." + ) cmd = ( "mkdir -p /var/lib/www/html/dir3/.snap; for n in {1..100}; do touch /var/lib/www/html/dir3/file{0..11000}; " "mkdir -p /var/lib/www/html/dir3/.snap/snap_$n; rm -f /var/lib/www/html/dir3/file{0..11000}; done" From 160791cfd715ac2d104687237a4088f7ed5c41d3 Mon Sep 17 00:00:00 2001 From: oviner Date: Mon, 26 Feb 2024 18:37:36 +0200 Subject: [PATCH 6/7] change timeout Signed-off-by: oviner --- .../z_cluster/test_large_omap_objects_fs_meta_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py b/tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py index 727af2ef2f5..768799ecc79 100644 --- a/tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py +++ b/tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py @@ -66,4 +66,4 @@ def test_large_omap_objects_fs_meta_data(self, pvc_factory, pod_factory): "mkdir -p /var/lib/www/html/dir3/.snap; for n in {1..100}; do touch /var/lib/www/html/dir3/file{0..11000}; " "mkdir -p /var/lib/www/html/dir3/.snap/snap_$n; rm -f /var/lib/www/html/dir3/file{0..11000}; done" ) - self.pod_obj.exec_sh_cmd_on_pod(command=cmd, sh="bash") + self.pod_obj.exec_sh_cmd_on_pod(command=cmd, sh="bash", timeout=20000) From f5c09ce1ecf5f1f80f64dd1aa971f6d1ae9df80b Mon Sep 17 00:00:00 2001 From: oviner Date: Thu, 7 Mar 2024 10:32:31 +0200 Subject: [PATCH 7/7] change timeout Signed-off-by: oviner --- .../z_cluster/test_large_omap_objects_fs_meta_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py b/tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py index 768799ecc79..ae1ae5268b7 100644 --- a/tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py +++ b/tests/functional/z_cluster/test_large_omap_objects_fs_meta_data.py @@ -66,4 +66,4 @@ def test_large_omap_objects_fs_meta_data(self, pvc_factory, pod_factory): "mkdir -p /var/lib/www/html/dir3/.snap; for n in {1..100}; do touch /var/lib/www/html/dir3/file{0..11000}; " "mkdir -p /var/lib/www/html/dir3/.snap/snap_$n; rm -f /var/lib/www/html/dir3/file{0..11000}; done" ) - self.pod_obj.exec_sh_cmd_on_pod(command=cmd, sh="bash", timeout=20000) + self.pod_obj.exec_sh_cmd_on_pod(command=cmd, sh="bash", timeout=2000)