Selaa lähdekoodia

AMBARI-20776 test_kill_process_with_children and test_facterMemInfoOutput test fails (dsen)

Dmytro Sen 8 vuotta sitten
vanhempi
commit
eb154aaa77

+ 3 - 1
ambari-agent/src/test/python/ambari_agent/TestHardware.py

@@ -226,8 +226,10 @@ class TestHardware(TestCase):
   @patch.object(FacterLinux, "setMemInfoOutput")
   @patch.object(OSCheck, "get_os_type")
   @patch.object(OSCheck, "get_os_version")
-  def test_facterMemInfoOutput(self, get_os_version_mock, get_os_type_mock, facter_setMemInfoOutput_mock):
+  @patch.object(FacterLinux, "getSystemResourceOverrides")
+  def test_facterMemInfoOutput(self, getSystemResourceOverridesMock, get_os_version_mock, get_os_type_mock, facter_setMemInfoOutput_mock):
 
+    getSystemResourceOverridesMock.return_value = {}
     facter_setMemInfoOutput_mock.return_value = '''
 MemTotal:        1832392 kB
 MemFree:          868648 kB

+ 1 - 1
ambari-agent/src/test/python/ambari_agent/TestShell.py

@@ -65,7 +65,7 @@ class TestShell(unittest.TestCase):
       test_process = subprocess.Popen(test_cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE, shell=True)
       time.sleep(0.3) # Delay to allow subprocess to start
       # Check if processes are running
-      ps_cmd = """ps aux """
+      ps_cmd = """ps auxww """
       ps_process = subprocess.Popen(ps_cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE, shell=True)
       (out, err) = ps_process.communicate()
       self.assertTrue(sleep_cmd in out)