]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: add test to validate periodic checks by async threads 52892/head
authorVenky Shankar <vshankar@redhat.com>
Wed, 23 Aug 2023 10:27:21 +0000 (06:27 -0400)
committerVenky Shankar <vshankar@redhat.com>
Mon, 28 Aug 2023 06:17:35 +0000 (02:17 -0400)
Signed-off-by: Venky Shankar <vshankar@redhat.com>
qa/tasks/cephfs/test_volumes.py

index 1213f5ef03a189280cb29cef49592f870661fa2a..a360f9fa4b4c3c649b8854393e314306b205135a 100644 (file)
@@ -7366,6 +7366,29 @@ class TestSubvolumeSnapshotClones(TestVolumesHelper):
         max_concurrent_clones = int(self.config_get('mgr', 'mgr/volumes/max_concurrent_clones'))
         self.assertEqual(max_concurrent_clones, 2)
 
+    def test_periodic_async_work(self):
+        """
+        to validate that the async thread (purge thread in this case) will
+        process a job that's manually created.
+        """
+
+        self.config_set('mgr', 'mgr/volumes/periodic_async_work', True)
+
+        trashdir = os.path.join("./", "volumes", "_deleting")
+        entry = os.path.join(trashdir, "subvol")
+        # hand create the directory
+        self.mount_a.run_shell(['sudo', 'mkdir', '-p', entry], omit_sudo=False)
+
+        # verify trash dir is processed
+        self._wait_for_trash_empty()
+
+        self.config_set('mgr', 'mgr/volumes/periodic_async_work', False)
+
+        # wait a bit so that the default wakeup time (5s) is consumed
+        # by the async threads (i.e., the default gets honoured before
+        # the file system gets purged).
+        time.sleep(10)
+
     def test_subvolume_under_group_snapshot_clone(self):
         subvolume = self._generate_random_subvolume_name()
         group = self._generate_random_group_name()