Repository: ambari
Updated Branches:
  refs/heads/trunk 42b7b3f44 -> 3508a7ef6


AMBARI-15500 - Atlas alert present when WE is enabled


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

Branch: refs/heads/trunk
Commit: 3508a7ef60369fb6aac7b40efd69a08ba490530f
Parents: 42b7b3f
Author: tbeerbower <tbeerbo...@hortonworks.com>
Authored: Tue Mar 22 11:03:58 2016 -0400
Committer: tbeerbower <tbeerbo...@hortonworks.com>
Committed: Tue Mar 22 11:04:25 2016 -0400

----------------------------------------------------------------------
 .../ATLAS/0.1.0.2.3/package/scripts/params.py   |  6 +-
 .../stacks/2.3/ATLAS/test_service_check.py      | 63 ++++++++++++++++++++
 .../test/python/stacks/2.3/configs/secure.json  | 15 ++++-
 3 files changed, 80 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/3508a7ef/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 c5059dd..681e3ee 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
@@ -85,8 +85,10 @@ http_port = 
default("/configurations/application-properties/atlas.server.http.po
 https_port = 
default("/configurations/application-properties/atlas.server.https.port", 21443)
 if ssl_enabled:
   metadata_port = https_port
+  metadata_protocol = 'https'
 else:
   metadata_port = http_port
+  metadata_protocol = 'http'
 
 metadata_host = config['hostname']
 
@@ -112,9 +114,9 @@ kinit_path_local = status_params.kinit_path_local
 
 security_check_status_file = format('{log_dir}/security_check.status')
 if security_enabled:
-    smoke_cmd = format('curl --negotiate -u : -b ~/cookiejar.txt -c 
~/cookiejar.txt -s -o /dev/null -w "%{{http_code}}" 
http://{metadata_host}:{metadata_port}/')
+    smoke_cmd = format('curl --negotiate -u : -b ~/cookiejar.txt -c 
~/cookiejar.txt -s -o /dev/null -w "%{{http_code}}" 
{metadata_protocol}://{metadata_host}:{metadata_port}/')
 else:
-    smoke_cmd = format('curl -s -o /dev/null -w "%{{http_code}}" 
http://{metadata_host}:{metadata_port}/')
+    smoke_cmd = format('curl -s -o /dev/null -w "%{{http_code}}" 
{metadata_protocol}://{metadata_host}:{metadata_port}/')
 
 # kafka
 kafka_bootstrap_servers = ""

http://git-wip-us.apache.org/repos/asf/ambari/blob/3508a7ef/ambari-server/src/test/python/stacks/2.3/ATLAS/test_service_check.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.3/ATLAS/test_service_check.py 
b/ambari-server/src/test/python/stacks/2.3/ATLAS/test_service_check.py
new file mode 100644
index 0000000..49395a7
--- /dev/null
+++ b/ambari-server/src/test/python/stacks/2.3/ATLAS/test_service_check.py
@@ -0,0 +1,63 @@
+#!/usr/bin/env python
+
+'''
+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.
+'''
+
+from stacks.utils.RMFTestCase import *
+
+
+class TestAtlasCheck(RMFTestCase):
+  COMMON_SERVICES_PACKAGE_DIR = "ATLAS/0.1.0.2.3/package"
+  STACK_VERSION = "2.3"
+
+  def test_service_check(self):
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/service_check.py",
+                       classname="AtlasServiceCheck",
+                       command="service_check",
+                       config_file="default.json",
+                       stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
+                       )
+
+    self.assertResourceCalled('Execute', 'curl -s -o /dev/null -w 
"%{http_code}" http://c6401.ambari.apache.org:21000/',
+                              user = 'atlas',
+                              tries = 5,
+                              try_sleep = 10)
+
+    self.assertNoMoreResources()
+
+  def test_service_check_secure(self):
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/service_check.py",
+                       classname="AtlasServiceCheck",
+                       command="service_check",
+                       config_file="secure.json",
+                       stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
+                       )
+
+    self.assertResourceCalled('Execute',
+                              '/usr/bin/kinit -kt 
/etc/security/keytabs/smokeuser.headless.keytab ambari...@example.com',
+                              user = 'atlas')
+
+    self.assertResourceCalled('Execute', 'curl --negotiate -u : -b 
~/cookiejar.txt -c ~/cookiejar.txt -s -o /dev/null -w "%{http_code}" 
https://c6401.ambari.apache.org:21443/',
+                              user = 'atlas',
+                              tries = 5,
+                              try_sleep = 10)
+
+    self.assertNoMoreResources()
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/3508a7ef/ambari-server/src/test/python/stacks/2.3/configs/secure.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/configs/secure.json 
b/ambari-server/src/test/python/stacks/2.3/configs/secure.json
index b48ae97..c08b691 100644
--- a/ambari-server/src/test/python/stacks/2.3/configs/secure.json
+++ b/ambari-server/src/test/python/stacks/2.3/configs/secure.json
@@ -57,6 +57,8 @@
       "security_enabled": "true",
       "ignore_groupsusers_create": "false",
       "smokeuser": "ambari-qa",
+      "smokeuser_principal_name": "ambari...@example.com",
+      "smokeuser_keytab": "/etc/security/keytabs/smokeuser.headless.keytab",
       "kerberos_domain": "EXAMPLE.COM",
       "user_group": "hadoop"
     },
@@ -161,6 +163,7 @@
       "log.retention.hours": "168"
     },
     "application-properties": {
+      "atlas.cluster.name" : "c2",
       "atlas.graph.storage.backend": "berkeleyje",
       "atlas.graph.storage.directory": "data/berkley",
       "atlas.graph.index.search.backend": "elasticsearch",
@@ -173,7 +176,7 @@
       "atlas.lineage.hive.process.type.name": "LoadProcess",
       "atlas.lineage.hive.process.inputs.name": "inputTables",
       "atlas.lineage.hive.process.outputs.name": "outputTables",
-      "atlas.enableTLS": false,
+      "atlas.enableTLS": true,
       "atlas.authentication.method": "simple",
       "atlas.authentication.principal": "atlas",
       "atlas.authentication.keytab": 
"/etc/security/keytabs/atlas.service.keytab",
@@ -181,7 +184,15 @@
       "atlas.http.authentication.type": "simple",
       "atlas.http.authentication.kerberos.principal": "HTTP/_h...@example.com",
       "atlas.http.authentication.kerberos.keytab": 
"/etc/security/keytabs/spnego.service.keytab",
-      "atlas.http.authentication.kerberos.name.rules": "DEFAULT"
+      "atlas.http.authentication.kerberos.name.rules": "DEFAULT",
+      "atlas.server.http.port" : "21000",
+      "atlas.server.https.port" : "21443",
+      "atlas.notification.embedded" : false,
+      "atlas.kafka.bootstrap.servers" : "c6401.ambari.apache.org:6667",
+      "atlas.kafka.data" : "/usr/hdp/current/atlas-server/data/kafka",
+      "atlas.kafka.entities.group.id" : "entities",
+      "atlas.kafka.hook.group.id" : "atlas",
+      "atlas.kafka.zookeeper.connect" : "c6401.ambari.apache.org:2181"
     },
     "atlas-env": {
       "content": "# The java implementation to use. If JAVA_HOME is not found 
we expect java and jar to be in path\nexport JAVA_HOME={{java64_home}}\n# any 
additional java opts you want to set. This will apply to both client and server 
operations\nexport METADATA_OPTS={{metadata_opts}}\n# metadata configuration 
directory\nexport METADATA_CONF={{conf_dir}}\n# Where log files are stored. 
Defatult is logs directory under the base install location\nexport 
METADATA_LOG_DIR={{log_dir}}\n# additional classpath entries\nexport 
METADATACPPATH={{metadata_classpath}}\n# data dir\nexport 
METADATA_DATA_DIR={{data_dir}}\n# Where do you want to expand the war file. By 
Default it is in /server/webapp dir under the base install dir.\nexport 
METADATA_EXPANDED_WEBAPP_DIR={{expanded_war_dir}}",

Reply via email to