Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C7F42200AC8 for ; Tue, 7 Jun 2016 22:06:06 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C65FD160A36; Tue, 7 Jun 2016 20:06:06 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7309D160968 for ; Tue, 7 Jun 2016 22:06:05 +0200 (CEST) Received: (qmail 18535 invoked by uid 500); 7 Jun 2016 20:06:04 -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 18525 invoked by uid 99); 7 Jun 2016 20:06:04 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Jun 2016 20:06:04 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 77821DFFAB; Tue, 7 Jun 2016 20:06:04 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tbeerbower@apache.org To: commits@ambari.apache.org Message-Id: <28e1d4e9383548a9b4353d07610edcfd@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-17098 - Atlas Integration : Ambari overwrites users-credentials.properties and policy-store.txt Date: Tue, 7 Jun 2016 20:06:04 +0000 (UTC) archived-at: Tue, 07 Jun 2016 20:06:07 -0000 Repository: ambari Updated Branches: refs/heads/branch-2.4 8eddba90e -> 5666d2523 AMBARI-17098 - Atlas Integration : Ambari overwrites users-credentials.properties and policy-store.txt Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/5666d252 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/5666d252 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/5666d252 Branch: refs/heads/branch-2.4 Commit: 5666d2523dbbbb27184c35ed086114418df2262c Parents: 8eddba9 Author: tbeerbower Authored: Tue Jun 7 16:04:54 2016 -0400 Committer: tbeerbower Committed: Tue Jun 7 16:06:15 2016 -0400 ---------------------------------------------------------------------- .../0.1.0.2.3/package/files/policy-store.txt | 26 -- .../package/files/users-credentials.properties | 22 -- .../ATLAS/0.1.0.2.3/package/scripts/metadata.py | 14 - .../ATLAS/0.1.0.2.3/package/scripts/params.py | 3 - .../configuration/application-properties.xml | 4 +- .../BlueprintConfigurationProcessorTest.java | 326 +++++++++++++++++++ .../stacks/2.3/ATLAS/test_metadata_server.py | 12 - .../stacks/2.5/ATLAS/test_atlas_server.py | 12 - 8 files changed, 328 insertions(+), 91 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/5666d252/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/files/policy-store.txt ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/files/policy-store.txt b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/files/policy-store.txt deleted file mode 100644 index 4b3b126..0000000 --- a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/files/policy-store.txt +++ /dev/null @@ -1,26 +0,0 @@ -## -## Licensed to the Apache Software Foundation (ASF) under one -## or more contributor license agreements. See the NOTICE file -## distributed with this work for additional information -## regarding copyright ownership. The ASF licenses this file -## to you under the Apache License, Version 2.0 (the -## "License"); you may not use this file except in compliance -## with the License. You may obtain a copy of the License at -## -## http://www.apache.org/licenses/LICENSE-2.0 -## -## Unless required by applicable law or agreed to in writing, software -## distributed under the License is distributed on an "AS IS" BASIS, -## 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. -## -##Policy Format -##r-READ, w-WRITE, u-UPDATE, d-DELETE -##Policy_Name;;User_Name1:Operations_Allowed,User_Name2:Operations_Allowed;;Group_Name1:Operations_Allowed,Group_Name2:Operations_Allowed;;Resource_Type1:Resource_Name,Resource_Type2:Resource_Name -## -adminPolicy;;admin:rwud;;ROLE_ADMIN:rwud;;type:*,entity:*,operation:* -typeReadPolicy;;nixon:rw;;;;type:*,entity:* -classReadPolicy;;saqeeb:r;;;;type:*,entity:* -dataScientistPolicy;;;;DATA_SCIENTIST:r;;type:*,entity:* -dataStewardPolicy;;;;DATA_STEWARD:rwu;;type:*,entity:* http://git-wip-us.apache.org/repos/asf/ambari/blob/5666d252/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/files/users-credentials.properties ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/files/users-credentials.properties b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/files/users-credentials.properties deleted file mode 100644 index 33b326f..0000000 --- a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/files/users-credentials.properties +++ /dev/null @@ -1,22 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# 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. -# - -#username=group::sha256-password -admin=ADMIN::8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918 -michael=DATA_SCIENTIST::95bfb24de17d285d734b9eaa9109bfe922adc85f20d2e5e66a78bddb4a4ebddb -paul=DATA_STEWARD::e7c0dcf5f8a93e93791e9bac1ae454a691c1d2a902fc4256d489e96c1b9ac68c http://git-wip-us.apache.org/repos/asf/ambari/blob/5666d252/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata.py b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata.py index 5fd6523..7fae3d8 100644 --- a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata.py +++ b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata.py @@ -93,20 +93,6 @@ def metadata(type='server'): content=InlineTemplate(params.metadata_log4j_content) ) - File(format("{conf_dir}/users-credentials.properties"), - mode=0644, - owner=params.metadata_user, - group=params.user_group, - content=StaticFile('users-credentials.properties') - ) - - File(format("{conf_dir}/policy-store.txt"), - mode=0644, - owner=params.metadata_user, - group=params.user_group, - content=StaticFile('policy-store.txt') - ) - if type == 'server' and params.search_backend_solr and params.has_logsearch_solr: solr_cloud_util.setup_solr_client(params.config) http://git-wip-us.apache.org/repos/asf/ambari/blob/5666d252/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py index e227915..66c07b1 100644 --- a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py +++ b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py @@ -62,9 +62,6 @@ log_dir = config['configurations']['atlas-env']['metadata_log_dir'] conf_dir = status_params.conf_dir # "/etc/metadata/conf" conf_file = status_params.conf_file -atlas_login_credentials_file = os.path.join(conf_dir, "users-credentials.properties") -atlas_policy_store_file = os.path.join(conf_dir, "policy-store.txt") - # service locations hadoop_conf_dir = os.path.join(os.environ["HADOOP_HOME"], "conf") if 'HADOOP_HOME' in os.environ else '/etc/hadoop/conf' http://git-wip-us.apache.org/repos/asf/ambari/blob/5666d252/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/application-properties.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/application-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/application-properties.xml index 80bfd6f..2c4426b 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/application-properties.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/application-properties.xml @@ -100,14 +100,14 @@ atlas.login.credentials.file - {{atlas_login_credentials_file}} + {{conf_dir}}/users-credentials.properties File path for file based login. atlas.auth.policy.file - {{atlas_policy_store_file}} + {{conf_dir}}/policy-store.txt Path for the Atlas policy file. http://git-wip-us.apache.org/repos/asf/ambari/blob/5666d252/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java index 9ec0a09..b678a84 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java @@ -4904,6 +4904,332 @@ public class BlueprintConfigurationProcessorTest { } @Test + public void testAtlas() throws Exception { + final String expectedHostGroupName = "host_group_1"; + final String host1 = "c6401.ambari.apache.org"; + final String host2 = "c6402.ambari.apache.org"; + final String host3 = "c6403.ambari.apache.org"; + + Map> properties = new HashMap>(); + Map atlasProperties = new HashMap(); + properties.put("application-properties", atlasProperties); + + // setup properties that include host information + atlasProperties.put("atlas.kafka.bootstrap.servers", "localhost:6667"); + atlasProperties.put("atlas.kafka.zookeeper.connect", "localhost:2181"); + atlasProperties.put("atlas.graph.index.search.solr.zookeeper-url", "localhost:2181/ambari-solr"); + atlasProperties.put("atlas.graph.storage.hostname", "localhost"); + atlasProperties.put("atlas.audit.hbase.zookeeper.quorum", "localhost"); + + + Configuration clusterConfig = new Configuration(properties, Collections.>>emptyMap()); + + Collection hgComponents = new HashSet(); + hgComponents.add("KAFKA_BROKER"); + hgComponents.add("ZOOKEEPER_SERVER"); + hgComponents.add("HBASE_MASTER"); + List hosts = new ArrayList(); + hosts.add(host1); + hosts.add(host2); + hosts.add(host3); + TestHostGroup group1 = new TestHostGroup(expectedHostGroupName, hgComponents, hosts); + + Collection hostGroups = new HashSet(); + hostGroups.add(group1); + + ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); + BlueprintConfigurationProcessor updater = new BlueprintConfigurationProcessor(topology); + + // call top-level cluster config update method + updater.doUpdateForClusterCreate(); + + List hostArray = + Arrays.asList(atlasProperties.get("atlas.kafka.bootstrap.servers").split(",")); + List expected = + Arrays.asList("c6401.ambari.apache.org:6667","c6402.ambari.apache.org:6667", "c6403.ambari.apache.org:6667"); + + Assert.assertTrue(hostArray.containsAll(expected) && expected.containsAll(hostArray)); + + hostArray = Arrays.asList(atlasProperties.get("atlas.kafka.zookeeper.connect").split(",")); + expected = + Arrays.asList("c6401.ambari.apache.org:2181","c6402.ambari.apache.org:2181", "c6403.ambari.apache.org:2181"); + Assert.assertTrue(hostArray.containsAll(expected) && expected.containsAll(hostArray)); + + + hostArray = Arrays.asList(atlasProperties.get("atlas.graph.index.search.solr.zookeeper-url").split(",")); + expected = + Arrays.asList("c6401.ambari.apache.org:2181/ambari-solr","c6402.ambari.apache.org:2181/ambari-solr", "c6403.ambari.apache.org:2181/ambari-solr"); + Assert.assertTrue(hostArray.containsAll(expected) && expected.containsAll(hostArray)); + + hostArray = Arrays.asList(atlasProperties.get("atlas.graph.storage.hostname").split(",")); + expected = + Arrays.asList("c6401.ambari.apache.org","c6402.ambari.apache.org", "c6403.ambari.apache.org"); + Assert.assertTrue(hostArray.containsAll(expected) && expected.containsAll(hostArray)); + + hostArray = Arrays.asList(atlasProperties.get("atlas.audit.hbase.zookeeper.quorum").split(",")); + expected = + Arrays.asList("c6401.ambari.apache.org","c6402.ambari.apache.org", "c6403.ambari.apache.org"); + Assert.assertTrue(hostArray.containsAll(expected) && expected.containsAll(hostArray)); + } + + @Test + public void testAtlasHA() throws Exception { + final String expectedHostGroupName = "host_group_1"; + final String host1 = "c6401.ambari.apache.org"; + final String host2 = "c6402.ambari.apache.org"; + final String host3 = "c6403.ambari.apache.org"; + + Map> properties = new HashMap>(); + Map atlasProperties = new HashMap(); + properties.put("application-properties", atlasProperties); + + // setup properties that include host information + atlasProperties.put("atlas.server.ids", ""); + atlasProperties.put("atlas.server.address.id1", ""); + atlasProperties.put("atlas.server.http.port", "21000"); + atlasProperties.put("atlas.server.https.port", "21443"); + atlasProperties.put("atlas.enableTLS", "false"); + + Configuration clusterConfig = new Configuration(properties, Collections.>>emptyMap()); + + Collection hgComponents = new HashSet(); + hgComponents.add("ATLAS_SERVER"); + List hosts = new ArrayList(); + hosts.add(host1); + hosts.add(host2); + hosts.add(host3); + TestHostGroup group1 = new TestHostGroup(expectedHostGroupName, hgComponents, hosts); + + Collection hostGroups = new HashSet(); + hostGroups.add(group1); + + ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); + BlueprintConfigurationProcessor updater = new BlueprintConfigurationProcessor(topology); + + // call top-level cluster config update method + updater.doUpdateForClusterCreate(); + + assertEquals("id1,id2,id3", atlasProperties.get("atlas.server.ids")); + + List hostArray = + Arrays.asList(atlasProperties.get("atlas.server.address.id1").split("\natlas.server.address.id.=")); + List expected = + Arrays.asList("c6401.ambari.apache.org:21000","c6402.ambari.apache.org:21000", "c6403.ambari.apache.org:21000"); + + Assert.assertTrue(hostArray.containsAll(expected) && expected.containsAll(hostArray)); + } + + @Test + public void testAtlasHAEnableTLS() throws Exception { + final String expectedHostGroupName = "host_group_1"; + final String host1 = "c6401.ambari.apache.org"; + final String host2 = "c6402.ambari.apache.org"; + final String host3 = "c6403.ambari.apache.org"; + + Map> properties = new HashMap>(); + Map atlasProperties = new HashMap(); + properties.put("application-properties", atlasProperties); + + // setup properties that include host information + atlasProperties.put("atlas.server.ids", ""); + atlasProperties.put("atlas.server.address.id1", ""); + atlasProperties.put("atlas.server.http.port", "21000"); + atlasProperties.put("atlas.server.https.port", "21443"); + atlasProperties.put("atlas.enableTLS", "true"); + + Configuration clusterConfig = new Configuration(properties, Collections.>>emptyMap()); + + Collection hgComponents = new HashSet(); + hgComponents.add("ATLAS_SERVER"); + List hosts = new ArrayList(); + hosts.add(host1); + hosts.add(host2); + hosts.add(host3); + TestHostGroup group1 = new TestHostGroup(expectedHostGroupName, hgComponents, hosts); + + Collection hostGroups = new HashSet(); + hostGroups.add(group1); + + ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); + BlueprintConfigurationProcessor updater = new BlueprintConfigurationProcessor(topology); + + // call top-level cluster config update method + updater.doUpdateForClusterCreate(); + + assertEquals("id1,id2,id3", atlasProperties.get("atlas.server.ids")); + + List hostArray = + Arrays.asList(atlasProperties.get("atlas.server.address.id1").split("\natlas.server.address.id.=")); + List expected = + Arrays.asList("c6401.ambari.apache.org:21443","c6402.ambari.apache.org:21443", "c6403.ambari.apache.org:21443"); + + Assert.assertTrue(hostArray.containsAll(expected) && expected.containsAll(hostArray)); + } + + @Test + public void testAtlas() throws Exception { + final String expectedHostGroupName = "host_group_1"; + final String host1 = "c6401.ambari.apache.org"; + final String host2 = "c6402.ambari.apache.org"; + final String host3 = "c6403.ambari.apache.org"; + + Map> properties = new HashMap>(); + Map atlasProperties = new HashMap(); + properties.put("application-properties", atlasProperties); + + // setup properties that include host information + atlasProperties.put("atlas.kafka.bootstrap.servers", "localhost:6667"); + atlasProperties.put("atlas.kafka.zookeeper.connect", "localhost:2181"); + atlasProperties.put("atlas.graph.index.search.solr.zookeeper-url", "localhost:2181/ambari-solr"); + atlasProperties.put("atlas.graph.storage.hostname", "localhost"); + atlasProperties.put("atlas.audit.hbase.zookeeper.quorum", "localhost"); + + + Configuration clusterConfig = new Configuration(properties, Collections.>>emptyMap()); + + Collection hgComponents = new HashSet(); + hgComponents.add("KAFKA_BROKER"); + hgComponents.add("ZOOKEEPER_SERVER"); + hgComponents.add("HBASE_MASTER"); + List hosts = new ArrayList(); + hosts.add(host1); + hosts.add(host2); + hosts.add(host3); + TestHostGroup group1 = new TestHostGroup(expectedHostGroupName, hgComponents, hosts); + + Collection hostGroups = new HashSet(); + hostGroups.add(group1); + + ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); + BlueprintConfigurationProcessor updater = new BlueprintConfigurationProcessor(topology); + + // call top-level cluster config update method + updater.doUpdateForClusterCreate(); + + List hostArray = + Arrays.asList(atlasProperties.get("atlas.kafka.bootstrap.servers").split(",")); + List expected = + Arrays.asList("c6401.ambari.apache.org:6667","c6402.ambari.apache.org:6667", "c6403.ambari.apache.org:6667"); + + Assert.assertTrue(hostArray.containsAll(expected) && expected.containsAll(hostArray)); + + hostArray = Arrays.asList(atlasProperties.get("atlas.kafka.zookeeper.connect").split(",")); + expected = + Arrays.asList("c6401.ambari.apache.org:2181","c6402.ambari.apache.org:2181", "c6403.ambari.apache.org:2181"); + Assert.assertTrue(hostArray.containsAll(expected) && expected.containsAll(hostArray)); + + + hostArray = Arrays.asList(atlasProperties.get("atlas.graph.index.search.solr.zookeeper-url").split(",")); + expected = + Arrays.asList("c6401.ambari.apache.org:2181/ambari-solr","c6402.ambari.apache.org:2181/ambari-solr", "c6403.ambari.apache.org:2181/ambari-solr"); + Assert.assertTrue(hostArray.containsAll(expected) && expected.containsAll(hostArray)); + + hostArray = Arrays.asList(atlasProperties.get("atlas.graph.storage.hostname").split(",")); + expected = + Arrays.asList("c6401.ambari.apache.org","c6402.ambari.apache.org", "c6403.ambari.apache.org"); + Assert.assertTrue(hostArray.containsAll(expected) && expected.containsAll(hostArray)); + + hostArray = Arrays.asList(atlasProperties.get("atlas.audit.hbase.zookeeper.quorum").split(",")); + expected = + Arrays.asList("c6401.ambari.apache.org","c6402.ambari.apache.org", "c6403.ambari.apache.org"); + Assert.assertTrue(hostArray.containsAll(expected) && expected.containsAll(hostArray)); + } + + @Test + public void testAtlasHA() throws Exception { + final String expectedHostGroupName = "host_group_1"; + final String host1 = "c6401.ambari.apache.org"; + final String host2 = "c6402.ambari.apache.org"; + final String host3 = "c6403.ambari.apache.org"; + + Map> properties = new HashMap>(); + Map atlasProperties = new HashMap(); + properties.put("application-properties", atlasProperties); + + // setup properties that include host information + atlasProperties.put("atlas.server.ids", ""); + atlasProperties.put("atlas.server.address.id1", ""); + atlasProperties.put("atlas.server.http.port", "21000"); + atlasProperties.put("atlas.server.https.port", "21443"); + atlasProperties.put("atlas.enableTLS", "false"); + + Configuration clusterConfig = new Configuration(properties, Collections.>>emptyMap()); + + Collection hgComponents = new HashSet(); + hgComponents.add("ATLAS_SERVER"); + List hosts = new ArrayList(); + hosts.add(host1); + hosts.add(host2); + hosts.add(host3); + TestHostGroup group1 = new TestHostGroup(expectedHostGroupName, hgComponents, hosts); + + Collection hostGroups = new HashSet(); + hostGroups.add(group1); + + ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); + BlueprintConfigurationProcessor updater = new BlueprintConfigurationProcessor(topology); + + // call top-level cluster config update method + updater.doUpdateForClusterCreate(); + + assertEquals("id1,id2,id3", atlasProperties.get("atlas.server.ids")); + + List hostArray = + Arrays.asList(atlasProperties.get("atlas.server.address.id1").split("\natlas.server.address.id.=")); + List expected = + Arrays.asList("c6401.ambari.apache.org:21000","c6402.ambari.apache.org:21000", "c6403.ambari.apache.org:21000"); + + Assert.assertTrue(hostArray.containsAll(expected) && expected.containsAll(hostArray)); + } + + @Test + public void testAtlasHAEnableTLS() throws Exception { + final String expectedHostGroupName = "host_group_1"; + final String host1 = "c6401.ambari.apache.org"; + final String host2 = "c6402.ambari.apache.org"; + final String host3 = "c6403.ambari.apache.org"; + + Map> properties = new HashMap>(); + Map atlasProperties = new HashMap(); + properties.put("application-properties", atlasProperties); + + // setup properties that include host information + atlasProperties.put("atlas.server.ids", ""); + atlasProperties.put("atlas.server.address.id1", ""); + atlasProperties.put("atlas.server.http.port", "21000"); + atlasProperties.put("atlas.server.https.port", "21443"); + atlasProperties.put("atlas.enableTLS", "true"); + + Configuration clusterConfig = new Configuration(properties, Collections.>>emptyMap()); + + Collection hgComponents = new HashSet(); + hgComponents.add("ATLAS_SERVER"); + List hosts = new ArrayList(); + hosts.add(host1); + hosts.add(host2); + hosts.add(host3); + TestHostGroup group1 = new TestHostGroup(expectedHostGroupName, hgComponents, hosts); + + Collection hostGroups = new HashSet(); + hostGroups.add(group1); + + ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); + BlueprintConfigurationProcessor updater = new BlueprintConfigurationProcessor(topology); + + // call top-level cluster config update method + updater.doUpdateForClusterCreate(); + + assertEquals("id1,id2,id3", atlasProperties.get("atlas.server.ids")); + + List hostArray = + Arrays.asList(atlasProperties.get("atlas.server.address.id1").split("\natlas.server.address.id.=")); + List expected = + Arrays.asList("c6401.ambari.apache.org:21443","c6402.ambari.apache.org:21443", "c6403.ambari.apache.org:21443"); + + Assert.assertTrue(hostArray.containsAll(expected) && expected.containsAll(hostArray)); + } + + @Test public void testHiveConfigClusterUpdateExportedHostGroupValue() throws Exception { final String expectedHostGroupName = "host_group_1"; final String expectedHostName = "c6401.ambari.apache.org"; http://git-wip-us.apache.org/repos/asf/ambari/blob/5666d252/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py b/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py index c9a8de0..bfd07b2 100644 --- a/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py +++ b/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py @@ -96,18 +96,6 @@ class TestMetadataServer(RMFTestCase): group='hadoop', mode=0644, ) - self.assertResourceCalled('File', '/etc/atlas/conf/users-credentials.properties', - content=StaticFile('users-credentials.properties'), - owner='atlas', - group='hadoop', - mode=0644, - ) - self.assertResourceCalled('File', '/etc/atlas/conf/policy-store.txt', - content=StaticFile('policy-store.txt'), - owner='atlas', - group='hadoop', - mode=0644, - ) self.assertResourceCalled('Directory', '/usr/lib/ambari-logsearch-solr-client', owner='solr', group='solr', http://git-wip-us.apache.org/repos/asf/ambari/blob/5666d252/ambari-server/src/test/python/stacks/2.5/ATLAS/test_atlas_server.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.5/ATLAS/test_atlas_server.py b/ambari-server/src/test/python/stacks/2.5/ATLAS/test_atlas_server.py index fd75bf7..7127451 100644 --- a/ambari-server/src/test/python/stacks/2.5/ATLAS/test_atlas_server.py +++ b/ambari-server/src/test/python/stacks/2.5/ATLAS/test_atlas_server.py @@ -94,18 +94,6 @@ class TestAtlasServer(RMFTestCase): group='hadoop', mode=0644, ) - self.assertResourceCalled('File', '/etc/atlas/conf/users-credentials.properties', - content=StaticFile('users-credentials.properties'), - owner='atlas', - group='hadoop', - mode=0644, - ) - self.assertResourceCalled('File', '/etc/atlas/conf/policy-store.txt', - content=StaticFile('policy-store.txt'), - owner='atlas', - group='hadoop', - mode=0644, - ) self.assertResourceCalled('Directory', '/usr/lib/ambari-logsearch-solr-client', owner='solr', group='solr',