Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DB656117DC for ; Wed, 18 Jun 2014 15:49:51 +0000 (UTC) Received: (qmail 49863 invoked by uid 500); 18 Jun 2014 15:49:51 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 49834 invoked by uid 500); 18 Jun 2014 15:49:51 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 49823 invoked by uid 99); 18 Jun 2014 15:49:51 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Jun 2014 15:49:51 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 778CA83BC53; Wed, 18 Jun 2014 15:49:51 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aonishuk@apache.org To: commits@ambari.apache.org Message-Id: <6d180e45c382475699371732f878b680@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: AMBARI-6185. Secure cluster: JCE policy files not distributed on non-client hosts. (aonishuk) Date: Wed, 18 Jun 2014 15:49:51 +0000 (UTC) Repository: ambari Updated Branches: refs/heads/trunk 8c73f08cf -> d228ca90b AMBARI-6185. Secure cluster: JCE policy files not distributed on non-client hosts. (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d228ca90 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d228ca90 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d228ca90 Branch: refs/heads/trunk Commit: d228ca90b6664a26b3df22a206179200cd0a1050 Parents: 8c73f08 Author: Andrew Onishuk Authored: Wed Jun 18 18:48:46 2014 +0300 Committer: Andrew Onishuk Committed: Wed Jun 18 18:49:42 2014 +0300 ---------------------------------------------------------------------- .../hooks/before-INSTALL/test_before_install.py | 22 +-------------- .../hooks/before-START/test_before_start.py | 28 ++++++++++++++++++++ .../hooks/before-INSTALL/test_before_install.py | 18 ------------- .../hooks/before-START/test_before_start.py | 28 ++++++++++++++++++++ 4 files changed, 57 insertions(+), 39 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/d228ca90/ambari-server/src/test/python/stacks/1.3.2/hooks/before-INSTALL/test_before_install.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/1.3.2/hooks/before-INSTALL/test_before_install.py b/ambari-server/src/test/python/stacks/1.3.2/hooks/before-INSTALL/test_before_install.py index 58084d0..90c284e 100644 --- a/ambari-server/src/test/python/stacks/1.3.2/hooks/before-INSTALL/test_before_install.py +++ b/ambari-server/src/test/python/stacks/1.3.2/hooks/before-INSTALL/test_before_install.py @@ -45,12 +45,6 @@ class TestHookBeforeInstall(RMFTestCase): not_if = 'test -e /usr/jdk64/jdk1.7.0_45/bin/java', path = ['/bin', '/usr/bin/'], ) - self.assertResourceCalled('Execute', 'mkdir -p /tmp/HDP-artifacts/; curl -kf --retry 10 http://c6401.ambari.apache.org:8080/resources//UnlimitedJCEPolicyJDK7.zip -o /tmp/HDP-artifacts//UnlimitedJCEPolicyJDK7.zip', - not_if = 'test -e /tmp/HDP-artifacts//UnlimitedJCEPolicyJDK7.zip', - ignore_failures = True, - path = ['/bin', '/usr/bin/'], - environment = {'no_proxy': 'c6401.ambari.apache.org'} - ) self.assertResourceCalled('Group', 'hadoop', ignore_failures = False, ) @@ -138,18 +132,4 @@ class TestHookBeforeInstall(RMFTestCase): ignore_failures = False, ) self.assertResourceCalled('Package', 'unzip',) - self.assertNoMoreResources() - - - def test_that_jce_is_required_in_secured_cluster(self): - try: - self.executeScript("1.3.2/hooks/before-INSTALL/scripts/hook.py", - classname="BeforeConfigureHook", - command="hook", - config_file="secured_no_jce_name.json" - ) - self.fail("Should throw an exception") - except Fail: - pass # Expected - - + self.assertNoMoreResources() \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/d228ca90/ambari-server/src/test/python/stacks/1.3.2/hooks/before-START/test_before_start.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/1.3.2/hooks/before-START/test_before_start.py b/ambari-server/src/test/python/stacks/1.3.2/hooks/before-START/test_before_start.py index fc906b1..d4544f2 100644 --- a/ambari-server/src/test/python/stacks/1.3.2/hooks/before-START/test_before_start.py +++ b/ambari-server/src/test/python/stacks/1.3.2/hooks/before-START/test_before_start.py @@ -81,6 +81,12 @@ class TestHookBeforeStart(RMFTestCase): owner = 'hdfs', group = 'hadoop', ) + self.assertResourceCalled('Execute', 'mkdir -p /tmp/HDP-artifacts/; curl -kf --retry 10 http://c6401.ambari.apache.org:8080/resources//UnlimitedJCEPolicyJDK7.zip -o /tmp/HDP-artifacts//UnlimitedJCEPolicyJDK7.zip', + environment = {"no_proxy": "c6401.ambari.apache.org"}, + not_if = 'test -e /tmp/HDP-artifacts//UnlimitedJCEPolicyJDK7.zip', + ignore_failures = True, + path = ['/bin', '/usr/bin/'], + ) self.assertNoMoreResources() def test_hook_secured(self, mockHook): @@ -135,4 +141,26 @@ class TestHookBeforeStart(RMFTestCase): owner = 'hdfs', group = 'hadoop', ) + self.assertResourceCalled('Execute', 'mkdir -p /tmp/HDP-artifacts/; curl -kf --retry 10 http://c6401.ambari.apache.org:8080/resources//UnlimitedJCEPolicyJDK7.zip -o /tmp/HDP-artifacts//UnlimitedJCEPolicyJDK7.zip', + environment = {"no_proxy": "c6401.ambari.apache.org"}, + not_if = 'test -e /tmp/HDP-artifacts//UnlimitedJCEPolicyJDK7.zip', + ignore_failures = True, + path = ['/bin', '/usr/bin/'], + ) + self.assertResourceCalled('Execute', 'rm -f local_policy.jar; rm -f US_export_policy.jar; unzip -o -j -q /tmp/HDP-artifacts//UnlimitedJCEPolicyJDK7.zip', + path = ['/bin/', '/usr/bin'], + only_if = 'test -e /usr/jdk64/jdk1.7.0_45/jre/lib/security && test -f /tmp/HDP-artifacts//UnlimitedJCEPolicyJDK7.zip', + cwd = '/usr/jdk64/jdk1.7.0_45/jre/lib/security', + ) self.assertNoMoreResources() + +def test_that_jce_is_required_in_secured_cluster(self): + try: + self.executeScript("2.0.6/hooks/before-START/scripts/hook.py", + classname="BeforeStartHook", + command="hook", + config_file="secured_no_jce_name.json" + ) + self.fail("Should throw an exception") + except Fail: + pass # Expected http://git-wip-us.apache.org/repos/asf/ambari/blob/d228ca90/ambari-server/src/test/python/stacks/2.0.6/hooks/before-INSTALL/test_before_install.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/hooks/before-INSTALL/test_before_install.py b/ambari-server/src/test/python/stacks/2.0.6/hooks/before-INSTALL/test_before_install.py index 92eed49..93cb012 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/hooks/before-INSTALL/test_before_install.py +++ b/ambari-server/src/test/python/stacks/2.0.6/hooks/before-INSTALL/test_before_install.py @@ -47,12 +47,6 @@ class TestHookBeforeInstall(RMFTestCase): not_if = 'test -e /usr/jdk64/jdk1.7.0_45/bin/java', path = ['/bin', '/usr/bin/'], ) - self.assertResourceCalled('Execute', 'mkdir -p /tmp/HDP-artifacts/; curl -kf --retry 10 http://c6401.ambari.apache.org:8080/resources//UnlimitedJCEPolicyJDK7.zip -o /tmp/HDP-artifacts//UnlimitedJCEPolicyJDK7.zip', - not_if = 'test -e /tmp/HDP-artifacts//UnlimitedJCEPolicyJDK7.zip', - ignore_failures = True, - path = ['/bin', '/usr/bin/'], - environment = {'no_proxy': 'c6401.ambari.apache.org'}, - ) self.assertResourceCalled('Group', 'hadoop', ignore_failures = False, ) @@ -159,15 +153,3 @@ class TestHookBeforeInstall(RMFTestCase): groups = ['users'], ) self.assertNoMoreResources() - - - def test_that_jce_is_required_in_secured_cluster(self): - try: - self.executeScript("2.0.6/hooks/before-INSTALL/scripts/hook.py", - classname="BeforeConfigureHook", - command="hook", - config_file="secured_no_jce_name.json" - ) - self.fail("Should throw an exception") - except Fail: - pass # Expected http://git-wip-us.apache.org/repos/asf/ambari/blob/d228ca90/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py b/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py index 9274fd5..4cb3ffd 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py +++ b/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py @@ -83,6 +83,12 @@ class TestHookBeforeStart(RMFTestCase): owner = 'hdfs', group = 'hadoop', ) + self.assertResourceCalled('Execute', 'mkdir -p /tmp/HDP-artifacts/; curl -kf --retry 10 http://c6401.ambari.apache.org:8080/resources//UnlimitedJCEPolicyJDK7.zip -o /tmp/HDP-artifacts//UnlimitedJCEPolicyJDK7.zip', + environment = {"no_proxy": "c6401.ambari.apache.org"}, + not_if = 'test -e /tmp/HDP-artifacts//UnlimitedJCEPolicyJDK7.zip', + ignore_failures = True, + path = ['/bin', '/usr/bin/'], + ) self.assertNoMoreResources() def test_hook_secured(self): @@ -143,4 +149,26 @@ class TestHookBeforeStart(RMFTestCase): owner = 'hdfs', group = 'hadoop', ) + self.assertResourceCalled('Execute', 'mkdir -p /tmp/HDP-artifacts/; curl -kf --retry 10 http://c6401.ambari.apache.org:8080/resources//UnlimitedJCEPolicyJDK7.zip -o /tmp/HDP-artifacts//UnlimitedJCEPolicyJDK7.zip', + environment = {"no_proxy": "c6401.ambari.apache.org"}, + not_if = 'test -e /tmp/HDP-artifacts//UnlimitedJCEPolicyJDK7.zip', + ignore_failures = True, + path = ['/bin', '/usr/bin/'], + ) + self.assertResourceCalled('Execute', 'rm -f local_policy.jar; rm -f US_export_policy.jar; unzip -o -j -q /tmp/HDP-artifacts//UnlimitedJCEPolicyJDK7.zip', + path = ['/bin/', '/usr/bin'], + only_if = 'test -e /usr/jdk64/jdk1.7.0_45/jre/lib/security && test -f /tmp/HDP-artifacts//UnlimitedJCEPolicyJDK7.zip', + cwd = '/usr/jdk64/jdk1.7.0_45/jre/lib/security', + ) self.assertNoMoreResources() + +def test_that_jce_is_required_in_secured_cluster(self): + try: + self.executeScript("2.0.6/hooks/before-START/scripts/hook.py", + classname="BeforeStartHook", + command="hook", + config_file="secured_no_jce_name.json" + ) + self.fail("Should throw an exception") + except Fail: + pass # Expected