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 90F32171E2 for ; Thu, 22 Jan 2015 22:16:42 +0000 (UTC) Received: (qmail 13812 invoked by uid 500); 22 Jan 2015 22:16:42 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 13717 invoked by uid 500); 22 Jan 2015 22:16:42 -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 13268 invoked by uid 99); 22 Jan 2015 22:16:42 -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; Thu, 22 Jan 2015 22:16:42 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DB33DE0D6E; Thu, 22 Jan 2015 22:16:41 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: yusaku@apache.org To: commits@ambari.apache.org Date: Thu, 22 Jan 2015 22:16:51 -0000 Message-Id: In-Reply-To: <6ecb3e2414a54ceaa56c58be937aa79a@git.apache.org> References: <6ecb3e2414a54ceaa56c58be937aa79a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [11/14] ambari git commit: AMBARI-9253. Kerberos wizard->Start and Test services: all service check fails with customized smokeuser principal. (jaimin) AMBARI-9253. Kerberos wizard->Start and Test services: all service check fails with customized smokeuser principal. (jaimin) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/786d7802 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/786d7802 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/786d7802 Branch: refs/heads/2.0-preview Commit: 786d780293737c3b54a3655a122b5fb70fc1a3d8 Parents: 757256d Author: Jaimin Jetly Authored: Wed Jan 21 20:21:53 2015 -0800 Committer: Yusaku Sako Committed: Thu Jan 22 08:26:03 2015 -0800 ---------------------------------------------------------------------- .../resource_management/TestExecuteHadoopResource.py | 5 +++-- .../libraries/resources/execute_hadoop.py | 2 +- .../HBASE/0.96.0.2.0/package/scripts/params.py | 1 + .../HBASE/0.96.0.2.0/package/scripts/service_check.py | 2 +- .../HIVE/0.12.0.2.0/package/files/templetonSmoke.sh | 3 ++- .../0.12.0.2.0/package/scripts/hive_server_upgrade.py | 2 +- .../HIVE/0.12.0.2.0/package/scripts/params.py | 1 + .../HIVE/0.12.0.2.0/package/scripts/service_check.py | 2 +- .../0.12.0.2.0/package/scripts/webhcat_service_check.py | 10 ++++++++-- .../KERBEROS/1.10.3-10/package/scripts/params.py | 2 +- .../KNOX/0.5.0.2.2/package/scripts/params.py | 1 + .../KNOX/0.5.0.2.2/package/scripts/service_check.py | 2 +- .../4.0.0.2.0/package/alerts/alert_check_oozie_server.py | 2 +- .../OOZIE/4.0.0.2.0/package/files/oozieSmoke2.sh | 3 ++- .../OOZIE/4.0.0.2.0/package/scripts/params.py | 1 + .../OOZIE/4.0.0.2.0/package/scripts/service_check.py | 2 +- .../PIG/0.12.0.2.0/package/scripts/params.py | 1 + .../PIG/0.12.0.2.0/package/scripts/service_check.py | 4 +++- .../SLIDER/0.60.0.2.2/package/scripts/params.py | 1 + .../SLIDER/0.60.0.2.2/package/scripts/service_check.py | 2 +- .../SQOOP/1.4.4.2.0/package/scripts/params.py | 1 + .../SQOOP/1.4.4.2.0/package/scripts/service_check.py | 2 +- .../2.1.0.2.0/package/scripts/mapred_service_check.py | 2 +- .../YARN/2.1.0.2.0/package/scripts/params.py | 1 + .../YARN/2.1.0.2.0/package/scripts/service_check.py | 2 +- .../ZOOKEEPER/3.4.5.2.0/package/files/zkSmoke.sh | 3 ++- .../ZOOKEEPER/3.4.5.2.0/package/scripts/params.py | 1 + .../ZOOKEEPER/3.4.5.2.0/package/scripts/service_check.py | 11 +++++++++-- .../3.4.5.2.0/package/scripts/zookeeper_service.py | 2 +- .../stacks/2.0.6/HBASE/test_hbase_service_check.py | 4 ++-- .../python/stacks/2.0.6/HIVE/test_hive_service_check.py | 6 +++--- .../python/stacks/2.0.6/PIG/test_pig_service_check.py | 2 ++ .../test/python/stacks/2.0.6/SQOOP/test_service_check.py | 2 +- .../stacks/2.0.6/YARN/test_mapreduce2_service_check.py | 2 +- .../python/stacks/2.0.6/YARN/test_yarn_service_check.py | 2 +- .../stacks/2.0.6/ZOOKEEPER/test_zookeeper_server.py | 2 +- .../2.0.6/ZOOKEEPER/test_zookeeper_service_check.py | 6 +++--- .../src/test/python/stacks/2.0.6/configs/secured.json | 1 + .../src/test/python/stacks/2.1/configs/secured.json | 1 + .../test/python/stacks/2.2/SLIDER/test_slider_client.py | 2 +- .../src/test/python/stacks/2.2/configs/secured.json | 1 + 41 files changed, 69 insertions(+), 36 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-agent/src/test/python/resource_management/TestExecuteHadoopResource.py ---------------------------------------------------------------------- diff --git a/ambari-agent/src/test/python/resource_management/TestExecuteHadoopResource.py b/ambari-agent/src/test/python/resource_management/TestExecuteHadoopResource.py index ae137a5..6ca6f36 100644 --- a/ambari-agent/src/test/python/resource_management/TestExecuteHadoopResource.py +++ b/ambari-agent/src/test/python/resource_management/TestExecuteHadoopResource.py @@ -166,6 +166,7 @@ class TestExecuteHadoopResource(TestCase): kinit_path_local="path", conf_dir="conf_dir", user="user", + principal="principal", tries=1, keytab="keytab", security_enabled=True, @@ -175,9 +176,9 @@ class TestExecuteHadoopResource(TestCase): ) self.assertEqual(execute_mock.call_count, 2) self.assertEqual(str(execute_mock.call_args_list[0][0][0]), - "Execute['path -kt keytab user']") + "Execute['path -kt keytab principal']") self.assertEqual(execute_mock.call_args_list[0][0][0].command, - 'path -kt keytab user') + 'path -kt keytab principal') self.assertEqual(execute_mock.call_args_list[0][0][0].arguments, {'path': ['/bin'], 'user': 'user'}) self.assertEqual(execute_mock.call_args_list[1][0][0].command, http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/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 b4b0b52..73dd1a3 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 @@ -31,7 +31,7 @@ class ExecuteHadoop(Resource): try_sleep = ResourceArgument(default=0) # seconds user = ResourceArgument() logoutput = ResourceArgument() - principal = ResourceArgument(default=lambda obj: obj.user) + principal = ResourceArgument() bin_dir = ResourceArgument(default=[]) # appended to $PATH environment = ResourceArgument(default={}) http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params.py index ace3901..e549b88 100644 --- a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params.py +++ b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params.py @@ -105,6 +105,7 @@ else: rs_hosts = default('/clusterHostInfo/hbase_rs_hosts', '/clusterHostInfo/all_hosts') smoke_test_user = config['configurations']['cluster-env']['smokeuser'] +smokeuser_principal = config['configurations']['cluster-env']['smokeuser_principal_name'] smokeuser_permissions = "RWXCA" service_check_data = functions.get_unique_id_and_date() user_group = config['configurations']['cluster-env']["user_group"] http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/service_check.py index 15a306b..eea1cd1 100644 --- a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/service_check.py +++ b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/service_check.py @@ -29,7 +29,7 @@ class HbaseServiceCheck(Script): output_file = "/apps/hbase/data/ambarismoketest" test_cmd = format("fs -test -e {output_file}") - smokeuser_kinit_cmd = format("{kinit_path_local} -kt {smoke_user_keytab} {smoke_test_user};") if params.security_enabled else "" + smokeuser_kinit_cmd = format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser_principal};") if params.security_enabled else "" hbase_servicecheck_file = format("{exec_tmp_dir}/hbase-smoke.sh") File( format("{exec_tmp_dir}/hbaseSmokeVerify.sh"), http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/files/templetonSmoke.sh ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/files/templetonSmoke.sh b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/files/templetonSmoke.sh index 22202ee..34b78f5 100644 --- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/files/templetonSmoke.sh +++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/files/templetonSmoke.sh @@ -25,10 +25,11 @@ export smoke_test_user=$2 export smoke_user_keytab=$3 export security_enabled=$4 export kinit_path_local=$5 +export smokeuser_principal=$6 export ttonurl="http://${ttonhost}:50111/templeton/v1" if [[ $security_enabled == "true" ]]; then - kinitcmd="${kinit_path_local} -kt ${smoke_user_keytab} ${smoke_test_user}; " + kinitcmd="${kinit_path_local} -kt ${smoke_user_keytab} ${smokeuser_principal}; " else kinitcmd="" fi http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_upgrade.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_upgrade.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_upgrade.py index 37fe7f1..4db3df6 100644 --- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_upgrade.py +++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_upgrade.py @@ -41,7 +41,7 @@ def pre_upgrade_deregister(): Logger.info('HiveServer2 executing "deregister" command in preparation for upgrade...') if params.security_enabled: - kinit_command=format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser}; ") + kinit_command=format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser_principal}; ") Execute(kinit_command,user=params.smokeuser) # calculate the current hive server version http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params.py index 00bada8..c59670b 100644 --- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params.py +++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params.py @@ -148,6 +148,7 @@ smokeuser = config['configurations']['cluster-env']['smokeuser'] smoke_test_sql = format("{tmp_dir}/hiveserver2.sql") smoke_test_path = format("{tmp_dir}/hiveserver2Smoke.sh") smoke_user_keytab = config['configurations']['cluster-env']['smokeuser_keytab'] +smokeuser_principal = config['configurations']['cluster-env']['smokeuser_principal_name'] fs_root = config['configurations']['core-site']['fs.defaultFS'] security_enabled = config['configurations']['cluster-env']['security_enabled'] http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/service_check.py index 09d31aa..9f822a9 100644 --- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/service_check.py +++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/service_check.py @@ -34,7 +34,7 @@ class HiveServiceCheck(Script): port = int(format("{hive_server_port}")) print "Test connectivity to hive server" if params.security_enabled: - kinitcmd=format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser}; ") + kinitcmd=format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser_principal}; ") else: kinitcmd=None http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/webhcat_service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/webhcat_service_check.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/webhcat_service_check.py index 8d15e47..e9d1f18 100644 --- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/webhcat_service_check.py +++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/webhcat_service_check.py @@ -27,9 +27,15 @@ def webhcat_service_check(): mode=0755 ) + if params.security_enabled: + smokeuser_keytab=params.smoke_user_keytab + smoke_user_principal=params.smokeuser_principal + else: + smokeuser_keytab= "no_keytab" + smoke_user_principal="no_principal" + cmd = format("{tmp_dir}/templetonSmoke.sh {webhcat_server_host[0]} {smokeuser} {smokeuser_keytab}" - " {security_param} {kinit_path_local}", - smokeuser_keytab=params.smoke_user_keytab if params.security_enabled else "no_keytab") + " {security_param} {kinit_path_local} {smoke_user_principal}") Execute(cmd, tries=3, http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/package/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/package/scripts/params.py b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/package/scripts/params.py index 58549bc..b3337cf 100644 --- a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/package/scripts/params.py +++ b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/package/scripts/params.py @@ -72,7 +72,7 @@ if config is not None: cluster_env = get_property_value(configurations, 'cluster-env') if cluster_env is not None: - smoke_test_principal = get_property_value(cluster_env, 'smokeuser', None, True, None) + smoke_test_principal = get_property_value(cluster_env, 'smokeuser_principal_name', None, True, None) smoke_test_keytab_file = get_property_value(cluster_env, 'smokeuser_keytab', None, True, None) default_group = get_property_value(cluster_env, 'user_group') http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params.py b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params.py index 938d1d7..de3e4b8 100644 --- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params.py +++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params.py @@ -138,6 +138,7 @@ users_ldif = config['configurations']['users-ldif']['content'] java_home = config['hostLevelParams']['java_home'] security_enabled = config['configurations']['cluster-env']['security_enabled'] smokeuser = config['configurations']['cluster-env']['smokeuser'] +smokeuser_principal = config['configurations']['cluster-env']['smokeuser_principal_name'] smoke_user_keytab = config['configurations']['cluster-env']['smokeuser_keytab'] kinit_path_local = functions.get_kinit_path(["/usr/bin", "/usr/kerberos/bin", "/usr/sbin"]) if security_enabled: http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/service_check.py index 0349c24..e05262f 100644 --- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/service_check.py +++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/service_check.py @@ -32,7 +32,7 @@ class KnoxServiceCheck(Script): python_executable = sys.executable validateStatusCmd = format("{python_executable} {validateKnoxFilePath} -p {knox_host_port} -n {knox_host_name}") if params.security_enabled: - kinit_cmd = format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser};") + kinit_cmd = format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser_principal};") smoke_cmd = format("{kinit_cmd} {validateStatusCmd}") else: smoke_cmd = validateStatusCmd http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py index 4e3e6ae..4efb999 100644 --- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py +++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py @@ -66,7 +66,7 @@ def execute(parameters=None, host_name=None): else: return (RESULT_CODE_UNKNOWN, ['The Smokeuser keytab is required when security is enabled.']) kinit_path_local = get_kinit_path(["/usr/bin", "/usr/kerberos/bin", "/usr/sbin"]) - kinitcmd = format("{kinit_path_local} -kt {smokeuser_keytab} {smokeuser}; ") + kinitcmd = format("{kinit_path_local} -kt {smokeuser_keytab} {smokeuser_principal}; ") Execute(kinitcmd, user=smokeuser, http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/files/oozieSmoke2.sh ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/files/oozieSmoke2.sh b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/files/oozieSmoke2.sh index 30d878c..bdd4e26 100644 --- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/files/oozieSmoke2.sh +++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/files/oozieSmoke2.sh @@ -65,6 +65,7 @@ export smoke_test_user=$5 export security_enabled=$6 export smoke_user_keytab=$7 export kinit_path_local=$8 +export smokeuser_principal=$9 export OOZIE_EXIT_CODE=0 export JOBTRACKER=`getValueFromField ${hadoop_conf_dir}/yarn-site.xml yarn.resourcemanager.address` @@ -95,7 +96,7 @@ sudo sed -i "s|jobTracker=localhost:8032|jobTracker=$JOBTRACKER|g" examples/apps sudo sed -i "s|oozie.wf.application.path=hdfs://localhost:9000|oozie.wf.application.path=$NAMENODE|g" examples/apps/map-reduce/job.properties if [[ $security_enabled == "True" ]]; then - kinitcmd="${kinit_path_local} -kt ${smoke_user_keytab} ${smoke_test_user}; " + kinitcmd="${kinit_path_local} -kt ${smoke_user_keytab} ${smokeuser_principal}; " else kinitcmd="" fi http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params.py index dc8ba0a..64e3f74 100644 --- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params.py +++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params.py @@ -93,6 +93,7 @@ conf_dir = "/etc/oozie/conf" hive_conf_dir = "/etc/oozie/conf/action-conf/hive" oozie_user = config['configurations']['oozie-env']['oozie_user'] smokeuser = config['configurations']['cluster-env']['smokeuser'] +smokeuser_principal = config['configurations']['cluster-env']['smokeuser_principal_name'] user_group = config['configurations']['cluster-env']['user_group'] jdk_location = config['hostLevelParams']['jdk_location'] check_db_connection_jar_name = "DBConnectionVerification.jar" http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/service_check.py index 40f8b8d..cac6ede 100644 --- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/service_check.py +++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/service_check.py @@ -43,7 +43,7 @@ def oozie_smoke_shell_file( os_family = System.get_instance().os_family if params.security_enabled: - sh_cmd = format("{tmp_dir}/{file_name} {os_family} {conf_dir} {oozie_bin_dir} {hadoop_conf_dir} {hadoop_bin_dir} {smokeuser} {security_enabled} {smokeuser_keytab} {kinit_path_local}") + sh_cmd = format("{tmp_dir}/{file_name} {os_family} {conf_dir} {oozie_bin_dir} {hadoop_conf_dir} {hadoop_bin_dir} {smokeuser} {security_enabled} {smokeuser_keytab} {kinit_path_local} {smokeuser_principal}") else: sh_cmd = format("{tmp_dir}/{file_name} {os_family} {conf_dir} {oozie_bin_dir} {hadoop_conf_dir} {hadoop_bin_dir} {smokeuser} {security_enabled}") http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/params.py index c31ac34..3d4acac 100644 --- a/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/params.py +++ b/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/params.py @@ -50,6 +50,7 @@ hdfs_user = config['configurations']['hadoop-env']['hdfs_user'] hdfs_principal_name = config['configurations']['hadoop-env']['hdfs_principal_name'] hdfs_user_keytab = config['configurations']['hadoop-env']['hdfs_user_keytab'] smokeuser = config['configurations']['cluster-env']['smokeuser'] +smokeuser_principal = config['configurations']['cluster-env']['smokeuser_principal_name'] user_group = config['configurations']['cluster-env']['user_group'] security_enabled = config['configurations']['cluster-env']['security_enabled'] smoke_user_keytab = config['configurations']['cluster-env']['smokeuser_keytab'] http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/service_check.py index 8cbcdac..7137e60 100644 --- a/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/service_check.py +++ b/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/service_check.py @@ -42,6 +42,7 @@ class PigServiceCheck(Script): conf_dir = params.hadoop_conf_dir, # for kinit run keytab = params.smoke_user_keytab, + principal = params.smokeuser_principal, security_enabled = params.security_enabled, kinit_path_local = params.kinit_path_local, bin_dir = params.hadoop_bin_dir @@ -75,6 +76,7 @@ class PigServiceCheck(Script): conf_dir = params.hadoop_conf_dir, # for kinit run keytab = params.smoke_user_keytab, + principal = params.smokeuser_principal, security_enabled = params.security_enabled, kinit_path_local = params.kinit_path_local, bin_dir = params.hadoop_bin_dir @@ -84,7 +86,7 @@ class PigServiceCheck(Script): copy_tarballs_to_hdfs('tez', 'hadoop-client', params.smokeuser, params.hdfs_user, params.user_group) if params.security_enabled: - kinit_cmd = format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser};") + kinit_cmd = format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser_principal};") Execute(kinit_cmd, user=params.smokeuser ) http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params.py b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params.py index 2ee07d7..fbb1973 100644 --- a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params.py +++ b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params.py @@ -42,6 +42,7 @@ else: slider_conf_dir = "/etc/slider/conf" hadoop_conf_dir = "/etc/hadoop/conf" smokeuser = config['configurations']['cluster-env']['smokeuser'] +smokeuser_principal = config['configurations']['cluster-env']['smokeuser_principal_name'] security_enabled = config['configurations']['cluster-env']['security_enabled'] smokeuser_keytab = config['configurations']['cluster-env']['smokeuser_keytab'] kinit_path_local = functions.get_kinit_path(["/usr/bin", "/usr/kerberos/bin", "/usr/sbin"]) http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/service_check.py index bb54dc8..af085b8 100644 --- a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/service_check.py +++ b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/service_check.py @@ -28,7 +28,7 @@ class SliderServiceCheck(Script): env.set_params(params) smokeuser_kinit_cmd = format( - "{kinit_path_local} -kt {smokeuser_keytab} {smokeuser};") if params.security_enabled else "" + "{kinit_path_local} -kt {smokeuser_keytab} {smokeuser_principal};") if params.security_enabled else "" servicecheckcmd = format("{smokeuser_kinit_cmd} {slider_cmd} list") http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/params.py index 2972935..27a75e4 100644 --- a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/params.py +++ b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/params.py @@ -47,6 +47,7 @@ else: zoo_conf_dir = "/etc/zookeeper" security_enabled = config['configurations']['cluster-env']['security_enabled'] smokeuser = config['configurations']['cluster-env']['smokeuser'] +smokeuser_principal = config['configurations']['cluster-env']['smokeuser_principal_name'] user_group = config['configurations']['cluster-env']['user_group'] sqoop_env_sh_template = config['configurations']['sqoop-env']['content'] http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/service_check.py index c18fbc3..140862c 100644 --- a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/service_check.py +++ b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/service_check.py @@ -31,7 +31,7 @@ class SqoopServiceCheck(Script): import params env.set_params(params) if params.security_enabled: - Execute(format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser}"), + Execute(format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser_principal}"), user = params.smokeuser, ) Execute("sqoop version", http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/mapred_service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/mapred_service_check.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/mapred_service_check.py index a9f4367..4ee1839 100644 --- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/mapred_service_check.py +++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/mapred_service_check.py @@ -36,7 +36,7 @@ class MapReduce2ServiceCheck(Script): run_wordcount_job = format("jar {jar_path} wordcount {input_file} {output_file}") if params.security_enabled: - kinit_cmd = format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser};") + kinit_cmd = format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser_principal};") Execute(kinit_cmd, user=params.smokeuser http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params.py index 8819dc0..53beb96 100644 --- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params.py +++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params.py @@ -89,6 +89,7 @@ yarn_user = status_params.yarn_user hdfs_user = config['configurations']['hadoop-env']['hdfs_user'] smokeuser = config['configurations']['cluster-env']['smokeuser'] +smokeuser_principal = config['configurations']['cluster-env']['smokeuser_principal_name'] security_enabled = config['configurations']['cluster-env']['security_enabled'] smoke_user_keytab = config['configurations']['cluster-env']['smokeuser_keytab'] yarn_executor_container_group = config['configurations']['yarn-site']['yarn.nodemanager.linux-container-executor.group'] http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py index 7189664..42b113a 100644 --- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py +++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py @@ -41,7 +41,7 @@ class ServiceCheck(Script): validateStatusCmd = format("{python_executable} {validateStatusFilePath} {component_type} -p {component_address} -s {hadoop_ssl_enabled}") if params.security_enabled: - kinit_cmd = format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser};") + kinit_cmd = format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser_principal};") smoke_cmd = format("{kinit_cmd} {validateStatusCmd}") else: smoke_cmd = validateStatusCmd http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/files/zkSmoke.sh ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/files/zkSmoke.sh b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/files/zkSmoke.sh index 04f5a35..39916d3 100644 --- a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/files/zkSmoke.sh +++ b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/files/zkSmoke.sh @@ -27,6 +27,7 @@ client_port=$4 security_enabled=$5 kinit_path_local=$6 smoke_user_keytab=$7 +smokeuser_principal=$8 export ZOOKEEPER_EXIT_CODE=0 test_output_file=/tmp/zkSmoke.out errors_expr="ERROR|Exception" @@ -35,7 +36,7 @@ zkhosts=` grep "^\s*server\.[[:digit:]]" $conf_dir/zoo.cfg | cut -f 2 -d '=' | zk_node1=`echo $zkhosts | tr ' ' '\n' | head -n 1` echo "zk_node1=$zk_node1" if [[ $security_enabled == "True" ]]; then - kinitcmd="$kinit_path_local -kt $smoke_user_keytab $smoke_user" + kinitcmd="$kinit_path_local -kt $smoke_user_keytab $smokeuser_principal" sudo su $smoke_user -s /bin/bash - -c "$kinitcmd" fi http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params.py index a180b0f..2484463 100644 --- a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params.py +++ b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params.py @@ -88,6 +88,7 @@ security_enabled = config['configurations']['cluster-env']['security_enabled'] smoke_user_keytab = config['configurations']['cluster-env']['smokeuser_keytab'] smokeuser = config['configurations']['cluster-env']['smokeuser'] +smokeuser_principal = config['configurations']['cluster-env']['smokeuser_principal_name'] kinit_path_local = functions.get_kinit_path(["/usr/bin", "/usr/kerberos/bin", "/usr/sbin"]) #log4j.properties http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/service_check.py index a4efa41..338de32 100644 --- a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/service_check.py +++ b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/service_check.py @@ -31,9 +31,16 @@ class ZookeeperServiceCheck(Script): content=StaticFile('zkSmoke.sh') ) + if params.security_enabled: + smokeUserKeytab=params.smoke_user_keytab + smokeUserPrincipal=params.smokeuser_principal + else: + smokeUserKeytab= "no_keytab" + smokeUserPrincipal="no_principal" + + cmd_quorum = format("{tmp_dir}/zkSmoke.sh {zk_cli_shell} {smokeuser} {config_dir} {clientPort} " - "{security_enabled} {kinit_path_local} {smokeUserKeytab}", - smokeUserKeytab=params.smoke_user_keytab if params.security_enabled else "no_keytab") + "{security_enabled} {kinit_path_local} {smokeUserKeytab} {smokeUserPrincipal}") Execute(cmd_quorum, tries=3, http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_service.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_service.py b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_service.py index 1495163..2be70cc 100644 --- a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_service.py +++ b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_service.py @@ -35,7 +35,7 @@ def zookeeper_service(action='start'): ) if params.security_enabled: - kinit_cmd = format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser};") + kinit_cmd = format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser_principal};") Execute(kinit_cmd, user=params.smokeuser http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_service_check.py b/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_service_check.py index 1155a1a..8470269 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_service_check.py +++ b/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_service_check.py @@ -83,13 +83,13 @@ class TestServiceCheck(RMFTestCase): self.assertResourceCalled('Execute', '/usr/bin/kinit -kt /etc/security/keytabs/hbase.headless.keytab hbase; /usr/lib/hbase/bin/hbase shell /tmp/hbase_grant_permissions.sh', user = 'hbase', ) - self.assertResourceCalled('Execute', '/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab ambari-qa; /usr/lib/hbase/bin/hbase --config /etc/hbase/conf shell /tmp/hbase-smoke.sh', + self.assertResourceCalled('Execute', '/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab ambari-qa@EXAMPLE.COM; /usr/lib/hbase/bin/hbase --config /etc/hbase/conf shell /tmp/hbase-smoke.sh', logoutput = True, tries = 3, user = 'ambari-qa', try_sleep = 5, ) - self.assertResourceCalled('Execute', '/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab ambari-qa; /tmp/hbaseSmokeVerify.sh /etc/hbase/conf /usr/lib/hbase/bin/hbase', + self.assertResourceCalled('Execute', '/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab ambari-qa@EXAMPLE.COM; /tmp/hbaseSmokeVerify.sh /etc/hbase/conf /usr/lib/hbase/bin/hbase', logoutput = True, tries = 3, user = 'ambari-qa', http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py index 6da0ba5..8e138e5 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py +++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py @@ -77,7 +77,7 @@ class TestServiceCheck(RMFTestCase): content = StaticFile('templetonSmoke.sh'), mode = 0755, ) - self.assertResourceCalled('Execute', '/tmp/templetonSmoke.sh c6402.ambari.apache.org ambari-qa no_keytab false /usr/bin/kinit', + self.assertResourceCalled('Execute', '/tmp/templetonSmoke.sh c6402.ambari.apache.org ambari-qa no_keytab false /usr/bin/kinit no_principal', logoutput = True, path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'], tries = 3, @@ -96,7 +96,7 @@ class TestServiceCheck(RMFTestCase): hdp_stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) - self.assertResourceCalled('Execute', '/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab ambari-qa; ', + self.assertResourceCalled('Execute', '/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab ambari-qa@EXAMPLE.COM; ', user = 'ambari-qa', ) self.assertResourceCalled('Execute', "! beeline -u 'jdbc:hive2://c6402.ambari.apache.org:10000/;principal=hive/_HOST@EXAMPLE.COM' -e '' 2>&1| awk '{print}'|grep -i -e 'Connection refused' -e 'Invalid URL'", @@ -141,7 +141,7 @@ class TestServiceCheck(RMFTestCase): content = StaticFile('templetonSmoke.sh'), mode = 0755, ) - self.assertResourceCalled('Execute', '/tmp/templetonSmoke.sh c6402.ambari.apache.org ambari-qa /etc/security/keytabs/smokeuser.headless.keytab true /usr/bin/kinit', + self.assertResourceCalled('Execute', '/tmp/templetonSmoke.sh c6402.ambari.apache.org ambari-qa /etc/security/keytabs/smokeuser.headless.keytab true /usr/bin/kinit ambari-qa@EXAMPLE.COM', logoutput = True, path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'], tries = 3, http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/test/python/stacks/2.0.6/PIG/test_pig_service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/PIG/test_pig_service_check.py b/ambari-server/src/test/python/stacks/2.0.6/PIG/test_pig_service_check.py index fbd6efc..df30085 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/PIG/test_pig_service_check.py +++ b/ambari-server/src/test/python/stacks/2.0.6/PIG/test_pig_service_check.py @@ -38,6 +38,7 @@ class TestPigServiceCheck(RMFTestCase): user = 'ambari-qa', conf_dir = '/etc/hadoop/conf', security_enabled = False, + principal = UnknownConfigurationMock(), keytab = UnknownConfigurationMock(), bin_dir = '/usr/bin', kinit_path_local = '/usr/bin/kinit' @@ -75,6 +76,7 @@ class TestPigServiceCheck(RMFTestCase): try_sleep = 5, tries = 3, user = 'ambari-qa', + principal = 'ambari-qa@EXAMPLE.COM', conf_dir = '/etc/hadoop/conf', security_enabled = True, keytab = '/etc/security/keytabs/smokeuser.headless.keytab', http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/test/python/stacks/2.0.6/SQOOP/test_service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/SQOOP/test_service_check.py b/ambari-server/src/test/python/stacks/2.0.6/SQOOP/test_service_check.py index 8b8debe..784bb29 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/SQOOP/test_service_check.py +++ b/ambari-server/src/test/python/stacks/2.0.6/SQOOP/test_service_check.py @@ -32,7 +32,7 @@ class TestSqoopServiceCheck(RMFTestCase): hdp_stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) - self.assertResourceCalled('Execute', '/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab ambari-qa', + self.assertResourceCalled('Execute', '/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab ambari-qa@EXAMPLE.COM', user = 'ambari-qa' ) self.assertResourceCalled('Execute', 'sqoop version', http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_service_check.py b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_service_check.py index f9f9812..3af8064 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_service_check.py +++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_service_check.py @@ -76,7 +76,7 @@ class TestServiceCheck(RMFTestCase): hdp_stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) - self.assertResourceCalled('Execute', '/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab ambari-qa;', + self.assertResourceCalled('Execute', '/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab ambari-qa@EXAMPLE.COM;', user = 'ambari-qa', ) self.assertResourceCalled('ExecuteHadoop', 'fs -rm -r -f /user/ambari-qa/mapredsmokeoutput /user/ambari-qa/mapredsmokeinput', http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py index 0daa824..3a351b2 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py +++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py @@ -64,7 +64,7 @@ class TestServiceCheck(RMFTestCase): content = StaticFile('validateYarnComponentStatus.py'), mode = 0755, ) - self.assertResourceCalled('Execute', '/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab ambari-qa; /usr/bin/python2.6 /tmp/validateYarnComponentStatus.py rm -p c6402.ambari.apache.org:8088 -s False', + self.assertResourceCalled('Execute', '/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab ambari-qa@EXAMPLE.COM; /usr/bin/python2.6 /tmp/validateYarnComponentStatus.py rm -p c6402.ambari.apache.org:8088 -s False', logoutput = True, path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'], tries = 3, http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_server.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_server.py b/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_server.py index a1d9a15..d2b26d4 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_server.py +++ b/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_server.py @@ -92,7 +92,7 @@ class TestZookeeperServer(RMFTestCase): not_if = 'ls /var/run/zookeeper/zookeeper_server.pid >/dev/null 2>&1 && ps -p `cat /var/run/zookeeper/zookeeper_server.pid` >/dev/null 2>&1', user = 'zookeeper' ) - self.assertResourceCalled('Execute', "/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab ambari-qa;", + self.assertResourceCalled('Execute', "/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab ambari-qa@EXAMPLE.COM;", user="ambari-qa") self.assertNoMoreResources() http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_service_check.py b/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_service_check.py index 0c71e6f..a936b1d 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_service_check.py +++ b/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_service_check.py @@ -36,7 +36,7 @@ class TestServiceCheck(RMFTestCase): content = StaticFile('zkSmoke.sh'), mode = 0755, ) - self.assertResourceCalled('Execute', '/tmp/zkSmoke.sh /usr/lib/zookeeper/bin/zkCli.sh ambari-qa /etc/zookeeper/conf 2181 False /usr/bin/kinit no_keytab', + self.assertResourceCalled('Execute', '/tmp/zkSmoke.sh /usr/lib/zookeeper/bin/zkCli.sh ambari-qa /etc/zookeeper/conf 2181 False /usr/bin/kinit no_keytab no_principal', logoutput = True, path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'], tries = 3, @@ -56,7 +56,7 @@ class TestServiceCheck(RMFTestCase): content = StaticFile('zkSmoke.sh'), mode = 0755, ) - self.assertResourceCalled('Execute', '/tmp/zkSmoke.sh /usr/lib/zookeeper/bin/zkCli.sh ambari-qa /etc/zookeeper/conf 2181 True /usr/bin/kinit /etc/security/keytabs/smokeuser.headless.keytab', + self.assertResourceCalled('Execute', '/tmp/zkSmoke.sh /usr/lib/zookeeper/bin/zkCli.sh ambari-qa /etc/zookeeper/conf 2181 True /usr/bin/kinit /etc/security/keytabs/smokeuser.headless.keytab ambari-qa@EXAMPLE.COM', logoutput = True, path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'], tries = 3, @@ -76,7 +76,7 @@ class TestServiceCheck(RMFTestCase): content = StaticFile('zkSmoke.sh'), mode = 0755, ) - self.assertResourceCalled('Execute', '/tmp/zkSmoke.sh /usr/hdp/current/zookeeper-client/bin/zkCli.sh ambari-qa /etc/zookeeper/conf 2181 False /usr/bin/kinit no_keytab', + self.assertResourceCalled('Execute', '/tmp/zkSmoke.sh /usr/hdp/current/zookeeper-client/bin/zkCli.sh ambari-qa /etc/zookeeper/conf 2181 False /usr/bin/kinit no_keytab no_principal', logoutput = True, path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'], tries = 3, http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/test/python/stacks/2.0.6/configs/secured.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/secured.json b/ambari-server/src/test/python/stacks/2.0.6/configs/secured.json index 119ab88..02403e8 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/configs/secured.json +++ b/ambari-server/src/test/python/stacks/2.0.6/configs/secured.json @@ -476,6 +476,7 @@ "security_enabled": "true", "ignore_groupsusers_create": "false", "smokeuser": "ambari-qa", + "smokeuser_principal_name": "ambari-qa@EXAMPLE.COM", "kerberos_domain": "EXAMPLE.COM", "user_group": "hadoop", "smokeuser_keytab": "/etc/security/keytabs/smokeuser.headless.keytab", http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/test/python/stacks/2.1/configs/secured.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.1/configs/secured.json b/ambari-server/src/test/python/stacks/2.1/configs/secured.json index 7f8fd68..1857e4c 100644 --- a/ambari-server/src/test/python/stacks/2.1/configs/secured.json +++ b/ambari-server/src/test/python/stacks/2.1/configs/secured.json @@ -517,6 +517,7 @@ "security_enabled": "true", "ignore_groupsusers_create": "false", "smokeuser": "ambari-qa", + "smokeuser_principal_name": "ambari-qa@EXAMPLE.COM", "kerberos_domain": "EXAMPLE.COM", "user_group": "hadoop", "smokeuser_keytab": "/etc/security/keytabs/smokeuser.headless.keytab", http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/test/python/stacks/2.2/SLIDER/test_slider_client.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.2/SLIDER/test_slider_client.py b/ambari-server/src/test/python/stacks/2.2/SLIDER/test_slider_client.py index f6dfbc0..9ad4b02 100644 --- a/ambari-server/src/test/python/stacks/2.2/SLIDER/test_slider_client.py +++ b/ambari-server/src/test/python/stacks/2.2/SLIDER/test_slider_client.py @@ -80,7 +80,7 @@ class TestSliderClient(RMFTestCase): ) self.assertResourceCalled('Execute', - '/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab ambari-qa; /usr/lib/slider/bin/slider list', + '/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab ambari-qa@EXAMPLE.COM; /usr/lib/slider/bin/slider list', logoutput=True, tries=3, user='ambari-qa', http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-server/src/test/python/stacks/2.2/configs/secured.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.2/configs/secured.json b/ambari-server/src/test/python/stacks/2.2/configs/secured.json index 2d020f6..ea64240 100644 --- a/ambari-server/src/test/python/stacks/2.2/configs/secured.json +++ b/ambari-server/src/test/python/stacks/2.2/configs/secured.json @@ -44,6 +44,7 @@ "kerberos_domain": "EXAMPLE.COM", "user_group": "hadoop", "smokeuser_keytab": "/etc/security/keytabs/smokeuser.headless.keytab", + "smokeuser_principal_name": "ambari-qa@EXAMPLE.COM", "kinit_path_local": "/usr/bin" }, "webhcat-site": {