ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jonathanhur...@apache.org
Subject [03/37] git commit: AMBARI-7453. Check HDFS failed on 1.3 stack cluster (aonishuk)
Date Wed, 24 Sep 2014 20:53:02 GMT
AMBARI-7453. Check HDFS failed on 1.3 stack cluster (aonishuk)


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

Branch: refs/heads/branch-alerts-dev
Commit: d29c34ae2e6156dfa21a7f3cbfca74f663b4bb57
Parents: 3715605
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Tue Sep 23 20:04:56 2014 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Tue Sep 23 20:04:56 2014 +0300

----------------------------------------------------------------------
 .../libraries/resources/execute_hadoop.py       |  2 +-
 .../stacks/1.3.2/HDFS/test_service_check.py     | 75 +++++++++-----------
 2 files changed, 33 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d29c34ae/ambari-common/src/main/python/resource_management/libraries/resources/execute_hadoop.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/resources/execute_hadoop.py
b/ambari-common/src/main/python/resource_management/libraries/resources/execute_hadoop.py
index 149548d..ca66ce4 100644
--- a/ambari-common/src/main/python/resource_management/libraries/resources/execute_hadoop.py
+++ b/ambari-common/src/main/python/resource_management/libraries/resources/execute_hadoop.py
@@ -32,7 +32,7 @@ class ExecuteHadoop(Resource):
   user = ResourceArgument()
   logoutput = BooleanArgument(default=False)
   principal = ResourceArgument(default=lambda obj: obj.user)
-  bin_dir = ResourceArgument() # appended to $PATH
+  bin_dir = ResourceArgument(default=[]) # appended to $PATH
   
   conf_dir = ResourceArgument()
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/d29c34ae/ambari-server/src/test/python/stacks/1.3.2/HDFS/test_service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/1.3.2/HDFS/test_service_check.py b/ambari-server/src/test/python/stacks/1.3.2/HDFS/test_service_check.py
index b6a6e67..7c089a5 100644
--- a/ambari-server/src/test/python/stacks/1.3.2/HDFS/test_service_check.py
+++ b/ambari-server/src/test/python/stacks/1.3.2/HDFS/test_service_check.py
@@ -25,7 +25,7 @@ from stacks.utils.RMFTestCase import *
 @patch.object(resource_management.libraries.functions, "get_unique_id_and_date", new = MagicMock(return_value=''))
 class TestServiceCheck(RMFTestCase):
   def test_service_check_default(self):
-    self.executeScript("2.0.6/services/HDFS/package/scripts/service_check.py",
+    self.executeScript("1.3.2/services/HDFS/package/scripts/service_check.py",
                         classname="HdfsServiceCheck",
                         command="service_check",
                         config_file="default.json"
@@ -35,54 +35,43 @@ class TestServiceCheck(RMFTestCase):
     self.assertNoMoreResources()
     
   def test_service_check_secured(self):
-    self.executeScript("2.0.6/services/HDFS/package/scripts/service_check.py",
+    self.executeScript("1.3.2/services/HDFS/package/scripts/service_check.py",
                         classname="HdfsServiceCheck",
                         command="service_check",
-                        config_file="default.json"
+                        config_file="secured.json"
     )
-    
+    self.assertResourceCalled('Execute', "su - ambari-qa -c '/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab
ambari-qa'",)
     self.assert_service_check()
     self.assertNoMoreResources()
         
   def assert_service_check(self):
     self.assertResourceCalled('ExecuteHadoop', 'dfsadmin -safemode get | grep OFF',
-        logoutput = True,
-        tries = 20,
-        conf_dir = '/etc/hadoop/conf',
-        try_sleep = 3,
-        bin_dir = '/usr/bin',
-        user = 'ambari-qa',
-    )
-    self.assertResourceCalled('ExecuteHadoop', 'fs -mkdir /tmp',
-        conf_dir = '/etc/hadoop/conf',
-        bin_dir = '/usr/bin',
-        logoutput = True,
-        not_if = 'su - ambari-qa -c \'/usr/bin/hadoop --config /etc/hadoop/conf fs -test
-e /tmp\'',
-        try_sleep = 3,
-        tries = 5,
-        user = 'ambari-qa',
-    )
-    self.assertResourceCalled('ExecuteHadoop', 'fs -chmod 777 /tmp',
-        conf_dir = '/etc/hadoop/conf',
-        bin_dir = '/usr/bin',
-        logoutput = True,
-        try_sleep = 3,
-        tries = 5,
-        user = 'ambari-qa',
-    )
-    self.assertResourceCalled('ExecuteHadoop', 'fs -rm /tmp/; hadoop --config /etc/hadoop/conf
fs -put /etc/passwd /tmp/',
-        logoutput = True,
-        bin_dir = '/usr/bin',
-        tries = 5,
-        conf_dir = '/etc/hadoop/conf',
-        try_sleep = 3,
-        user = 'ambari-qa',
-    )
+                              logoutput = True,
+                              tries = 20,
+                              conf_dir = '/etc/hadoop/conf',
+                              try_sleep = 15,
+                              user = 'ambari-qa',
+                              )
+    self.assertResourceCalled('ExecuteHadoop', 'fs -mkdir /tmp ; hadoop fs -chmod 777 /tmp',
+                              conf_dir = '/etc/hadoop/conf',
+                              logoutput = True,
+                              not_if = "su - ambari-qa -c 'hadoop fs -test -e /tmp'",
+                              try_sleep = 3,
+                              tries = 5,
+                              user = 'ambari-qa',
+                              )
+    self.assertResourceCalled('ExecuteHadoop', 'fs -rm /tmp/; hadoop fs -put /etc/passwd
/tmp/',
+                              logoutput = True,
+                              tries = 5,
+                              conf_dir = '/etc/hadoop/conf',
+                              try_sleep = 3,
+                              user = 'ambari-qa',
+                              )
     self.assertResourceCalled('ExecuteHadoop', 'fs -test -e /tmp/',
-        logoutput = True,
-        tries = 5,
-        bin_dir = '/usr/bin',
-        conf_dir = '/etc/hadoop/conf',
-        try_sleep = 3,
-        user = 'ambari-qa',
-    )
+                              logoutput = True,
+                              tries = 5,
+                              conf_dir = '/etc/hadoop/conf',
+                              try_sleep = 3,
+                              user = 'ambari-qa',
+                              )
+    self.assertNoMoreResources()
\ No newline at end of file


Mime
View raw message