Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 53711200BCC for ; Tue, 29 Nov 2016 18:56:12 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 52C01160B36; Tue, 29 Nov 2016 17:56:12 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9972C160AFC for ; Tue, 29 Nov 2016 18:56:09 +0100 (CET) Received: (qmail 44337 invoked by uid 500); 29 Nov 2016 17:56:08 -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 44328 invoked by uid 99); 29 Nov 2016 17:56:08 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Nov 2016 17:56:08 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 932D7E02AB; Tue, 29 Nov 2016 17:56:08 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ncole@apache.org To: commits@ambari.apache.org Date: Tue, 29 Nov 2016 17:56:08 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [01/55] [abbrv] ambari git commit: AMBARI-18826. Stack property definitions made in ambari-web should be made stack agnostic (akovalenko) archived-at: Tue, 29 Nov 2016 17:56:12 -0000 Repository: ambari Updated Branches: refs/heads/branch-feature-AMBARI-18634 f4c2dbff3 -> 2c7c0a704 http://git-wip-us.apache.org/repos/asf/ambari/blob/2ce9e3b6/ambari-web/app/data/configs/wizards/secure_mapping.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/data/configs/wizards/secure_mapping.js b/ambari-web/app/data/configs/wizards/secure_mapping.js new file mode 100644 index 0000000..8d952e8 --- /dev/null +++ b/ambari-web/app/data/configs/wizards/secure_mapping.js @@ -0,0 +1,1004 @@ +/** + * 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. + */ + +var App = require('app'); +// All of the "name" properties have to coincide with how they will appear in the *-site.xml file +// The "template" properties can come from the config properties in site_properties.js or secure_properties.js . +var props = [ + { + "name": "hadoop.security.authentication", + "templateName": [], + "foreignKey": null, + "value": "kerberos", + "nonSecureValue": "simple", + "filename": "core-site.xml", + "serviceName": "HDFS" + }, + { + "name": "hadoop.security.authorization", + "templateName": [], + "foreignKey": null, + "value": "true", + "nonSecureValue": "false", + "filename": "core-site.xml", + "serviceName": "HDFS" + }, + { + "name": "hadoop.security.auth_to_local", + "templateName": ["resourcemanager_primary_name", "kerberos_domain", "yarn_user", "nodemanager_primary_name", "namenode_primary_name", "hdfs_user", "datanode_primary_name", "hbase_master_primary_name", "hbase_user","hbase_regionserver_primary_name","oozie_primary_name","oozie_user","jobhistory_primary_name","mapred_user","journalnode_principal_name","falcon_primary_name","falcon_user"], + "foreignKey": null, + "value": "RULE:[2:$1@$0](@.*)s/.*//\nRULE:[2:$1@$0](@.*)s/.*//\nRULE:[2:$1@$0](@.*)s/.*//\nRULE:[2:$1@$0](@.*)s/.*//\nRULE:[2:$1@$0](@.*)s/.*//\nRULE:[2:$1@$0](@.*)s/.*//\nRULE:[2:$1@$0](@.*)s/.*//\nRULE:[2:$1@$0](@.*)s/.*//\nRULE:[2:$1@$0](@.*)s/.*//\nRULE:[2:$1@$0](@.*)s/.*//\nDEFAULT", + "filename": "core-site.xml", + "serviceName": "HDFS", + "dependedServiceName": [{name: "HBASE", replace: "\nRULE:[2:$1@$0](@.*)s/.*//\nRULE:[2:$1@$0](@.*)s/.*//"},{name: "OOZIE",replace: "\nRULE:[2:$1@$0](@.*)s/.*//"},{name: "MAPREDUCE2",replace: "\nRULE:[2:$1@$0](@.*)s/.*//"}] + }, + { + "name": "dfs.namenode.kerberos.principal", + "templateName": ["namenode_principal_name", "kerberos_domain"], + "foreignKey": null, + "value": "@", + "filename": "hdfs-site.xml", + "serviceName": "HDFS" + }, + { + "name": "dfs.namenode.keytab.file", + "templateName": ["namenode_keytab"], + "foreignKey": null, + "value": "", + "filename": "hdfs-site.xml", + "serviceName": "HDFS" + }, + { + "name": "dfs.secondary.namenode.kerberos.principal", + "templateName": ["snamenode_principal_name", "kerberos_domain"], + "foreignKey": null, + "value": "@", + "filename": "hdfs-site.xml", + "serviceName": "HDFS" + }, + { + "name": "dfs.secondary.namenode.keytab.file", + "templateName": ["snamenode_keytab"], + "foreignKey": null, + "value": "", + "filename": "hdfs-site.xml", + "serviceName": "HDFS" + }, + { + "name": "dfs.web.authentication.kerberos.principal", + "templateName": ["hadoop_http_principal_name", "kerberos_domain"], + "foreignKey": null, + "value": "@", + "filename": "hdfs-site.xml", + "serviceName": "HDFS" + }, + { + "name": "dfs.web.authentication.kerberos.keytab", + "templateName": ["hadoop_http_keytab"], + "foreignKey": null, + "value": "", + "filename": "hdfs-site.xml", + "serviceName": "HDFS" + }, + { + "name": "dfs.datanode.kerberos.principal", + "templateName": ["datanode_principal_name", "kerberos_domain"], + "foreignKey": null, + "value": "@", + "filename": "hdfs-site.xml", + "serviceName": "HDFS" + }, + { + "name": "dfs.datanode.keytab.file", + "templateName": ["datanode_keytab"], + "foreignKey": null, + "value": "", + "filename": "hdfs-site.xml", + "serviceName": "HDFS" + }, + { + "name": "dfs.namenode.kerberos.internal.spnego.principal", + "templateName": [], + "foreignKey": null, + "value": "${dfs.web.authentication.kerberos.principal}", + "filename": "hdfs-site.xml", + "serviceName": "HDFS" + }, + { + "name": "dfs.secondary.namenode.kerberos.internal.spnego.principal", + "templateName": [], + "foreignKey": null, + "value": "${dfs.web.authentication.kerberos.principal}", + "filename": "hdfs-site.xml", + "serviceName": "HDFS" + }, + { + "name": "dfs.journalnode.kerberos.principal", + "templateName": ["journalnode_principal_name", "kerberos_domain"], + "foreignKey": null, + "value": "@", + "filename": "hdfs-site.xml", + "serviceName": "HDFS" + }, + { + "name": "dfs.journalnode.kerberos.internal.spnego.principal", + "templateName": ["hadoop_http_principal_name", "kerberos_domain"], + "foreignKey": null, + "value": "@", + "filename": "hdfs-site.xml", + "serviceName": "HDFS" + }, + { + "name": "dfs.journalnode.keytab.file", + "templateName": ["journalnode_keytab"], + "foreignKey": null, + "value": "", + "filename": "hdfs-site.xml", + "serviceName": "HDFS" + }, + { + "name": "dfs.datanode.address", + "templateName": ["dfs_datanode_address"], + "foreignKey": null, + "value": "0.0.0.0:", + "nonSecureValue": "0.0.0.0:50010", + "filename": "hdfs-site.xml", + "serviceName": "HDFS" + }, + { + "name": "dfs.datanode.http.address", + "templateName": ["dfs_datanode_http_address"], + "foreignKey": null, + "value": "0.0.0.0:", + "nonSecureValue": "0.0.0.0:50075", + "filename": "hdfs-site.xml", + "serviceName": "HDFS" + }, + { + "name": "mapreduce.jobhistory.principal", + "templateName": ["jobhistory_principal_name", "kerberos_domain"], + "foreignKey": null, + "value": "@", + "filename": "mapred-site.xml", + "serviceName": "MAPREDUCE2" + }, + { + "name": "mapreduce.jobhistory.keytab", + "templateName": ["jobhistory_keytab"], + "foreignKey": null, + "value": "", + "filename": "mapred-site.xml", + "serviceName": "MAPREDUCE2" + }, + { + "name": "mapreduce.jobhistory.webapp.spnego-principal", + "templateName": ["jobhistory_http_principal_name", "kerberos_domain"], + "foreignKey": null, + "value": "@", + "filename": "mapred-site.xml", + "serviceName": "MAPREDUCE2" + }, + { + "name": "mapreduce.jobhistory.webapp.spnego-keytab-file", + "templateName": ["jobhistory_http_keytab"], + "foreignKey": null, + "value": "", + "filename": "mapred-site.xml", + "serviceName": "MAPREDUCE2" + }, + { + "name": "yarn.timeline-service.enabled", + "templateName": [], + "foreignKey": null, + "value": "true", + "nonSecureValue": "false", + "filename": "yarn-site.xml", + "serviceName": "YARN" + }, + { + "name": "yarn.acl.enable", + "templateName": [], + "foreignKey": null, + "value": "true", + "nonSecureValue": "false", + "filename": "yarn-site.xml", + "serviceName": "YARN" + }, + // YARN Timeline Service + // These "http-authentication" properties are supported in HDP Champlain + { + "name": "yarn.timeline-service.principal", + "templateName": ["apptimelineserver_principal_name", "kerberos_domain"], + "foreignKey": null, + "value": "@", + "filename": "yarn-site.xml", + "serviceName": "YARN" + }, + { + "name": "yarn.timeline-service.keytab", + "templateName": ["apptimelineserver_keytab"], + "foreignKey": null, + "value": "", + "filename": "yarn-site.xml", + "serviceName": "YARN" + }, + { + "name": "yarn.timeline-service.http-authentication.type", + "templateName": [], + "foreignKey": null, + "value": "kerberos", + "filename": "yarn-site.xml", + "serviceName": "YARN" + }, + { + "name": "yarn.timeline-service.http-authentication.kerberos.principal", + "templateName": ["apptimelineserver_http_principal_name", "kerberos_domain"], + "foreignKey": null, + "value": "@", + "filename": "yarn-site.xml", + "serviceName": "YARN" + }, + { + "name": "yarn.timeline-service.http-authentication.kerberos.keytab", + "templateName": ["apptimelineserver_http_keytab"], + "foreignKey": null, + "value": "", + "filename": "yarn-site.xml", + "serviceName": "YARN" + }, + // YARN Resource Manager + { + "name": "yarn.resourcemanager.principal", + "templateName": ["resourcemanager_principal_name", "kerberos_domain"], + "foreignKey": null, + "value": "@", + "filename": "yarn-site.xml", + "serviceName": "YARN" + }, + { + "name": "yarn.resourcemanager.keytab", + "templateName": ["resourcemanager_keytab"], + "foreignKey": null, + "value": "", + "filename": "yarn-site.xml", + "serviceName": "YARN" + }, + { + "name": "yarn.nodemanager.principal", + "templateName": ["nodemanager_principal_name", "kerberos_domain"], + "foreignKey": null, + "value": "@", + "filename": "yarn-site.xml", + "serviceName": "YARN" + }, + { + "name": "yarn.nodemanager.keytab", + "templateName": ["nodemanager_keytab"], + "foreignKey": null, + "value": "", + "filename": "yarn-site.xml", + "serviceName": "YARN" + }, + { + "name": "yarn.resourcemanager.webapp.spnego-principal", + "templateName": ["resourcemanager_http_principal_name", "kerberos_domain"], + "foreignKey": null, + "value": "@", + "filename": "yarn-site.xml", + "serviceName": "YARN" + }, + { + "name": "yarn.resourcemanager.webapp.spnego-keytab-file", + "templateName": ["resourcemanager_http_keytab"], + "foreignKey": null, + "value": "", + "filename": "yarn-site.xml", + "serviceName": "YARN" + }, + { + "name": "yarn.nodemanager.webapp.spnego-principal", + "templateName": ["nodemanager_http_principal_name", "kerberos_domain"], + "foreignKey": null, + "value": "@", + "filename": "yarn-site.xml", + "serviceName": "YARN" + }, + { + "name": "yarn.nodemanager.webapp.spnego-keytab-file", + "templateName": ["nodemanager_http_keytab"], + "foreignKey": null, + "value": "", + "filename": "yarn-site.xml", + "serviceName": "YARN" + }, + { + "name": "yarn.nodemanager.container-executor.class", + "templateName": ["yarn_nodemanager_container-executor_class"], + "foreignKey": null, + "value": "", + "nonSecureValue": "org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor", + "filename": "yarn-site.xml", + "serviceName": "YARN" + }, + { + "name": "hbase.master.kerberos.principal", + "templateName": ["hbase_master_principal_name", "kerberos_domain"], + "foreignKey": null, + "value": "@", + "filename": "hbase-site.xml", + "serviceName": "HBASE" + }, + { + "name": "hbase.master.keytab.file", + "templateName": ["hbase_master_keytab"], + "foreignKey": null, + "value": "", + "filename": "hbase-site.xml", + "serviceName": "HBASE" + }, + { + "name": "hbase.regionserver.kerberos.principal", + "templateName": ["hbase_regionserver_principal_name", "kerberos_domain"], + "foreignKey": null, + "value": "@", + "filename": "hbase-site.xml", + "serviceName": "HBASE" + }, + { + "name": "hbase.regionserver.keytab.file", + "templateName": ["hbase_regionserver_keytab"], + "foreignKey": null, + "value": "", + "filename": "hbase-site.xml", + "serviceName": "HBASE" + }, + { + "name": "hive.metastore.sasl.enabled", + "templateName": [], + "foreignKey": null, + "value": "true", + "nonSecureValue": "false", + "filename": "hive-site.xml", + "serviceName": "HIVE" + }, + { + "name": "hive.security.authorization.enabled", + "templateName": [], + "foreignKey": null, + "value": "true", + "nonSecureValue": "false", + "filename": "hive-site.xml", + "serviceName": "HIVE" + }, + { + "name": "hive.server2.authentication", + "templateName": [], + "foreignKey": null, + "value": "KERBEROS", + "nonSecureValue": "NONE", + "filename": "hive-site.xml", + "serviceName": "HIVE" + }, + { + "name": "hive.metastore.kerberos.principal", + "templateName": ["hive_metastore_principal_name", "kerberos_domain"], + "foreignKey": null, + "value": "@", + "filename": "hive-site.xml", + "serviceName": "HIVE" + }, + { + "name": "hive.metastore.kerberos.keytab.file", + "templateName": ["hive_metastore_keytab"], + "foreignKey": null, + "value": "", + "filename": "hive-site.xml", + "serviceName": "HIVE" + }, + { + "name": "hive.server2.authentication.kerberos.principal", + "templateName": ["hive_metastore_principal_name", "kerberos_domain"], + "foreignKey": null, + "value": "@", + "filename": "hive-site.xml", + "serviceName": "HIVE" + }, + { + "name": "hive.server2.authentication.kerberos.keytab", + "templateName": ["hive_metastore_keytab"], + "foreignKey": null, + "value": "", + "filename": "hive-site.xml", + "serviceName": "HIVE" + }, + { + "name": "hive.server2.authentication.spnego.principal", + "templateName": ["hive_metastore_http_principal_name", "kerberos_domain"], + "foreignKey": null, + "value": "@", + "filename": "hive-site.xml", + "serviceName": "HIVE" + }, + { + "name": "hive.server2.authentication.spnego.keytab", + "templateName": ["hive_metastore_http_keytab"], + "foreignKey": null, + "value": "", + "filename": "hive-site.xml", + "serviceName": "HIVE" + }, + { + "name": "oozie.service.AuthorizationService.authorization.enabled", + "templateName": [], + "foreignKey": null, + "value": "true", + "filename": "oozie-site.xml", + "serviceName": "OOZIE" + }, + { + "name": "oozie.service.HadoopAccessorService.kerberos.enabled", + "templateName": [], + "foreignKey": null, + "value": "true", + "nonSecureValue": "false", + "filename": "oozie-site.xml", + "serviceName": "OOZIE" + }, + { + "name": "local.realm", + "templateName": ["kerberos_domain"], + "foreignKey": null, + "value": "", + "filename": "oozie-site.xml", + "serviceName": "OOZIE" + }, + { + "name": "oozie.service.HadoopAccessorService.keytab.file", + "templateName": ["oozie_keytab"], + "foreignKey": null, + "value": "", + "filename": "oozie-site.xml", + "serviceName": "OOZIE" + }, + { + "name": "oozie.service.HadoopAccessorService.kerberos.principal", + "templateName": ["oozie_principal_name", "kerberos_domain"], + "foreignKey": null, + "value": "@", + "filename": "oozie-site.xml", + "serviceName": "OOZIE" + }, + { + "name": "oozie.authentication.type", + "templateName": [], + "foreignKey": null, + "value": "kerberos", + "nonSecureValue": "simple", + "filename": "oozie-site.xml", + "serviceName": "OOZIE" + }, + { + "name": "oozie.authentication.kerberos.principal", + "templateName": ["oozie_http_principal_name", "kerberos_domain"], + "foreignKey": null, + "value": "@", + "filename": "oozie-site.xml", + "serviceName": "OOZIE" + }, + { + "name": "oozie.authentication.kerberos.keytab", + "templateName": ["oozie_http_keytab"], + "foreignKey": null, + "value": "", + "filename": "oozie-site.xml", + "serviceName": "OOZIE" + }, + { + "name": "oozie.authentication.kerberos.name.rules", + "templateName": ["resourcemanager_primary_name", "kerberos_domain", "yarn_user", "nodemanager_primary_name", "namenode_primary_name", "hdfs_user", "datanode_primary_name", "hbase_master_primary_name", "hbase_user","hbase_regionserver_primary_name"], + "foreignKey": null, + "value": "RULE:[2:$1@$0](@.*)s/.*//\nRULE:[2:$1@$0](@.*)s/.*//\nRULE:[2:$1@$0](@.*)s/.*//\nRULE:[2:$1@$0](@.*)s/.*//\nRULE:[2:$1@$0](@.*)s/.*//\nRULE:[2:$1@$0](@.*)s/.*//\nDEFAULT", + "filename": "oozie-site.xml", + "serviceName": "OOZIE", + "dependedServiceName": [{name: "HBASE", replace: "\nRULE:[2:$1@$0](@.*)s/.*//\nRULE:[2:$1@$0](@.*)s/.*//"}] + }, + { + "name": "templeton.kerberos.principal", + "templateName": ["webHCat_http_principal_name", "kerberos_domain"], + "foreignKey": null, + "value": "@", + "filename": "webhcat-site.xml", + "serviceName": "HIVE" + }, + { + "name": "templeton.kerberos.keytab", + "templateName": ["webhcat_http_keytab"], + "foreignKey": null, + "value": "", + "filename": "webhcat-site.xml", + "serviceName": "HIVE" + }, + { + "name": "templeton.kerberos.secret", + "templateName": [""], + "foreignKey": null, + "value": "secret", + "filename": "webhcat-site.xml", + "serviceName": "HIVE" + }, + { + "name": "templeton.hive.properties", + "templateName": ["hive_metastore","hive_metastore_principal_name","kerberos_domain"], + "foreignKey": null, + "value": "hive.metastore.local=false,hive.metastore.uris=,hive." + + "metastore.sasl.enabled=true,hive.metastore.execute.setugi=true,hive.metastore.warehouse.dir=/apps/hive/warehouse,hive.exec.mode.local.auto=false,hive.metastore.kerberos.principal=@", + "filename": "webhcat-site.xml", + "serviceName": "HIVE" + }, + { + "name": "hbase.security.authentication", + "templateName": [], + "foreignKey": null, + "value": "kerberos", + "nonSecureValue": "simple", + "filename": "hbase-site.xml", + "serviceName": "HBASE" + }, + { + "name": "hbase.security.authorization", + "templateName": [], + "foreignKey": null, + "value": "true", + "nonSecureValue": "false", + "filename": "hbase-site.xml", + "serviceName": "HBASE" + }, + { + "name": "hbase.bulkload.staging.dir", + "templateName": [], + "foreignKey": null, + "value": "/apps/hbase/staging", + "filename": "hbase-site.xml", + "serviceName": "HBASE" + }, + { + "name": "zookeeper.znode.parent", + "templateName": [], + "foreignKey": null, + "value": "/hbase-secure", + "nonSecureValue": "/hbase-unsecure", + "filename": "hbase-site.xml", + "serviceName": "HBASE" + }, + + /***************************************FALCON***********************************************/ + { + "name": "*.falcon.authentication.type", + "templateName": [], + "foreignKey": null, + "value": "kerberos", + "nonSecureValue": "simple", + "filename": "falcon-startup.properties.xml", + "serviceName": "FALCON" + }, + { + "name": "*.falcon.http.authentication.type", + "templateName": [], + "foreignKey": null, + "value": "kerberos", + "nonSecureValue": "simple", + "filename": "falcon-startup.properties.xml", + "serviceName": "FALCON" + }, + { + "name": "*.falcon.service.authentication.kerberos.principal", + "templateName": ["falcon_principal_name", "kerberos_domain"], + "foreignKey": null, + "value": "@", + "filename": "falcon-startup.properties.xml", + "serviceName": "FALCON" + }, + { + "name": "*.falcon.service.authentication.kerberos.keytab", + "templateName": ["falcon_keytab"], + "foreignKey": null, + "value": "", + "filename": "falcon-startup.properties.xml", + "serviceName": "FALCON" + }, + { + "name": "*.falcon.http.authentication.kerberos.principal", + "templateName": ["falcon_http_principal_name", "kerberos_domain"], + "foreignKey": null, + "value": "@", + "filename": "falcon-startup.properties.xml", + "serviceName": "FALCON" + }, + { + "name": "*.falcon.http.authentication.kerberos.keytab", + "templateName": ["falcon_http_keytab"], + "foreignKey": null, + "value": "", + "filename": "falcon-startup.properties.xml", + "serviceName": "FALCON" + }, + { + "name": "*.dfs.namenode.kerberos.principal", + "templateName": ["namenode_principal_name_falcon", "kerberos_domain"], + "foreignKey": null, + "value": "@", + "filename": "falcon-startup.properties.xml", + "serviceName": "FALCON" + }, + + /***************************************KNOX***********************************************/ + { + "name": "gateway.hadoop.kerberos.secured", + "templateName": [], + "foreignKey": null, + "value": "true", + "nonSecureValue": "false", + "filename": "gateway-site.xml", + "serviceName": "KNOX" + }, + { + "name": "java.security.krb5.conf", + "templateName": [], + "foreignKey": null, + "value": "/etc/krb5.conf", + "filename": "gateway-site.xml", + "serviceName": "KNOX" + }, + { + "name": "hadoop.proxyuser..groups", + "templateName": ["proxyuser_group"], + "foreignKey": ["knox_primary_name"], + "value": "", + "filename": "core-site.xml", + "serviceName": "KNOX" + }, + { + "name": "hadoop.proxyuser..hosts", + "templateName": ["knox_gateway_hosts"], + "foreignKey": ["knox_primary_name"], + "value": "", + "filename": "core-site.xml", + "serviceName": "KNOX" + }, + { + "name": "webhcat.proxyuser..groups", + "templateName": ["proxyuser_group"], + "foreignKey": ["knox_primary_name"], + "value": "", + "filename": "webhcat-site.xml", + "serviceName": "KNOX" + }, + { + "name": "webhcat.proxyuser..hosts", + "templateName": ["knox_gateway_hosts"], + "foreignKey": ["knox_primary_name"], + "value": "", + "filename": "webhcat-site.xml", + "serviceName": "KNOX" + }, + { + "name": "oozie.service.ProxyUserService.proxyuser..groups", + "templateName": ["proxyuser_group"], + "foreignKey": ["knox_primary_name"], + "value": "", + "filename": "oozie-site.xml", + "serviceName": "KNOX" + }, + { + "name": "oozie.service.ProxyUserService.proxyuser..hosts", + "templateName": ["knox_gateway_hosts"], + "foreignKey": ["knox_primary_name"], + "value": "", + "filename": "oozie-site.xml", + "serviceName": "KNOX" + }, +/***************************************core-site***************************************************/ + { + "name": "hadoop.proxyuser..groups", + "templateName": ["proxyuser_group"], + "foreignKey": ["hive_metastore_primary_name"], + "value": "", + "filename": "core-site.xml", + "serviceName": "HIVE" + }, + { + "name": "hadoop.proxyuser..hosts", + "templateName": ["hive_metastore"], + "foreignKey": ["hive_metastore_primary_name"], + "value": "", + "filename": "core-site.xml", + "serviceName": "HIVE" + }, + { + "name": "hadoop.proxyuser..groups", + "templateName": ["proxyuser_group"], + "foreignKey": ["oozie_primary_name"], + "value": "", + "filename": "core-site.xml", + "serviceName": "OOZIE" + }, + { + "name": "hadoop.proxyuser..hosts", + "templateName": ["oozieserver_host"], + "foreignKey": ["oozie_primary_name"], + "value": "", + "filename": "core-site.xml", + "serviceName": "OOZIE" + }, + { + "name": "hadoop.proxyuser..groups", + "templateName": ["proxyuser_group"], + "foreignKey": ["webHCat_http_primary_name"], + "value": "", + "filename": "core-site.xml", + "serviceName": "HIVE" + }, + { + "name": "hadoop.proxyuser..hosts", + "templateName": ["webhcat_server"], + "foreignKey": ["webHCat_http_primary_name"], + "value": "", + "filename": "core-site.xml", + "serviceName": "HIVE" + } +]; + +var yarn22Mapping = [ + { + "name": 'hadoop.http.authentication.kerberos.principal', + "templateName": ["hadoop_http_principal_name", "kerberos_domain"], + "foreignKey": null, + "value": "@", + "serviceName": "HDFS", + "filename": "core-site.xml" + }, + { + "name": 'hadoop.http.authentication.kerberos.keytab', + "foreignKey": null, + "templateName": ["hadoop_http_keytab"], + "value": "", + "serviceName": "HDFS", + "filename": "core-site.xml" + }, + { + name: 'hadoop.http.authentication.kerberos.name.rules', + templateName: [], + foreignKey: null, + value: "", + "serviceName": "HDFS", + "filename": "core-site.xml" + }, + { + "name": 'yarn.timeline-service.http-authentication.signature.secret', + "templateName": [], + "foreignKey": null, + "value": "", + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.timeline-service.http-authentication.signature.secret.file', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.timeline-service.http-authentication.signer.secret.provider', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.timeline-service.http-authentication.signer.secret.provider.object', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + + "name": 'yarn.timeline-service.http-authentication.token.validity', + "templateName": [], + "foreignKey": null, + "value": "", + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.timeline-service.http-authentication.cookie.domain', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.timeline-service.http-authentication.cookie.path', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.timeline-service.http-authentication.simple.anonymous.allowed', + "value": "true", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.timeline-service.http-authentication.proxyusers.*.hosts', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.timeline-service.http-authentication.proxyusers.*.users', + "value": "", + "serviceName": "YARN", + "templateName": [], + "foreignKey": null, + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.timeline-service.http-authentication.proxyusers.*.groups', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'hadoop.http.filter.initializers', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "HDFS", + "filename": "core-site.xml" + }, + { + "name": 'hadoop.http.authentication.type', + "value": "simple", + "templateName": [], + "foreignKey": null, + "serviceName": "HDFS", + "filename": "core-site.xml" + }, + { + "name": 'hadoop.http.authentication.signature.secret', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "HDFS", + "filename": "core-site.xml" + }, + { + "name": 'hadoop.http.authentication.signature.secret.file', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "HDFS", + "filename": "core-site.xml" + }, + { + "name": 'hadoop.http.authentication.signer.secret.provider', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "HDFS", + "filename": "core-site.xml" + }, + { + "name": 'hadoop.http.authentication.signer.secret.provider.object', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "HDFS", + "filename": "core-site.xml" + }, + { + "name": 'hadoop.http.authentication.token.validity', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "HDFS", + "filename": "core-site.xml" + }, + { + "name": 'hadoop.http.authentication.cookie.domain', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "HDFS", + "filename": "core-site.xml" + }, + { + "name": 'hadoop.http.authentication.cookie.path', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "HDFS", + "filename": "core-site.xml" + }, + { + "name": 'yarn.timeline-service.http-authentication.kerberos.name.rules', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.resourcemanager.proxyusers.*.hosts', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.resourcemanager.proxyusers.*.users', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.resourcemanager.proxyusers.*.groups', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.resourcemanager.proxy-user-privileges.enabled', + "value": "true", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.nodemanager.linux-container-executor.cgroups.mount-path', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + } +]; + +props.pushObjects(yarn22Mapping); + +module.exports = props; http://git-wip-us.apache.org/repos/asf/ambari/blob/2ce9e3b6/ambari-web/app/data/custom_stack_map.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/data/custom_stack_map.js b/ambari-web/app/data/custom_stack_map.js index e52c570..55b3a10 100644 --- a/ambari-web/app/data/custom_stack_map.js +++ b/ambari-web/app/data/custom_stack_map.js @@ -16,8 +16,6 @@ * limitations under the License. */ -var App = require('app'); - /* sign will be compared like: sign if true use this baseStackFolder Example: http://git-wip-us.apache.org/repos/asf/ambari/blob/2ce9e3b6/ambari-web/app/mappers/configs/stack_config_properties_mapper.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mappers/configs/stack_config_properties_mapper.js b/ambari-web/app/mappers/configs/stack_config_properties_mapper.js index 2c8959d..9b4b920 100644 --- a/ambari-web/app/mappers/configs/stack_config_properties_mapper.js +++ b/ambari-web/app/mappers/configs/stack_config_properties_mapper.js @@ -218,7 +218,7 @@ App.stackConfigPropertiesMapper = App.QuickDataMapper.create({ * @param configs */ addUIOnlyProperties: function(configs) { - require('data/HDP2/ui_properties').concat(require('data/HDP2/alert_notification')).forEach(function(p) { + require('data/configs/ui_properties').concat(require('data/configs/alert_notification')).forEach(function(p) { if(p.name == "dfs.ha.fencing.methods" && !App.get('isHaEnabled')) return; configs.push({ http://git-wip-us.apache.org/repos/asf/ambari/blob/2ce9e3b6/ambari-web/app/mixins/wizard/addSecurityConfigs.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mixins/wizard/addSecurityConfigs.js b/ambari-web/app/mixins/wizard/addSecurityConfigs.js index 7e495ea..b5f3e6a 100644 --- a/ambari-web/app/mixins/wizard/addSecurityConfigs.js +++ b/ambari-web/app/mixins/wizard/addSecurityConfigs.js @@ -27,7 +27,7 @@ App.AddSecurityConfigs = Em.Mixin.create({ kerberosDescriptor: {}, - kerberosDescriptorProperties: require('data/HDP2/kerberos_descriptor_properties'), + kerberosDescriptorProperties: require('data/configs/wizards/kerberos_descriptor_properties'), /** * security configs, which values should be modified after APPLY CONFIGURATIONS stage http://git-wip-us.apache.org/repos/asf/ambari/blob/2ce9e3b6/ambari-web/app/models/stack_service.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/stack_service.js b/ambari-web/app/models/stack_service.js index 0136ec3..64f3b36 100644 --- a/ambari-web/app/models/stack_service.js +++ b/ambari-web/app/models/stack_service.js @@ -17,6 +17,7 @@ */ var App = require('app'); +var stringUtils = require('utils/string_utils'); require('utils/helper'); require('models/configs/objects/service_config_category'); @@ -179,7 +180,17 @@ App.StackService = DS.Model.extend({ }); } return configCategories; - }.property('serviceName', 'configTypes', 'serviceComponents') + }.property('serviceName', 'configTypes', 'serviceComponents'), + + /** + * Compare specified version with current service version + * @param {string} version [description] + * @return {number} 0 - equal, -1 - less, +1 - more @see stringUtils#compareVersions + */ + compareCurrentVersion: function(version) { + var toMinor = this.get('serviceVersion').split('.').slice(0, 2).join('.'); + return stringUtils.compareVersions(toMinor, version); + } }); App.StackService.FIXTURES = []; http://git-wip-us.apache.org/repos/asf/ambari/blob/2ce9e3b6/ambari-web/app/utils/config.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js index 665497b..cd09e14 100644 --- a/ambari-web/app/utils/config.js +++ b/ambari-web/app/utils/config.js @@ -131,7 +131,7 @@ App.config = Em.Object.create({ this.set('preDefinedServiceConfigs', allTabs); }, - secureConfigs: require('data/HDP2/secure_mapping'), + secureConfigs: require('data/configs/wizards/secure_mapping'), secureConfigsMap: function () { var ret = {}; @@ -141,7 +141,7 @@ App.config = Em.Object.create({ return ret; }.property('secureConfigs.[]'), - kerberosIdentities: require('data/HDP2/kerberos_identities').configProperties, + kerberosIdentities: require('data/configs/wizards/kerberos_identities').configProperties, kerberosIdentitiesMap: function() { var map = {}; @@ -177,23 +177,14 @@ App.config = Em.Object.create({ return baseStackFolder; }, - allPreDefinedSiteProperties: function() { - var sitePropertiesForCurrentStack = this.preDefinedConfigFile(this.mapCustomStack(), 'site_properties'); - if (sitePropertiesForCurrentStack) { - return sitePropertiesForCurrentStack.configProperties; - } else if (App.get('isHadoop23Stack')) { - return require('data/HDP2.3/site_properties').configProperties; - } else { - return require('data/HDP2.2/site_properties').configProperties; - } - }.property('App.isHadoop23Stack'), + allPreDefinedSiteProperties: require('data/configs/site_properties').configProperties, preDefinedSiteProperties: function () { var serviceNames = App.StackService.find().mapProperty('serviceName').concat('MISC'); return this.get('allPreDefinedSiteProperties').filter(function(p) { return serviceNames.contains(p.serviceName); }); - }.property('allPreDefinedSiteProperties'), + }.property().volatile(), /** * map of preDefinedSiteProperties provide search by index @@ -208,14 +199,6 @@ App.config = Em.Object.create({ return map; }.property('preDefinedSiteProperties'), - preDefinedConfigFile: function(folder, file) { - try { - return require('data/{0}/{1}'.format(folder, file)); - } catch (err) { - // the file doesn't exist, which might be expected. - } - }, - serviceByConfigTypeMap: function () { var ret = {}; App.StackService.find().forEach(function(s) { http://git-wip-us.apache.org/repos/asf/ambari/blob/2ce9e3b6/ambari-web/app/views/common/controls_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/controls_view.js b/ambari-web/app/views/common/controls_view.js index 1fd5fde..37d7165 100644 --- a/ambari-web/app/views/common/controls_view.js +++ b/ambari-web/app/views/common/controls_view.js @@ -1052,11 +1052,12 @@ App.CheckDBConnectionView = Ember.View.extend({ OOZIE: ['oozie.db.schema.name', 'oozie.service.JPAService.jdbc.username', 'oozie.service.JPAService.jdbc.password', 'oozie.service.JPAService.jdbc.driver', 'oozie.service.JPAService.jdbc.url'], HIVE: ['ambari.hive.db.schema.name', 'javax.jdo.option.ConnectionUserName', 'javax.jdo.option.ConnectionPassword', 'javax.jdo.option.ConnectionDriverName', 'javax.jdo.option.ConnectionURL'], KERBEROS: ['kdc_hosts'], - RANGER: App.get('isHadoop23Stack') ? ['db_user', 'db_password', 'db_name', 'ranger.jpa.jdbc.url', 'ranger.jpa.jdbc.driver'] : + RANGER: App.StackService.find('RANGER').compareCurrentVersion('0.5') > -1 ? + ['db_user', 'db_password', 'db_name', 'ranger.jpa.jdbc.url', 'ranger.jpa.jdbc.driver'] : ['db_user', 'db_password', 'db_name', 'ranger_jdbc_connection_url', 'ranger_jdbc_driver'] }; return propertiesMap[this.get('parentView.service.serviceName')]; - }.property('App.isHadoop23Stack'), + }.property(), /** @property {Object} propertiesPattern - check pattern according to type of connection properties **/ propertiesPattern: function() { var patterns = { http://git-wip-us.apache.org/repos/asf/ambari/blob/2ce9e3b6/ambari-web/app/views/main/dashboard/widgets/hbase_links.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/widgets/hbase_links.js b/ambari-web/app/views/main/dashboard/widgets/hbase_links.js index 235f73c..4f2053a 100644 --- a/ambari-web/app/views/main/dashboard/widgets/hbase_links.js +++ b/ambari-web/app/views/main/dashboard/widgets/hbase_links.js @@ -26,7 +26,9 @@ App.HBaseLinksView = App.LinkDashboardWidgetView.extend({ model_type: 'hbase', - port: App.get('isHadoop23Stack') ? '16010' : '60010', + port: function() { + return App.StackService.find('HBASE').compareCurrentVersion('1.1') > -1 ? '16010' : '60010'; + }.property(), componentName: 'HBASE_REGIONSERVER', @@ -54,4 +56,4 @@ App.HBaseLinksView = App.LinkDashboardWidgetView.extend({ return ''; } -}); \ No newline at end of file +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/2ce9e3b6/ambari-web/app/views/main/service/reassign/step5_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/reassign/step5_view.js b/ambari-web/app/views/main/service/reassign/step5_view.js index c5fc3c8..3a063b5 100644 --- a/ambari-web/app/views/main/service/reassign/step5_view.js +++ b/ambari-web/app/views/main/service/reassign/step5_view.js @@ -18,6 +18,7 @@ var App = require('app'); +var stringUtils = require('utils/string_utils'); App.ReassignMasterWizardStep5View = Em.View.extend({ @@ -28,7 +29,7 @@ App.ReassignMasterWizardStep5View = Em.View.extend({ return ''; } var - atsDir = App.get('isHadoop23Stack') ? "timeline-state-store.ldb" : "leveldb-timeline-store.ldb", + atsDir = App.StackService.find('YARN').compareCurrentVersion('2.7') > -1 ? "timeline-state-store.ldb" : "leveldb-timeline-store.ldb", componentDir = this.get('controller.content.componentDir') || '', componentDirCmd = componentDir.replace(/,/g, ' '), sourceHost = this.get('controller.content.reassignHosts.source'), http://git-wip-us.apache.org/repos/asf/ambari/blob/2ce9e3b6/ambari-web/copy-pluggable-stack-resources.sh ---------------------------------------------------------------------- diff --git a/ambari-web/copy-pluggable-stack-resources.sh b/ambari-web/copy-pluggable-stack-resources.sh index 4dc9205..9109583 100644 --- a/ambari-web/copy-pluggable-stack-resources.sh +++ b/ambari-web/copy-pluggable-stack-resources.sh @@ -45,4 +45,4 @@ if [ -f "$resources_dir/messages.js" ] then echo cp $resources_dir/messages.js app/messages.js cp $resources_dir/messages.js app/messages.js -fi \ No newline at end of file +fi http://git-wip-us.apache.org/repos/asf/ambari/blob/2ce9e3b6/ambari-web/test/controllers/main/host/details_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/main/host/details_test.js b/ambari-web/test/controllers/main/host/details_test.js index 154d0b2..9a56ab2 100644 --- a/ambari-web/test/controllers/main/host/details_test.js +++ b/ambari-web/test/controllers/main/host/details_test.js @@ -2557,12 +2557,16 @@ describe('App.MainHostDetailsController', function () { callback(); }); sinon.stub(controller, 'loadConfigs', Em.K); + sinon.stub(App.StackService, 'find').returns({ + compareCurrentVersion: function() {} + }); }); afterEach(function () { controller.removeHostComponentModel.restore(); controller.isServiceMetricsLoaded.restore(); controller.loadConfigs.restore(); + App.StackService.find.restore(); }); it('ZOOKEEPER_SERVER component', function () { @@ -2658,12 +2662,16 @@ describe('App.MainHostDetailsController', function () { sinon.stub(controller, 'loadConfigs'); sinon.stub(controller, 'isServiceMetricsLoaded', Em.clb); this.stub = sinon.stub(App.router, 'get'); + sinon.stub(App.StackService, 'find').returns({ + compareCurrentVersion: function() {} + }) }); afterEach(function () { controller.loadConfigs.restore(); controller.removeObserver.restore(); controller.isServiceMetricsLoaded.restore(); this.stub.restore(); + App.StackService.find.restore(); }); it('No operations of ZOOKEEPER_SERVER', function () { @@ -3484,32 +3492,43 @@ describe('App.MainHostDetailsController', function () { this.serviceMock = sinon.stub(App.Service, 'find'); sinon.stub(controller, 'loadConfigs'); this.mock = sinon.stub(App, 'get') + this.stackServiceMock = sinon.stub(App.StackService, 'find'); }); afterEach(function () { this.serviceMock.restore(); this.mock.restore(); controller.loadConfigs.restore(); + this.stackServiceMock.restore(); }); - it("storm not installed, hadoop stack is 2.2", function () { + it("should not update configs when storm not installed, storm version >= 0.10", function () { this.serviceMock.returns(Em.Object.create({ isLoaded: false })); this.mock.returns(false); + this.stackServiceMock.returns(App.StackService.createRecord({ + serviceVersion: '0.10.1.1' + })); controller.updateStormConfigs(); expect(controller.loadConfigs.called).to.be.false; }); - it("storm installed, hadoop stack is 2.2", function () { + it("should not update configs when storm installed, storm version is less 0.10", function () { this.serviceMock.returns(Em.Object.create({ isLoaded: true })); + this.stackServiceMock.returns(App.StackService.createRecord({ + serviceVersion: '0.9.1.1' + })); this.mock.returns(false); controller.updateStormConfigs(); expect(controller.loadConfigs.called).to.be.false; }); - it("storm installed, hadoop stack is 2.3", function () { + it("should update configs when storm installed, storm version >= 0.10", function () { this.serviceMock.returns(Em.Object.create({ isLoaded: true })); + this.stackServiceMock.returns(App.StackService.createRecord({ + serviceVersion: '0.10.1.1' + })); this.mock.returns(true); controller.updateStormConfigs(); expect(controller.loadConfigs.calledWith('loadStormConfigs')).to.be.true; http://git-wip-us.apache.org/repos/asf/ambari/blob/2ce9e3b6/ambari-web/test/data/HDP2.2/site_properties_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/data/HDP2.2/site_properties_test.js b/ambari-web/test/data/HDP2.2/site_properties_test.js deleted file mode 100644 index 14599b3..0000000 --- a/ambari-web/test/data/HDP2.2/site_properties_test.js +++ /dev/null @@ -1,76 +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. - */ - -require('utils/helper'); -require('data/HDP2/gluster_fs_properties'); -var siteProperties = require('data/HDP2.2/site_properties').configProperties; - -describe('hdp2SiteProperties', function () { - /** - * @stackProperties: All the properties that are derived from stack definition - */ - var stackProperties = siteProperties.filter(function(item){ - return !(item.isRequiredByAgent === false || item.category === 'Ambari Principals') - }); - - stackProperties.forEach(function(siteProperty){ - /** - * Following config attributes are stack driven and should be defined in the stack metainfo instead of ambari-web site-properties file - * isVisible - * isOverridable - * value - * recommendedValue - * isReconfigurable - * isRequired - * displayName - * description - * showLabel - * unit - */ - describe('Check attributes of "{0}/{1}". Stack driven attributes should be undefined '.format(siteProperty.filename, siteProperty.name), function () { - ['isVisible', 'value', 'recommendedValue', 'description', 'isReconfigurable', 'isRequired', 'displayName', 'showLabel', 'unit'].forEach(function (p) { - it(p, function () { - expect(siteProperty[p]).to.not.exist; - }); - }); - }); - - /** - * displayTypes supportTextConnection and radio button - * can be used as exception. Other displayTypes values should be used in stack definition - */ - it('Check attributes of "{0}/{1}". Display type value {2} should be described in stack '.format(siteProperty.filename, siteProperty.name, siteProperty.displayType), function () { - expect(siteProperty.displayType).to.match(/undefined|supportTextConnection|radio button/); - }); - - /** - * Following config attributes uniquely represent a config property - * name - * filename - */ - describe('Check primary attributes of "{0}/{1}". Attributes that uniquely represent a property should be defined '.format(siteProperty.filename, siteProperty.name), function () { - it('name', function () { - expect(siteProperty.name).to.not.equal(undefined); - }); - it('filename', function () { - expect(siteProperty.filename).to.not.equal(undefined); - }); - }); - }); - -}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/2ce9e3b6/ambari-web/test/data/HDP2.3/site_properties_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/data/HDP2.3/site_properties_test.js b/ambari-web/test/data/HDP2.3/site_properties_test.js deleted file mode 100644 index 6ce9c17..0000000 --- a/ambari-web/test/data/HDP2.3/site_properties_test.js +++ /dev/null @@ -1,77 +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. - */ - -require('utils/helper'); -require('data/HDP2/gluster_fs_properties'); -var siteProperties = require('data/HDP2.3/site_properties').configProperties; - -describe('hdp2SiteProperties', function () { - /** - * @stackProperties: All the properties that are derived from stack definition - */ - var stackProperties = siteProperties.filter(function(item){ - return !(item.isRequiredByAgent === false || item.category === 'Ambari Principals') - }); - - stackProperties.forEach(function(siteProperty){ - /** - * Following config attributes are stack driven and should be defined in the stack metainfo instead of ambari-web site-properties file - * isVisible - * isOverridable - * value - * recommendedValue - * isReconfigurable - * isRequired - * displayName - * description - * showLabel - * unit - */ - describe('Check attributes of "{0}/{1}". Stack driven attributes should be undefined '.format(siteProperty.filename, siteProperty.name), function () { - ['isVisible', 'value', 'recommendedValue', 'description', 'isReconfigurable', 'isRequired', 'displayName', 'showLabel', 'unit'].forEach(function (p) { - it(p, function () { - expect(siteProperty[p]).to.not.exist; - }); - }); - }); - - - /** - * displayTypes supportTextConnection and radio button - * can be used as exception. Other displayTypes values should be used in stack definition - */ - it('Check attributes of "{0}/{1}". Display type value {2} should be described in stack '.format(siteProperty.filename, siteProperty.name, siteProperty.displayType), function () { - expect(siteProperty.displayType).to.match(/undefined|supportTextConnection|radio button/); - }); - - /** - * Following config attributes uniquely represent a config property - * name - * filename - */ - describe('Check primary attributes of "{0}/{1}". Attributes that uniquely represent a property should be defined '.format(siteProperty.filename, siteProperty.name), function () { - it('name', function () { - expect(siteProperty.name).to.not.equal(undefined); - }); - it('filename', function () { - expect(siteProperty.filename).to.not.equal(undefined); - }); - }); - }); - -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/2ce9e3b6/ambari-web/test/data/HDP2/secure_mapping_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/data/HDP2/secure_mapping_test.js b/ambari-web/test/data/HDP2/secure_mapping_test.js deleted file mode 100644 index 766243f..0000000 --- a/ambari-web/test/data/HDP2/secure_mapping_test.js +++ /dev/null @@ -1,36 +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. - */ - -require('utils/helper'); -var mappedHdp2Properties = require('data/HDP2/secure_mapping'); - -describe('hdp2SiteMapping', function () { - - // All mapped properties should have value of string type - mappedHdp2Properties.forEach(function(mappedProperty){ - it('Value of "{0}" should be string'.format(mappedProperty.name), function () { - expect(mappedProperty.value).to.be.a('string'); - }); - }); - mappedHdp2Properties.forEach(function(mappedProperty){ - it('Value of "{0}" should have serviceName and filename attribute'.format(mappedProperty.name), function () { - expect(mappedProperty).to.have.property('serviceName'); - expect(mappedProperty).to.have.property('filename'); - }); - }); -}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/2ce9e3b6/ambari-web/test/data/HDP2/site_properties_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/data/HDP2/site_properties_test.js b/ambari-web/test/data/HDP2/site_properties_test.js deleted file mode 100644 index c8b7bbc..0000000 --- a/ambari-web/test/data/HDP2/site_properties_test.js +++ /dev/null @@ -1,76 +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. - */ - -require('utils/helper'); -require('data/HDP2/gluster_fs_properties'); -var siteProperties = require('data/HDP2/site_properties').configProperties; - -describe('hdp2SiteProperties', function () { - /** - * @stackProperties: All the properties that are derived from stack definition - */ - var stackProperties = siteProperties.filter(function(item){ - return !(item.isRequiredByAgent === false || item.category === 'Ambari Principals') - }); - - stackProperties.forEach(function(siteProperty){ - /** - * Following config attributes are stack driven and should be defined in the stack metainfo instead of ambari-web site-properties file - * isVisible - * isOverridable - * value - * recommendedValue - * isReconfigurable - * isRequired - * displayName - * description - * showLabel - * unit - */ - describe('Check attributes of "{0}/{1}". Stack driven attributes should be undefined '.format(siteProperty.filename, siteProperty.name), function () { - ['isVisible', 'value', 'recommendedValue', 'description', 'isReconfigurable', 'isRequired', 'displayName', 'showLabel', 'unit'].forEach(function (p) { - it(p, function () { - expect(siteProperty[p]).to.not.exist; - }); - }); - }); - - /** - * displayTypes supportTextConnection and radio button - * can be used as exception. Other displayTypes values should be used in stack definition - */ - it('Check attributes of "{0}/{1}". Display type value {2} should be described in stack '.format(siteProperty.filename, siteProperty.name, siteProperty.displayType), function () { - expect(siteProperty.displayType).to.match(/undefined|supportTextConnection|radio button/); - }); - - /** - * Following config attributes uniquely represent a config property - * name - * filename - */ - describe('Check primary attributes of "{0}/{1}". Attributes that uniquely represent a property should be defined '.format(siteProperty.filename, siteProperty.name), function () { - it('name', function () { - expect(siteProperty.name).to.not.equal(undefined); - }); - it('filename', function () { - expect(siteProperty.filename).to.not.equal(undefined); - }); - }); - }); - -}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/2ce9e3b6/ambari-web/test/data/configs/site_properties_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/data/configs/site_properties_test.js b/ambari-web/test/data/configs/site_properties_test.js new file mode 100644 index 0000000..dcd70b1 --- /dev/null +++ b/ambari-web/test/data/configs/site_properties_test.js @@ -0,0 +1,76 @@ +/** + * 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. + */ + +require('utils/helper'); +var siteProperties = require('data/configs/site_properties').configProperties; + +describe('data configs site_properties', function () { + /** + * @stackProperties: All the properties that are derived from stack definition + */ + var stackProperties = siteProperties.filter(function(item){ + return !(item.isRequiredByAgent === false || item.category === 'Ambari Principals') + }); + + stackProperties.forEach(function(siteProperty){ + /** + * Following config attributes are stack driven and should be defined in the stack metainfo instead of ambari-web site-properties file + * isVisible + * isOverridable + * value + * recommendedValue + * isReconfigurable + * isRequired + * displayName + * description + * showLabel + * unit + */ + describe('Check attributes of "{0}/{1}". Stack driven attributes should be undefined '.format(siteProperty.filename, siteProperty.name), function () { + ['isVisible', 'value', 'recommendedValue', 'description', 'isReconfigurable', 'isRequired', 'displayName', 'showLabel', 'unit'].forEach(function (p) { + it(p, function () { + expect(siteProperty[p]).to.not.exist; + }); + }); + }); + + + /** + * displayTypes supportTextConnection and radio button + * can be used as exception. Other displayTypes values should be used in stack definition + */ + it('Check attributes of "{0}/{1}". Display type value {2} should be described in stack '.format(siteProperty.filename, siteProperty.name, siteProperty.displayType), function () { + expect(siteProperty.displayType).to.match(/undefined|supportTextConnection|radio button/); + }); + + /** + * Following config attributes uniquely represent a config property + * name + * filename + */ + describe('Check primary attributes of "{0}/{1}". Attributes that uniquely represent a property should be defined '.format(siteProperty.filename, siteProperty.name), function () { + it('name', function () { + expect(siteProperty.name).to.not.equal(undefined); + }); + it('filename', function () { + expect(siteProperty.filename).to.not.equal(undefined); + }); + }); + }); + +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/2ce9e3b6/ambari-web/test/data/configs/wizards/secure_mapping_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/data/configs/wizards/secure_mapping_test.js b/ambari-web/test/data/configs/wizards/secure_mapping_test.js new file mode 100644 index 0000000..dacad35 --- /dev/null +++ b/ambari-web/test/data/configs/wizards/secure_mapping_test.js @@ -0,0 +1,36 @@ +/** + * 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. + */ + +require('utils/helper'); +var mappedProperties = require('data/configs/wizards/secure_mapping'); + +describe('secure mapping properties', function () { + + // All mapped properties should have value of string type + mappedProperties.forEach(function(mappedProperty){ + it('Value of "{0}" should be string'.format(mappedProperty.name), function () { + expect(mappedProperty.value).to.be.a('string'); + }); + }); + mappedProperties.forEach(function(mappedProperty){ + it('Value of "{0}" should have serviceName and filename attribute'.format(mappedProperty.name), function () { + expect(mappedProperty).to.have.property('serviceName'); + expect(mappedProperty).to.have.property('filename'); + }); + }); +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/2ce9e3b6/ambari-web/test/utils/config_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/utils/config_test.js b/ambari-web/test/utils/config_test.js index 5012caa..8c450ed 100644 --- a/ambari-web/test/utils/config_test.js +++ b/ambari-web/test/utils/config_test.js @@ -199,49 +199,7 @@ describe('App.config', function() { }); }); - describe('#mapCustomStack', function() { - before(function() { - setups.setupStackVersion(this, 'HDF-2.2'); - }); - - it('versions of HDF > 2.0 should map with HDP 2.3 stack based property definitions', function() { - var baseStackFolder = App.config.mapCustomStack(); - expect(baseStackFolder).to.equal("HDP2.3"); - }); - - it('versions of HDF = 2.0 should map with HDP 2.3 stack based property definitions', function() { - App.set('currentStackVersion', 'HDF-2.0'); - var baseStackFolder = App.config.mapCustomStack(); - expect(baseStackFolder).to.equal("HDP2.3"); - }); - - - after(function() { - setups.restoreStackVersion(this); - }); - }); - - describe('#preDefinedConfigFile', function() { - before(function() { - setups.setupStackVersion(this, 'BIGTOP-0.8'); - }); - - it('bigtop site properties should be ok.', function() { - var bigtopSiteProperties = App.config.preDefinedConfigFile('BIGTOP', 'site_properties'); - expect(bigtopSiteProperties).to.be.ok; - }); - - it('a non-existing file should not be ok.', function () { - var notExistingSiteProperty = App.config.preDefinedConfigFile('notExisting'); - expect(notExistingSiteProperty).to.not.be.ok; - }); - - after(function() { - setups.restoreStackVersion(this); - }); - }); - - describe('#preDefinedSiteProperties-bigtop', function () { + describe.skip('#preDefinedSiteProperties-bigtop', function () { before(function() { setups.setupStackVersion(this, 'BIGTOP-0.8'); }); @@ -326,7 +284,7 @@ describe('App.config', function() { expect(Em.keys(miscCategory.get('configTypes'))).to.eql(['cluster-env', 'hadoop-env', 'oozie-env']); }); }); - + describe('#isManagedMySQLForHiveAllowed', function () { var cases = [