2828 'ActionOnFailure' : 'TERMINATE_CLUSTER'
2929}
3030
31+ INSTALL_HIVE_SITE_STEP = {
32+ 'HadoopJarStep' : {
33+ 'Args' : ['s3://us-east-1.elasticmapreduce/libs/hive/hive-script' ,
34+ '--base-path' ,
35+ 's3://us-east-1.elasticmapreduce/libs/hive' ,
36+ '--install-hive-site' ,
37+ '--hive-site=s3://test/hive-conf/hive-site.xml' ,
38+ '--hive-versions' , 'latest' ],
39+ 'Jar' :
40+ ('s3://us-east-1.elasticmapreduce/libs/'
41+ 'script-runner/script-runner.jar' )
42+ },
43+ 'Name' : 'Install Hive Site Configuration' ,
44+ 'ActionOnFailure' : 'CANCEL_AND_WAIT'
45+ }
46+
3147INSTALL_PIG_STEP = {
3248 'HadoopJarStep' : {
3349 'Args' : ['s3://elasticmapreduce/libs/pig/pig-script' ,
4258
4359
4460class TestInstallApplications (BaseAWSCommandParamsTest ):
45- prefix = 'emr install-applications --cluster-id j-ABC123456'
61+ prefix = ('emr install-applications --cluster-id '
62+ 'j-ABC123456 --applications ' )
4663
4764 def test_intall_hive_with_version (self ):
48- cmdline = self .prefix + ' --applications Name=Hive,Version=0.8.1.8'
65+ cmdline = self .prefix + 'Name=Hive,Version=0.8.1.8'
4966
5067 step = copy .deepcopy (INSTALL_HIVE_STEP )
5168 step ['HadoopJarStep' ]['Args' ][5 ] = '0.8.1.8'
5269
5370 result = {'JobFlowId' : 'j-ABC123456' , 'Steps' : [step ]}
5471 self .assert_params_for_cmd (cmdline , result )
5572
73+ def test_install_hive_site (self ):
74+ cmdline = (self .prefix + 'Name=Hive,'
75+ 'Args=[--hive-site=s3://test/hive-conf/hive-site.xml]' )
76+ result = {'JobFlowId' : 'j-ABC123456' ,
77+ 'Steps' : [INSTALL_HIVE_STEP , INSTALL_HIVE_SITE_STEP ]
78+ }
79+ self .assert_params_for_cmd (cmdline , result )
80+ cmdline = (self .prefix + 'Name=Hive,'
81+ 'Args=[--hive-site=s3://test/hive-conf/hive-site.xml,k1]' )
82+ self .assert_params_for_cmd (cmdline , result )
83+
5684 def test_intall_pig_with_version (self ):
57- cmdline = self .prefix + ' --applications Name=Pig,Version=0.9.2.1'
85+ cmdline = self .prefix + 'Name=Pig,Version=0.9.2.1'
5886
5987 step = copy .deepcopy (INSTALL_PIG_STEP )
6088 step ['HadoopJarStep' ]['Args' ][5 ] = '0.9.2.1'
@@ -63,15 +91,13 @@ def test_intall_pig_with_version(self):
6391 self .assert_params_for_cmd (cmdline , result )
6492
6593 def test_intall_hive_and_pig_without_version (self ):
66- cmdline = self .prefix + ' --cluster-id j-ABC123456 --applications Name=Hive' + \
67- ' Name=Pig'
94+ cmdline = self .prefix + 'Name=Hive Name=Pig'
6895 result = {'JobFlowId' : 'j-ABC123456' , 'Steps' : [INSTALL_HIVE_STEP ,
6996 INSTALL_PIG_STEP ]}
7097 self .assert_params_for_cmd (cmdline , result )
7198
7299 def test_install_impala_error (self ):
73- cmdline = self .prefix + \
74- ' --cluster-id j-ABC123456 --applications Name=Impala'
100+ cmdline = self .prefix + ' Name=Impala'
75101
76102 expected_error_msg = "\n aws: error: Impala cannot be installed on" + \
77103 " a running cluster. 'Name' should be one of the following:" + \
@@ -80,8 +106,7 @@ def test_install_impala_error(self):
80106 self .assertEqual (result [1 ], expected_error_msg )
81107
82108 def test_install_unknown_app_error (self ):
83- cmdline = self .prefix + \
84- ' --cluster-id j-ABC123456 --applications Name=unknown'
109+ cmdline = self .prefix + 'Name=unknown'
85110
86111 expected_error_msg = "\n aws: error: Unknown application: unknown." + \
87112 " 'Name' should be one of the following: HIVE, PIG, HBASE," + \
0 commit comments