ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jonathanhur...@apache.org
Subject [04/27] git commit: AMBARI-7304 Python TestExecuteHadoopResource test failures (dsen)
Date Tue, 16 Sep 2014 12:50:44 GMT
AMBARI-7304 Python TestExecuteHadoopResource test failures (dsen)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/258f4541
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/258f4541
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/258f4541

Branch: refs/heads/branch-alerts-dev
Commit: 258f454191ad88c0f2ade1c40fb233e0b09b4ebf
Parents: ae0b1f3
Author: Dmytro Sen <dsen@hortonworks.com>
Authored: Mon Sep 15 14:28:33 2014 +0300
Committer: Dmytro Sen <dsen@hortonworks.com>
Committed: Mon Sep 15 14:32:00 2014 +0300

----------------------------------------------------------------------
 .../TestExecuteHadoopResource.py                | 37 ++++++++++++++++----
 1 file changed, 31 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/258f4541/ambari-agent/src/test/python/resource_management/TestExecuteHadoopResource.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/resource_management/TestExecuteHadoopResource.py
b/ambari-agent/src/test/python/resource_management/TestExecuteHadoopResource.py
index e357390..28453a5 100644
--- a/ambari-agent/src/test/python/resource_management/TestExecuteHadoopResource.py
+++ b/ambari-agent/src/test/python/resource_management/TestExecuteHadoopResource.py
@@ -15,6 +15,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 '''
+import os
 
 from unittest import TestCase
 from mock.mock import patch
@@ -38,7 +39,11 @@ class TestExecuteHadoopResource(TestCase):
       self.assertEqual(execute_mock.call_count, 1)
       self.assertEqual(execute_mock.call_args[0][0].command,'hadoop --config conf_dir command')
       self.assertEqual(execute_mock.call_args[0][0].arguments,
-                       {'logoutput': True, 'tries': 1, 'user': 'user', 'try_sleep': 0})
+                       {'logoutput': True,
+                        'tries': 1,
+                        'user': 'user',
+                        'try_sleep': 0,
+                        'environment': {'PATH': os.environ['PATH']}})
 
 
   @patch("resource_management.core.providers.system.ExecuteProvider")
@@ -58,7 +63,11 @@ class TestExecuteHadoopResource(TestCase):
       self.assertEqual(execute_mock.call_count, 1)
       self.assertEqual(execute_mock.call_args[0][0].command,'hadoop --config conf_dir command')
       self.assertEqual(execute_mock.call_args[0][0].arguments,
-                       {'logoutput': False, 'tries': 1, 'user': 'user', 'try_sleep': 0})
+                       {'logoutput': False,
+                        'tries': 1,
+                        'user': 'user',
+                        'try_sleep': 0,
+                        'environment': {'PATH': os.environ['PATH']}})
 
 
   @patch("resource_management.core.providers.system.ExecuteProvider")
@@ -83,7 +92,11 @@ class TestExecuteHadoopResource(TestCase):
       self.assertEqual(execute_mock.call_count, 1)
       self.assertEqual(execute_mock.call_args[0][0].command,'hadoop --config conf_dir command')
       self.assertEqual(execute_mock.call_args[0][0].arguments,
-                       {'logoutput': True, 'tries': 2, 'user': 'user', 'try_sleep': 2})
+                       {'logoutput': True,
+                        'tries': 2,
+                        'user': 'user',
+                        'try_sleep': 2,
+                        'environment': {'PATH': os.environ['PATH']}})
 
 
   @patch("resource_management.core.providers.system.ExecuteProvider")
@@ -105,9 +118,17 @@ class TestExecuteHadoopResource(TestCase):
       self.assertEqual(execute_mock.call_args_list[1][0][0].command,
                        'hadoop --config conf_dir command2')
       self.assertEqual(execute_mock.call_args_list[0][0][0].arguments,
-                       {'logoutput': False, 'tries': 1, 'user': 'user', 'try_sleep': 0})
+                       {'logoutput': False,
+                        'tries': 1,
+                        'user': 'user',
+                        'try_sleep': 0,
+                        'environment': {'PATH': os.environ['PATH']}})
       self.assertEqual(execute_mock.call_args_list[1][0][0].arguments,
-                       {'logoutput': False, 'tries': 1, 'user': 'user', 'try_sleep': 0})
+                       {'logoutput': False,
+                        'tries': 1,
+                        'user': 'user',
+                        'try_sleep': 0,
+                        'environment': {'PATH': os.environ['PATH']}})
 
 
   @patch("resource_management.core.providers.system.ExecuteProvider")
@@ -156,7 +177,11 @@ class TestExecuteHadoopResource(TestCase):
       self.assertEqual(execute_mock.call_args_list[1][0][0].command,
                        'hadoop --config conf_dir command')
       self.assertEqual(execute_mock.call_args_list[1][0][0].arguments,
-                       {'logoutput': True, 'tries': 1, 'user': 'user', 'try_sleep': 0})
+                       {'logoutput': True,
+                        'tries': 1,
+                        'user': 'user',
+                        'try_sleep': 0,
+                        'environment': {'PATH': os.environ['PATH']}})
 
 
   @patch("resource_management.core.providers.system.ExecuteProvider")


Mime
View raw message