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 <tbeerbo...@hortonworks.com>
Authored: Tue Jun 7 16:04:54 2016 -0400
Committer: tbeerbower <tbeerbo...@hortonworks.com>
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 @@
   </property>
   <property>
     <name>atlas.login.credentials.file</name>
-    <value>{{atlas_login_credentials_file}}</value>
+    <value>{{conf_dir}}/users-credentials.properties</value>
     <description>File path for file based login.</description>
     <on-ambari-upgrade add="false" change="true" delete="true"/>
     <on-stack-upgrade add="true" change="true" delete="false"/>
   </property>
   <property>
     <name>atlas.auth.policy.file</name>
-    <value>{{atlas_policy_store_file}}</value>
+    <value>{{conf_dir}}/policy-store.txt</value>
     <description>Path for the Atlas policy file.</description>
     <on-ambari-upgrade add="false" change="true" delete="true"/>
     <on-stack-upgrade add="true" change="true" delete="false"/>

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<String, Map<String, String>> properties = new HashMap<String, 
Map<String, String>>();
+    Map<String, String> atlasProperties = new HashMap<String, String>();
+    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.<String, Map<String, Map<String, String>>>emptyMap());
+
+    Collection<String> hgComponents = new HashSet<String>();
+    hgComponents.add("KAFKA_BROKER");
+    hgComponents.add("ZOOKEEPER_SERVER");
+    hgComponents.add("HBASE_MASTER");
+    List<String> hosts = new ArrayList<String>();
+    hosts.add(host1);
+    hosts.add(host2);
+    hosts.add(host3);
+    TestHostGroup group1 = new TestHostGroup(expectedHostGroupName, 
hgComponents, hosts);
+
+    Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>();
+    hostGroups.add(group1);
+
+    ClusterTopology topology = createClusterTopology(bp, clusterConfig, 
hostGroups);
+    BlueprintConfigurationProcessor updater = new 
BlueprintConfigurationProcessor(topology);
+
+    // call top-level cluster config update method
+    updater.doUpdateForClusterCreate();
+
+    List<String> hostArray =
+        
Arrays.asList(atlasProperties.get("atlas.kafka.bootstrap.servers").split(","));
+    List<String> 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<String, Map<String, String>> properties = new HashMap<String, 
Map<String, String>>();
+    Map<String, String> atlasProperties = new HashMap<String, String>();
+    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.<String, Map<String, Map<String, String>>>emptyMap());
+
+    Collection<String> hgComponents = new HashSet<String>();
+    hgComponents.add("ATLAS_SERVER");
+    List<String> hosts = new ArrayList<String>();
+    hosts.add(host1);
+    hosts.add(host2);
+    hosts.add(host3);
+    TestHostGroup group1 = new TestHostGroup(expectedHostGroupName, 
hgComponents, hosts);
+
+    Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>();
+    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<String> hostArray =
+        
Arrays.asList(atlasProperties.get("atlas.server.address.id1").split("\natlas.server.address.id.="));
+    List<String> 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<String, Map<String, String>> properties = new HashMap<String, 
Map<String, String>>();
+    Map<String, String> atlasProperties = new HashMap<String, String>();
+    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.<String, Map<String, Map<String, String>>>emptyMap());
+
+    Collection<String> hgComponents = new HashSet<String>();
+    hgComponents.add("ATLAS_SERVER");
+    List<String> hosts = new ArrayList<String>();
+    hosts.add(host1);
+    hosts.add(host2);
+    hosts.add(host3);
+    TestHostGroup group1 = new TestHostGroup(expectedHostGroupName, 
hgComponents, hosts);
+
+    Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>();
+    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<String> hostArray =
+        
Arrays.asList(atlasProperties.get("atlas.server.address.id1").split("\natlas.server.address.id.="));
+    List<String> 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<String, Map<String, String>> properties = new HashMap<String, 
Map<String, String>>();
+    Map<String, String> atlasProperties = new HashMap<String, String>();
+    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.<String, Map<String, Map<String, String>>>emptyMap());
+
+    Collection<String> hgComponents = new HashSet<String>();
+    hgComponents.add("KAFKA_BROKER");
+    hgComponents.add("ZOOKEEPER_SERVER");
+    hgComponents.add("HBASE_MASTER");
+    List<String> hosts = new ArrayList<String>();
+    hosts.add(host1);
+    hosts.add(host2);
+    hosts.add(host3);
+    TestHostGroup group1 = new TestHostGroup(expectedHostGroupName, 
hgComponents, hosts);
+
+    Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>();
+    hostGroups.add(group1);
+
+    ClusterTopology topology = createClusterTopology(bp, clusterConfig, 
hostGroups);
+    BlueprintConfigurationProcessor updater = new 
BlueprintConfigurationProcessor(topology);
+
+    // call top-level cluster config update method
+    updater.doUpdateForClusterCreate();
+
+    List<String> hostArray =
+        
Arrays.asList(atlasProperties.get("atlas.kafka.bootstrap.servers").split(","));
+    List<String> 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<String, Map<String, String>> properties = new HashMap<String, 
Map<String, String>>();
+    Map<String, String> atlasProperties = new HashMap<String, String>();
+    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.<String, Map<String, Map<String, String>>>emptyMap());
+
+    Collection<String> hgComponents = new HashSet<String>();
+    hgComponents.add("ATLAS_SERVER");
+    List<String> hosts = new ArrayList<String>();
+    hosts.add(host1);
+    hosts.add(host2);
+    hosts.add(host3);
+    TestHostGroup group1 = new TestHostGroup(expectedHostGroupName, 
hgComponents, hosts);
+
+    Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>();
+    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<String> hostArray =
+        
Arrays.asList(atlasProperties.get("atlas.server.address.id1").split("\natlas.server.address.id.="));
+    List<String> 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<String, Map<String, String>> properties = new HashMap<String, 
Map<String, String>>();
+    Map<String, String> atlasProperties = new HashMap<String, String>();
+    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.<String, Map<String, Map<String, String>>>emptyMap());
+
+    Collection<String> hgComponents = new HashSet<String>();
+    hgComponents.add("ATLAS_SERVER");
+    List<String> hosts = new ArrayList<String>();
+    hosts.add(host1);
+    hosts.add(host2);
+    hosts.add(host3);
+    TestHostGroup group1 = new TestHostGroup(expectedHostGroupName, 
hgComponents, hosts);
+
+    Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>();
+    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<String> hostArray =
+        
Arrays.asList(atlasProperties.get("atlas.server.address.id1").split("\natlas.server.address.id.="));
+    List<String> 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',

Reply via email to