http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py index fc22d08..3655317 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py +++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py @@ -38,7 +38,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "configure", config_file = "default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assert_configure_default() @@ -49,7 +49,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "start", config_file = "altfs_plus_hdfs.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, call_mocks = [(0,"")], ) @@ -149,7 +149,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "install", config_file = "default_no_install.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, try_install=True ) @@ -162,7 +162,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "start", config_file = "default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, call_mocks = [(0,"")], ) @@ -262,7 +262,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "stop", config_file = "default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('Execute', "ambari-sudo.sh su hdfs -l -s /bin/bash -c '[RMF_EXPORT_PLACEHOLDER]ulimit -c unlimited ; /usr/lib/hadoop/sbin/hadoop-daemon.sh --config /etc/hadoop/conf stop namenode'", @@ -276,7 +276,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "configure", config_file = "secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assert_configure_secured() @@ -288,7 +288,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "start", config_file = "secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, call_mocks = [(0,"")], ) @@ -382,7 +382,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "stop", config_file = "secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('Execute', "ambari-sudo.sh su hdfs -l -s /bin/bash -c '[RMF_EXPORT_PLACEHOLDER]ulimit -c unlimited ; /usr/lib/hadoop/sbin/hadoop-daemon.sh --config /etc/hadoop/conf stop namenode'", @@ -396,7 +396,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "start", config_file = "ha_default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assert_configure_default() @@ -492,7 +492,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "start", config_file = "ha_default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, call_mocks = call_mocks ) @@ -593,7 +593,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "start", config_file = "ha_secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assert_configure_secured() @@ -689,7 +689,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "start", config_file="ha_bootstrap_active_node.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assert_configure_default() @@ -795,7 +795,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "start", config_file="ha_bootstrap_standby_node.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, call_mocks = call_mocks ) @@ -905,7 +905,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "start", config_file="ha_bootstrap_standby_node_initial_start.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, call_mocks = call_mocks ) @@ -1009,7 +1009,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "decommission", config_file = "default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('File', '/etc/hadoop/conf/dfs.exclude', @@ -1029,7 +1029,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "decommission", config_file = "default_update_exclude_file_only.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('File', '/etc/hadoop/conf/dfs.exclude', @@ -1045,7 +1045,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "decommission", config_file = "ha_default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('File', '/etc/hadoop/conf/dfs.exclude', @@ -1066,7 +1066,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "decommission", config_file = "secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('File', '/etc/hadoop/conf/dfs.exclude', @@ -1194,7 +1194,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "rebalancehdfs", config_file = "rebalancehdfs_default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('Execute', "ambari-sudo.sh su hdfs -l -s /bin/bash -c 'export PATH=/bin:/usr/bin ; hdfs --config /etc/hadoop/conf balancer -threshold -1'", @@ -1212,7 +1212,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "rebalancehdfs", config_file = "rebalancehdfs_secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, call_mocks=[(1, "no kinit")] ) @@ -1245,7 +1245,7 @@ class TestNamenode(RMFTestCase): try: self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/namenode.py", classname = "NameNode", command = "start", config_file = "ranger-namenode-start.json", - hdp_stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.fail("Expected a failure since the ranger install.properties was missing") except Fail, failure: @@ -1285,7 +1285,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "security_status", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -1305,7 +1305,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "security_status", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -1321,7 +1321,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "security_status", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) except: @@ -1342,7 +1342,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "security_status", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -1362,7 +1362,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "security_status", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) put_structured_out_mock.assert_called_with({"securityState": "UNSECURED"}) @@ -1382,7 +1382,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "restart", config_file = "nn_ru_lzo.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES) unknown_namenodes = active_namenodes @@ -1392,7 +1392,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "restart", config_file = "nn_ru_lzo.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES) self.assertFalse(0 == len(Script.structuredOut)) @@ -1414,7 +1414,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "restart", config_file = "nn_eu_standby.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, call_mocks = [(0, None, ''), (0, None)], mocks_dict=mocks_dict) @@ -1447,7 +1447,7 @@ class TestNamenode(RMFTestCase): command = "start", command_args=["nonrolling"], config_dict = json_content, - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, call_mocks = [(0, None, ''), (0, None)], mocks_dict=mocks_dict) @@ -1469,7 +1469,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "pre_upgrade_restart", config_dict = json_content, - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES) self.assertResourceCalled('Execute', ('ambari-python-wrap', '/usr/bin/hdp-select', 'set', 'hadoop-hdfs-namenode', version), sudo=True) @@ -1488,7 +1488,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "pre_upgrade_restart", config_dict = json_content, - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, call_mocks = [(0, None), (0, None)], mocks_dict = mocks_dict) @@ -1503,7 +1503,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "post_upgrade_restart", config_dict = json_content, - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES) self.assertResourceCalled('Execute', 'hdfs dfsadmin -fs hdfs://c6401.ambari.apache.org:8020 -report -live', user='hdfs', @@ -1520,7 +1520,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "post_upgrade_restart", config_dict = json_content, - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES) self.assertResourceCalled('Execute', 'hdfs dfsadmin -fs hdfs://ns1 -report -live', user='hdfs', @@ -1539,7 +1539,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "prepare_rolling_upgrade", config_dict = json_content, - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, call_mocks = [(0, "Safe mode is OFF in c6401.ambari.apache.org")]) @@ -1564,7 +1564,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "prepare_rolling_upgrade", config_dict = json_content, - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, call_mocks = [(0, "Safe mode is OFF in c6401.ambari.apache.org")]) @@ -1595,7 +1595,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "prepare_rolling_upgrade", config_dict = json_content, - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES) self.assertResourceCalled('Execute', @@ -1613,7 +1613,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "finalize_rolling_upgrade", config_dict = json_content, - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES) self.assertResourceCalled('Execute', 'hdfs dfsadmin -fs hdfs://c6401.ambari.apache.org:8020 -rollingUpgrade query', @@ -1638,7 +1638,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "finalize_rolling_upgrade", config_dict = json_content, - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES) self.assertResourceCalled('Execute', 'hdfs dfsadmin -fs hdfs://ns1 -rollingUpgrade query', @@ -1668,7 +1668,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "pre_upgrade_restart", config_dict = json_content, - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, call_mocks = [(0, None), (0, None), (0, None), (0, None), (0, None), (0, None), (0, None)], mocks_dict = mocks_dict) @@ -1694,7 +1694,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "pre_upgrade_restart", config_dict = json_content, - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, call_mocks = [(0, None), (0, None), (0, None), (0, None), (0, None), (0, None), (0, None)], mocks_dict = mocks_dict) @@ -1722,7 +1722,7 @@ class TestNamenode(RMFTestCase): classname = "NameNode", command = "pre_upgrade_restart", config_dict = json_content, - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, call_mocks = itertools.cycle([(0, None)]), mocks_dict = mocks_dict)
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_nfsgateway.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_nfsgateway.py b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_nfsgateway.py index 36b67f0..ed03ae1 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_nfsgateway.py +++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_nfsgateway.py @@ -37,7 +37,7 @@ class TestNFSGateway(RMFTestCase): classname = "NFSGateway", command = "configure", config_file = "default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assert_configure_default() @@ -50,7 +50,7 @@ class TestNFSGateway(RMFTestCase): classname = "NFSGateway", command = "start", config_file = "default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assert_configure_default() @@ -86,7 +86,7 @@ class TestNFSGateway(RMFTestCase): classname = "NFSGateway", command = "stop", config_file = "default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('Execute', 'ambari-sudo.sh [RMF_ENV_PLACEHOLDER] -H -E /usr/lib/hadoop/sbin/hadoop-daemon.sh --config /etc/hadoop/conf stop nfs3', @@ -104,7 +104,7 @@ class TestNFSGateway(RMFTestCase): classname = "NFSGateway", command = "configure", config_file = "secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assert_configure_secured() @@ -117,7 +117,7 @@ class TestNFSGateway(RMFTestCase): classname = "NFSGateway", command = "start", config_file = "secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assert_configure_secured() @@ -153,7 +153,7 @@ class TestNFSGateway(RMFTestCase): classname = "NFSGateway", command = "stop", config_file = "secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('Execute', 'ambari-sudo.sh [RMF_ENV_PLACEHOLDER] -H -E /usr/lib/hadoop/sbin/hadoop-daemon.sh --config /etc/hadoop/conf stop nfs3', @@ -296,7 +296,7 @@ class TestNFSGateway(RMFTestCase): classname = "NFSGateway", command = "security_status", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -316,7 +316,7 @@ class TestNFSGateway(RMFTestCase): classname = "NFSGateway", command = "security_status", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -332,7 +332,7 @@ class TestNFSGateway(RMFTestCase): classname = "NFSGateway", command = "security_status", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) except: @@ -353,7 +353,7 @@ class TestNFSGateway(RMFTestCase): classname = "NFSGateway", command = "security_status", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -373,7 +373,7 @@ class TestNFSGateway(RMFTestCase): classname = "NFSGateway", command = "security_status", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) put_structured_out_mock.assert_called_with({"securityState": "UNSECURED"}) @@ -393,7 +393,7 @@ class TestNFSGateway(RMFTestCase): classname = "NFSGateway", command = "pre_upgrade_restart", config_dict = json_content, - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, call_mocks = [(0, None, ''), (0, None), (0, None), (0, None)]) self.assertResourceCalled('Link', ('/etc/hadoop/conf'), to='/usr/hdp/current/hadoop-client/conf') http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_service_check.py b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_service_check.py index 851aee2..4c66c4f 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_service_check.py +++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_service_check.py @@ -31,7 +31,7 @@ class TestServiceCheck(RMFTestCase): classname = "HdfsServiceCheck", command = "service_check", config_file = "default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -43,7 +43,7 @@ class TestServiceCheck(RMFTestCase): classname = "HdfsServiceCheck", command = "service_check", config_file = "default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_snamenode.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_snamenode.py b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_snamenode.py index fea5ecf..9e66e51 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_snamenode.py +++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_snamenode.py @@ -30,7 +30,7 @@ class TestSNamenode(RMFTestCase): classname = "SNameNode", command = "configure", config_file = "default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assert_configure_default() @@ -46,7 +46,7 @@ class TestSNamenode(RMFTestCase): classname = "SNameNode", command = "start", config_file = "default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assert_configure_default() @@ -83,7 +83,7 @@ class TestSNamenode(RMFTestCase): classname = "SNameNode", command = "stop", config_file = "default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('Execute', "ambari-sudo.sh su hdfs -l -s /bin/bash -c '[RMF_EXPORT_PLACEHOLDER]ulimit -c unlimited ; /usr/lib/hadoop/sbin/hadoop-daemon.sh --config /etc/hadoop/conf stop secondarynamenode'", @@ -98,7 +98,7 @@ class TestSNamenode(RMFTestCase): classname = "SNameNode", command = "configure", config_file = "secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assert_configure_secured() @@ -114,7 +114,7 @@ class TestSNamenode(RMFTestCase): classname = "SNameNode", command = "start", config_file = "secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assert_configure_secured() @@ -151,7 +151,7 @@ class TestSNamenode(RMFTestCase): classname = "SNameNode", command = "stop", config_file = "secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('Execute', "ambari-sudo.sh su hdfs -l -s /bin/bash -c '[RMF_EXPORT_PLACEHOLDER]ulimit -c unlimited ; /usr/lib/hadoop/sbin/hadoop-daemon.sh --config /etc/hadoop/conf stop secondarynamenode'", @@ -305,7 +305,7 @@ class TestSNamenode(RMFTestCase): classname = "SNameNode", command = "security_status", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -325,7 +325,7 @@ class TestSNamenode(RMFTestCase): classname = "SNameNode", command = "security_status", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -341,7 +341,7 @@ class TestSNamenode(RMFTestCase): classname = "SNameNode", command = "security_status", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) except: @@ -362,7 +362,7 @@ class TestSNamenode(RMFTestCase): classname = "SNameNode", command = "security_status", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -382,7 +382,7 @@ class TestSNamenode(RMFTestCase): classname = "SNameNode", command = "security_status", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) put_structured_out_mock.assert_called_with({"securityState": "UNSECURED"}) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_zkfc.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_zkfc.py b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_zkfc.py index 358b56f..72728a3 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_zkfc.py +++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_zkfc.py @@ -31,7 +31,7 @@ class TestZkfc(RMFTestCase): classname = "ZkfcSlave", command = "start", config_file = "ha_default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('Directory', '/usr/lib/hadoop/lib/native/Linux-i386-32', @@ -111,7 +111,7 @@ class TestZkfc(RMFTestCase): classname = "ZkfcSlave", command = "stop", config_file = "ha_default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('Execute', "ambari-sudo.sh su hdfs -l -s /bin/bash -c '[RMF_EXPORT_PLACEHOLDER]ulimit -c unlimited ; /usr/lib/hadoop/sbin/hadoop-daemon.sh --config /etc/hadoop/conf stop zkfc'", @@ -126,7 +126,7 @@ class TestZkfc(RMFTestCase): classname = "ZkfcSlave", command = "start", config_file = "ha_secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('Directory', '/usr/lib/hadoop/lib/native/Linux-i386-32', @@ -205,7 +205,7 @@ class TestZkfc(RMFTestCase): classname = "ZkfcSlave", command = "stop", config_file = "ha_secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('Execute', "ambari-sudo.sh su hdfs -l -s /bin/bash -c '[RMF_EXPORT_PLACEHOLDER]ulimit -c unlimited ; /usr/lib/hadoop/sbin/hadoop-daemon.sh --config /etc/hadoop/conf stop zkfc'", @@ -220,7 +220,7 @@ class TestZkfc(RMFTestCase): classname = "ZkfcSlave", command = "start", config_file="ha_bootstrap_active_node.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('Directory', '/usr/lib/hadoop/lib/native/Linux-i386-32', @@ -300,7 +300,7 @@ class TestZkfc(RMFTestCase): classname = "ZkfcSlave", command = "start", config_file="ha_bootstrap_standby_node.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('Directory', '/usr/lib/hadoop/lib/native/Linux-i386-32', @@ -404,7 +404,7 @@ class TestZkfc(RMFTestCase): classname = "ZkfcSlave", command = "security_status", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -426,7 +426,7 @@ class TestZkfc(RMFTestCase): classname = "ZkfcSlave", command = "security_status", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) except: @@ -439,7 +439,7 @@ class TestZkfc(RMFTestCase): classname = "ZkfcSlave", command = "security_status", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -460,7 +460,7 @@ class TestZkfc(RMFTestCase): classname = "ZkfcSlave", command = "security_status", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) put_structured_out_mock.assert_called_with({"securityState": "UNSECURED"}) @@ -470,7 +470,7 @@ class TestZkfc(RMFTestCase): classname = "ZkfcSlave", command = "security_status", config_file="default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) put_structured_out_mock.assert_called_with({"securityState": "UNSECURED"}) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hcat_client.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hcat_client.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hcat_client.py index 4dfa688..54d3e84 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hcat_client.py +++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hcat_client.py @@ -30,7 +30,7 @@ class TestHcatClient(RMFTestCase): classname = "HCatClient", command = "configure", config_file="default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('Directory', '/etc/hive/conf', @@ -69,7 +69,7 @@ class TestHcatClient(RMFTestCase): classname = "HCatClient", command = "configure", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('Directory', '/etc/hive/conf', @@ -117,7 +117,7 @@ class TestHcatClient(RMFTestCase): classname = "HCatClient", command = "pre_upgrade_restart", config_dict = json_content, - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, call_mocks = [(0, None, ''), (0, None, ''), (0, None, ''), (0, None, '')], mocks_dict = mocks_dict) http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py index f008745..77d6bdb 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py +++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py @@ -30,7 +30,7 @@ class TestHiveClient(RMFTestCase): classname = "HiveClient", command = "configure", config_file="default_client.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('Directory', '/etc/hive', @@ -106,7 +106,7 @@ class TestHiveClient(RMFTestCase): classname = "HiveClient", command = "configure", config_file="secured_client.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('Directory', '/etc/hive', @@ -185,7 +185,7 @@ class TestHiveClient(RMFTestCase): classname = "HiveClient", command = "pre_upgrade_restart", config_dict = json_content, - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES) self.assertResourceCalled('Execute', ('ambari-python-wrap', '/usr/bin/hdp-select', 'set', 'hadoop-client', version), sudo=True,) @@ -206,7 +206,7 @@ class TestHiveClient(RMFTestCase): classname = "HiveClient", command = "pre_upgrade_restart", config_dict = json_content, - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, call_mocks = [(0, None, ''), (0, None, ''), (0, None, ''), (0, None, '')], mocks_dict = mocks_dict) http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py index 1b68c8e..9b1032c 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py +++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py @@ -32,7 +32,7 @@ class TestHiveMetastore(RMFTestCase): classname = "HiveMetastore", command = "configure", config_file="default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assert_configure_default() @@ -42,7 +42,7 @@ class TestHiveMetastore(RMFTestCase): classname = "HiveMetastore", command = "start", config_file="default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -67,7 +67,7 @@ class TestHiveMetastore(RMFTestCase): classname = "HiveMetastore", command = "stop", config_file="default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -91,7 +91,7 @@ class TestHiveMetastore(RMFTestCase): classname = "HiveMetastore", command = "configure", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assert_configure_default() @@ -102,7 +102,7 @@ class TestHiveMetastore(RMFTestCase): classname = "HiveMetastore", command = "start", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assert_configure_secured() @@ -126,7 +126,7 @@ class TestHiveMetastore(RMFTestCase): classname = "HiveMetastore", command = "stop", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -363,11 +363,11 @@ class TestHiveMetastore(RMFTestCase): ) @patch("resource_management.core.shell.call") - @patch("resource_management.libraries.functions.get_hdp_version") - def test_start_ru(self, call_mock, get_hdp_version_mock): + @patch("resource_management.libraries.functions.get_stack_version") + def test_start_ru(self, call_mock, get_stack_version_mock): from ambari_commons.constants import UPGRADE_TYPE_ROLLING - get_hdp_version_mock.return_value = '2.3.0.0-1234' + get_stack_version_mock.return_value = '2.3.0.0-1234' config_file = self.get_src_folder()+"/test/python/stacks/2.0.6/configs/default.json" with open(config_file, "r") as f: @@ -385,7 +385,7 @@ class TestHiveMetastore(RMFTestCase): command = "start", command_args = [UPGRADE_TYPE_ROLLING], config_dict = json_content, - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES) self.assertResourceCalled('Directory', '/etc/hive', http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py index 9929d00..5335605 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py +++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py @@ -31,7 +31,7 @@ from resource_management.libraries.functions import copy_tarball from resource_management.libraries import functions from resource_management.core.logger import Logger -@patch.object(functions, "get_hdp_version", new = MagicMock(return_value="2.0.0.0-1234")) +@patch.object(functions, "get_stack_version", new = MagicMock(return_value="2.0.0.0-1234")) @patch("resource_management.libraries.functions.check_thrift_port_sasl", new=MagicMock()) @patch("resource_management.libraries.functions.get_user_call_output.get_user_call_output", new=MagicMock(return_value=(0,'123',''))) class TestHiveServer(RMFTestCase): @@ -43,14 +43,14 @@ class TestHiveServer(RMFTestCase): Logger.logger = MagicMock() @patch("resource_management.libraries.functions.copy_tarball.copy_to_hdfs") - @patch.object(Script, "is_hdp_stack_greater_or_equal", new = MagicMock(return_value=False)) + @patch.object(Script, "is_stack_greater_or_equal", new = MagicMock(return_value=False)) def test_configure_default(self, copy_to_hdfs_mock): copy_to_hdfs_mock.return_value = True self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/hive_server.py", classname = "HiveServer", command = "configure", config_file="default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assert_configure_default() @@ -58,7 +58,7 @@ class TestHiveServer(RMFTestCase): @patch("resource_management.libraries.functions.copy_tarball.copy_to_hdfs") @patch("socket.socket") - @patch.object(Script, "is_hdp_stack_greater_or_equal", new = MagicMock(return_value=False)) + @patch.object(Script, "is_stack_greater_or_equal", new = MagicMock(return_value=False)) def test_start_default(self, socket_mock, copy_to_hfds_mock): copy_to_hfds_mock.return_value = None s = socket_mock.return_value @@ -66,7 +66,7 @@ class TestHiveServer(RMFTestCase): classname="HiveServer", command="start", config_file="default.json", - hdp_stack_version=self.STACK_VERSION, + stack_version=self.STACK_VERSION, target=RMFTestCase.TARGET_COMMON_SERVICES ) @@ -95,7 +95,7 @@ class TestHiveServer(RMFTestCase): @patch("resource_management.libraries.functions.copy_tarball.copy_to_hdfs") @patch("socket.socket") - @patch.object(Script, "is_hdp_stack_greater_or_equal", new = MagicMock(return_value=False)) + @patch.object(Script, "is_stack_greater_or_equal", new = MagicMock(return_value=False)) def test_start_default_non_hdfs(self, socket_mock, copy_to_hfds_mock): copy_to_hfds_mock.return_value = None s = socket_mock.return_value @@ -103,7 +103,7 @@ class TestHiveServer(RMFTestCase): classname="HiveServer", command="start", config_file="default_hive_non_hdfs.json", - hdp_stack_version=self.STACK_VERSION, + stack_version=self.STACK_VERSION, target=RMFTestCase.TARGET_COMMON_SERVICES ) @@ -125,13 +125,13 @@ class TestHiveServer(RMFTestCase): ) self.assertNoMoreResources() - @patch.object(Script, "is_hdp_stack_greater_or_equal", new = MagicMock(return_value=False)) + @patch.object(Script, "is_stack_greater_or_equal", new = MagicMock(return_value=False)) def test_start_default_no_copy(self): self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/hive_server.py", classname = "HiveServer", command = "start", config_file="default_no_install.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -156,14 +156,14 @@ class TestHiveServer(RMFTestCase): self.assertNoMoreResources() @patch("resource_management.libraries.functions.copy_tarball.copy_to_hdfs") - @patch.object(Script, "is_hdp_stack_greater_or_equal", new = MagicMock(return_value=False)) + @patch.object(Script, "is_stack_greater_or_equal", new = MagicMock(return_value=False)) def test_start_default_alt_tmp(self, copy_to_hfds_mock): copy_to_hfds_mock.return_value = None self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/hive_server.py", classname = "HiveServer", command = "start", config_file="default_hive_nn_ha.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -188,14 +188,14 @@ class TestHiveServer(RMFTestCase): self.assertNoMoreResources() @patch("resource_management.libraries.functions.copy_tarball.copy_to_hdfs") - @patch.object(Script, "is_hdp_stack_greater_or_equal", new = MagicMock(return_value=False)) + @patch.object(Script, "is_stack_greater_or_equal", new = MagicMock(return_value=False)) def test_start_default_alt_nn_ha_tmp(self, copy_to_hfds_mock): copy_to_hfds_mock.return_value = None self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/hive_server.py", classname = "HiveServer", command = "start", config_file="default_hive_nn_ha_2.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -219,13 +219,13 @@ class TestHiveServer(RMFTestCase): ) self.assertNoMoreResources() - @patch.object(Script, "is_hdp_stack_greater_or_equal", new = MagicMock(return_value=False)) + @patch.object(Script, "is_stack_greater_or_equal", new = MagicMock(return_value=False)) def test_stop_default(self): self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/hive_server.py", classname = "HiveServer", command = "stop", config_file="default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -245,13 +245,13 @@ class TestHiveServer(RMFTestCase): self.assertNoMoreResources() - @patch.object(Script, "is_hdp_stack_greater_or_equal", new = MagicMock(return_value=False)) + @patch.object(Script, "is_stack_greater_or_equal", new = MagicMock(return_value=False)) def test_configure_secured(self): self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/hive_server.py", classname = "HiveServer", command = "configure", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assert_configure_secured() @@ -260,7 +260,7 @@ class TestHiveServer(RMFTestCase): @patch("resource_management.libraries.functions.copy_tarball.copy_to_hdfs") @patch("hive_service.check_fs_root") @patch("socket.socket") - @patch.object(Script, "is_hdp_stack_greater_or_equal", new = MagicMock(return_value=False)) + @patch.object(Script, "is_stack_greater_or_equal", new = MagicMock(return_value=False)) def test_start_secured(self, socket_mock, check_fs_root_mock, copy_to_hfds_mock): s = socket_mock.return_value copy_to_hfds_mock.return_value = None @@ -269,7 +269,7 @@ class TestHiveServer(RMFTestCase): classname = "HiveServer", command = "start", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -298,13 +298,13 @@ class TestHiveServer(RMFTestCase): @patch("socket.socket") - @patch.object(Script, "is_hdp_stack_greater_or_equal", new = MagicMock(return_value=False)) + @patch.object(Script, "is_stack_greater_or_equal", new = MagicMock(return_value=False)) def test_stop_secured(self, socket_mock): self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/hive_server.py", classname = "HiveServer", command = "stop", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('Execute', @@ -713,7 +713,7 @@ class TestHiveServer(RMFTestCase): classname = "HiveServer", command = "start", config_file="default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -722,7 +722,7 @@ class TestHiveServer(RMFTestCase): self.assert_configure_default() @patch("resource_management.libraries.functions.copy_tarball.copy_to_hdfs") - @patch.object(Script, "is_hdp_stack_greater_or_equal", new = MagicMock(return_value=True)) + @patch.object(Script, "is_stack_greater_or_equal", new = MagicMock(return_value=True)) @patch("os.path.exists", new = MagicMock(return_value=True)) @patch("platform.linux_distribution", new = MagicMock(return_value="Linux")) def test_stop_during_upgrade(self, copy_to_hdfs_mock): @@ -737,7 +737,7 @@ From source with checksum 150f554beae04f76f814f59549dead8b""" self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/hive_server.py", classname = "HiveServer", command = "restart", config_file = "hive-upgrade.json", - hdp_stack_version = self.UPGRADE_STACK_VERSION, + stack_version = self.UPGRADE_STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, call_mocks = call_side_effects ) @@ -749,7 +749,7 @@ From source with checksum 150f554beae04f76f814f59549dead8b""" @patch("resource_management.libraries.functions.copy_tarball.copy_to_hdfs") - @patch.object(Script, "is_hdp_stack_greater_or_equal", new = MagicMock(return_value=True)) + @patch.object(Script, "is_stack_greater_or_equal", new = MagicMock(return_value=True)) def test_stop_during_upgrade_with_default_conf_server(self, copy_to_hdfs_mock): hiveServerVersionOutput = """WARNING: Use "yarn jar" to launch YARN applications. Hive 1.2.1.2.3.0.0-2434 @@ -761,7 +761,7 @@ From source with checksum 150f554beae04f76f814f59549dead8b""" self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/hive_server.py", classname = "HiveServer", command = "restart", config_file = "hive-upgrade.json", - hdp_stack_version = self.UPGRADE_STACK_VERSION, + stack_version = self.UPGRADE_STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, call_mocks = call_side_effects ) @@ -775,7 +775,7 @@ From source with checksum 150f554beae04f76f814f59549dead8b""" try: self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/hive_server.py", classname = "HiveServer", command = "restart", config_file = "hive-upgrade.json", - hdp_stack_version = self.UPGRADE_STACK_VERSION, + stack_version = self.UPGRADE_STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, call_mocks = [(0,"BAD VERSION")]) self.fail("Invalid hive version should have caused an exception") @@ -823,7 +823,7 @@ From source with checksum 150f554beae04f76f814f59549dead8b""" classname = "HiveServer", command = "security_status", config_file="../../2.1/configs/secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -847,7 +847,7 @@ From source with checksum 150f554beae04f76f814f59549dead8b""" classname = "HiveServer", command = "security_status", config_file="../../2.1/configs/secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) except: @@ -864,7 +864,7 @@ From source with checksum 150f554beae04f76f814f59549dead8b""" classname = "HiveServer", command = "security_status", config_file="../../2.1/configs/secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) put_structured_out_mock.assert_called_with({"securityIssuesFound": "Keytab file or principal are not set property."}) @@ -882,7 +882,7 @@ From source with checksum 150f554beae04f76f814f59549dead8b""" classname = "HiveServer", command = "security_status", config_file="../../2.1/configs/secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) put_structured_out_mock.assert_called_with({"securityState": "UNSECURED"}) @@ -892,12 +892,12 @@ From source with checksum 150f554beae04f76f814f59549dead8b""" classname = "HiveServer", command = "security_status", config_file="../../2.1/configs/default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) put_structured_out_mock.assert_called_with({"securityState": "UNSECURED"}) - @patch.object(Script, "is_hdp_stack_greater_or_equal", new = MagicMock(return_value=True)) + @patch.object(Script, "is_stack_greater_or_equal", new = MagicMock(return_value=True)) @patch("resource_management.libraries.functions.copy_tarball.copy_to_hdfs") def test_pre_upgrade_restart(self, copy_to_hdfs_mock): copy_to_hdfs_mock.return_value = True @@ -911,7 +911,7 @@ From source with checksum 150f554beae04f76f814f59549dead8b""" classname = "HiveServer", command = "pre_upgrade_restart", config_dict = json_content, - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES) self.assertResourceCalled('Execute', ('ambari-python-wrap', '/usr/bin/hdp-select', 'set', 'hive-server2', version), sudo=True,) @@ -933,7 +933,7 @@ From source with checksum 150f554beae04f76f814f59549dead8b""" @patch("os.path.exists") @patch("resource_management.core.shell.call") - @patch.object(Script, "is_hdp_stack_greater_or_equal", new = MagicMock(return_value=True)) + @patch.object(Script, "is_stack_greater_or_equal", new = MagicMock(return_value=True)) @patch("resource_management.libraries.functions.copy_tarball.copy_to_hdfs") def test_pre_upgrade_restart_23(self, copy_to_hdfs_mock, call_mock, os_path__exists_mock): config_file = self.get_src_folder()+"/test/python/stacks/2.0.6/configs/default.json" @@ -949,7 +949,7 @@ From source with checksum 150f554beae04f76f814f59549dead8b""" classname = "HiveServer", command = "pre_upgrade_restart", config_dict = json_content, - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, call_mocks = [(0, None, ''), (0, None, '')], mocks_dict = mocks_dict) http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/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 589b437..5646b75 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 @@ -38,7 +38,7 @@ class TestServiceCheck(RMFTestCase): classname="HiveServiceCheck", command="service_check", config_file="default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('Execute', "! beeline -u 'jdbc:hive2://c6402.ambari.apache.org:10000/;transportMode=binary;auth=noSasl' -e '' 2>&1| awk '{print}'|grep -i -e 'Connection refused' -e 'Invalid URL'", @@ -146,7 +146,7 @@ class TestServiceCheck(RMFTestCase): classname="HiveServiceCheck", command="service_check", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('Execute', '/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab ambari...@example.com; ', @@ -264,7 +264,7 @@ class TestServiceCheck(RMFTestCase): classname="HiveServiceCheck", command="service_check", config_dict = json_content, - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES) self.assertResourceCalled('Execute', "! beeline -u 'jdbc:hive2://c6402.ambari.apache.org:10010/;transportMode=binary' -e '' 2>&1| awk '{print}'|grep -i -e 'Connection refused' -e 'Invalid URL'", http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_mysql_server.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_mysql_server.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_mysql_server.py index 1155e9f..827f6f7 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_mysql_server.py +++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_mysql_server.py @@ -32,7 +32,7 @@ class TestMySqlServer(RMFTestCase): classname = "MysqlServer", command = "configure", config_file="default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assert_configure_default() @@ -43,7 +43,7 @@ class TestMySqlServer(RMFTestCase): classname = "MysqlServer", command = "start", config_file="default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -59,7 +59,7 @@ class TestMySqlServer(RMFTestCase): classname = "MysqlServer", command = "stop", config_file="default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('Execute', ('service','mysql','stop'), @@ -75,7 +75,7 @@ class TestMySqlServer(RMFTestCase): classname = "MysqlServer", command = "configure", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assert_configure_secured() @@ -86,7 +86,7 @@ class TestMySqlServer(RMFTestCase): classname = "MysqlServer", command = "start", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -102,7 +102,7 @@ class TestMySqlServer(RMFTestCase): classname = "MysqlServer", command = "stop", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -118,7 +118,7 @@ class TestMySqlServer(RMFTestCase): classname = "MysqlServer", command = "clean", config_file="default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assert_clean_default() @@ -129,7 +129,7 @@ class TestMySqlServer(RMFTestCase): classname = "MysqlServer", command = "clean", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assert_clean_secured() http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_webhcat_server.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_webhcat_server.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_webhcat_server.py index 82cf177..6fe49dc 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_webhcat_server.py +++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_webhcat_server.py @@ -32,7 +32,7 @@ class TestWebHCatServer(RMFTestCase): classname = "WebHCatServer", command = "configure", config_file="default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assert_configure_default() @@ -43,7 +43,7 @@ class TestWebHCatServer(RMFTestCase): classname = "WebHCatServer", command = "start", config_file="default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -60,7 +60,7 @@ class TestWebHCatServer(RMFTestCase): classname = "WebHCatServer", command = "stop", config_file="default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -88,7 +88,7 @@ class TestWebHCatServer(RMFTestCase): classname = "WebHCatServer", command = "configure", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -100,7 +100,7 @@ class TestWebHCatServer(RMFTestCase): classname = "WebHCatServer", command = "start", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -117,7 +117,7 @@ class TestWebHCatServer(RMFTestCase): classname = "WebHCatServer", command = "stop", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -266,7 +266,7 @@ class TestWebHCatServer(RMFTestCase): classname = "WebHCatServer", command = "security_status", config_file="../../2.1/configs/secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) @@ -291,7 +291,7 @@ class TestWebHCatServer(RMFTestCase): classname = "WebHCatServer", command = "security_status", config_file="../../2.1/configs/secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) except: @@ -308,7 +308,7 @@ class TestWebHCatServer(RMFTestCase): classname = "WebHCatServer", command = "security_status", config_file="../../2.1/configs/secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) put_structured_out_mock.assert_called_with({"securityIssuesFound": "Keytab file or principal are not set property."}) @@ -327,7 +327,7 @@ class TestWebHCatServer(RMFTestCase): classname = "WebHCatServer", command = "security_status", config_file="../../2.1/configs/secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) put_structured_out_mock.assert_called_with({"securityState": "UNSECURED"}) @@ -337,7 +337,7 @@ class TestWebHCatServer(RMFTestCase): classname = "WebHCatServer", command = "security_status", config_file="../../2.1/configs/default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) put_structured_out_mock.assert_called_with({"securityState": "UNSECURED"}) @@ -353,7 +353,7 @@ class TestWebHCatServer(RMFTestCase): classname = "WebHCatServer", command = "pre_upgrade_restart", config_dict = json_content, - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES) self.assertResourceCalled('Execute', ('ambari-python-wrap', '/usr/bin/hdp-select', 'set', 'hive-webhcat', version), sudo=True,) @@ -375,7 +375,7 @@ class TestWebHCatServer(RMFTestCase): classname = "WebHCatServer", command = "pre_upgrade_restart", config_dict = json_content, - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, call_mocks = [(0, None, ''), (0, None, '')], mocks_dict = mocks_dict) @@ -419,7 +419,7 @@ class TestWebHCatServer(RMFTestCase): classname = "WebHCatServer", command = "configure", config_dict = json_content, - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, call_mocks = [(0, None), (0, None)], mocks_dict = mocks_dict) http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_client.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_client.py b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_client.py index aab9bb0..46cacf5 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_client.py +++ b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_client.py @@ -31,7 +31,7 @@ class TestOozieClient(RMFTestCase): classname = "OozieClient", command = "configure", config_file="default.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('Directory', '/etc/oozie/conf', @@ -97,7 +97,7 @@ class TestOozieClient(RMFTestCase): classname = "OozieClient", command = "configure", config_file="secured.json", - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('Directory', '/etc/oozie/conf', @@ -169,7 +169,7 @@ class TestOozieClient(RMFTestCase): classname = "OozieClient", command = "configure", config_dict=default_json, - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) self.assertResourceCalled('Directory', '/usr/hdp/current/oozie-client/conf', @@ -241,7 +241,7 @@ class TestOozieClient(RMFTestCase): classname = "OozieClient", command = "pre_upgrade_restart", config_dict = json_content, - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES) self.assertResourceCalled('Execute', ('ambari-python-wrap', '/usr/bin/hdp-select', 'set', 'oozie-client', version), sudo=True) @@ -262,7 +262,7 @@ class TestOozieClient(RMFTestCase): classname = "OozieClient", command = "pre_upgrade_restart", config_dict = json_content, - hdp_stack_version = self.STACK_VERSION, + stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, call_mocks = [(0, None, ''), (0, None)], mocks_dict = mocks_dict)