]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: set "shell" to False for run_ceph_w() 38443/head
authorRishabh Dave <ridave@redhat.com>
Mon, 7 Dec 2020 16:33:31 +0000 (22:03 +0530)
committerRishabh Dave <ridave@redhat.com>
Fri, 12 Mar 2021 03:33:13 +0000 (09:03 +0530)
Setting shell to True in call to run() in LocalCephManager.run_ceph_w()
leads to a crash when self.subproc.communicate() is executed for the
process created by running "ceph -w".

Signed-off-by: Rishabh Dave <ridave@redhat.com>
qa/tasks/ceph_manager.py
qa/tasks/ceph_test_case.py
qa/tasks/vstart_runner.py

index fbdf0da8e887ee5dd4fc6810734c5845857d8701..0f925241d80bfee34059d0621854ff8dba2ffd74 100644 (file)
@@ -1436,7 +1436,14 @@ class CephManager:
         kwargs['check_status'] = False
         return self.run_cluster_cmd(**kwargs).exitstatus
 
-    def run_ceph_w(self, watch_channel=None):
+    # XXX: Setting "shell" to True for LocalCephManager.run_ceph_w(), doesn't
+    # work with vstart_runner.py; see https://tracker.ceph.com/issues/49644.
+    # shell=False as default parameter is just to maintain compatibility
+    # between interfaces of CephManager.run_ceph_w() and
+    # LocalCephManager.run_ceph_w(). This doesn't affect how "ceph -w" process
+    # is launched by this method since this parameters remains unused in
+    # this method.
+    def run_ceph_w(self, watch_channel=None, shell=False):
         """
         Execute "ceph -w" in the background with stdout connected to a BytesIO,
         and return the RemoteProcess.
index 23cf4839f63f4ef6cb20a1c9c041a2ad5ed6cceb..58e78a1452ca01ab247fdfe2b43192e7048ef92c 100644 (file)
@@ -106,7 +106,10 @@ class CephTestCase(unittest.TestCase):
                 return found
 
             def __enter__(self):
-                self.watcher_process = ceph_manager.run_ceph_w(watch_channel)
+                # XXX: For reason behind setting "shell" to False, see
+                # https://tracker.ceph.com/issues/49644.
+                self.watcher_process = ceph_manager.run_ceph_w(watch_channel,
+                                                               shell=False)
 
             def __exit__(self, exc_type, exc_val, exc_tb):
                 if not self.watcher_process.finished:
index f0bc0b8a50d6c7d06a76004ec951348bffb1b9dd..d62dc41c98637579d74e4eabc76ce09a998eb222 100644 (file)
@@ -964,7 +964,9 @@ class LocalCephManager(CephManager):
         """
         return LocalRemote()
 
-    def run_ceph_w(self, watch_channel=None):
+    # XXX: For reason behind setting "shell" to False, see
+    # https://tracker.ceph.com/issues/49644.
+    def run_ceph_w(self, watch_channel=None, shell=False):
         """
         :param watch_channel: Specifies the channel to be watched.
                               This can be 'cluster', 'audit', ...
@@ -974,7 +976,8 @@ class LocalCephManager(CephManager):
         if watch_channel is not None:
             args.append("--watch-channel")
             args.append(watch_channel)
-        proc = self.controller.run(args=args, wait=False, stdout=StringIO())
+        proc = self.controller.run(args=args, wait=False, stdout=StringIO(),
+                                   shell=shell)
         return proc
 
     def run_cluster_cmd(self, **kwargs):