Merge "Add check to integration tests to check event-log"
This commit is contained in:
commit
39121d72e8
@ -421,6 +421,34 @@ class ITestCase(testcase.WithAttributes, base.BaseTestCase):
|
||||
% self.common_config.HDFS_INITIALIZATION_TIMEOUT)
|
||||
self.close_ssh_connection()
|
||||
|
||||
@errormsg("Failure while event log testing: ")
|
||||
def _test_event_log(self, cluster_id):
|
||||
cluster = self.sahara.clusters.get(cluster_id)
|
||||
events = self.sahara.events.list(cluster_id)
|
||||
|
||||
invalid_steps = []
|
||||
if not events:
|
||||
events = []
|
||||
|
||||
for step in cluster.provision_progress:
|
||||
if not step['successful']:
|
||||
invalid_steps.append(step)
|
||||
|
||||
if len(invalid_steps) > 0 or len(events) > 0:
|
||||
events_info = "\n".join(six.text_type(e) for e in events)
|
||||
invalid_steps_info = "\n".join(six.text_type(e)
|
||||
for e in invalid_steps)
|
||||
steps_info = "\n".join(six.text_type(e)
|
||||
for e in cluster.provision_progress)
|
||||
self.fail(
|
||||
"Issues with event log work: "
|
||||
"\n Not removed events: \n\n {events}"
|
||||
"\n Incomplete steps: \n\n {invalid_steps}"
|
||||
"\n All steps: \n\n {steps}".format(
|
||||
events=events_info,
|
||||
steps=steps_info,
|
||||
invalid_steps=invalid_steps_info))
|
||||
|
||||
# --------------------------------Remote---------------------------------------
|
||||
|
||||
def connect_to_swift(self):
|
||||
|
@ -374,6 +374,7 @@ class CDHGatingTest(check_services.CheckServicesTest,
|
||||
self._create_nm_dn_ng_template()
|
||||
self._create_cluster_template()
|
||||
self._create_cluster()
|
||||
self._test_event_log(self.cluster_id)
|
||||
|
||||
self._check_cinder()
|
||||
self._check_mapreduce()
|
||||
@ -382,6 +383,7 @@ class CDHGatingTest(check_services.CheckServicesTest,
|
||||
|
||||
if not self.plugin_config.SKIP_SCALING_TEST:
|
||||
self._check_scaling()
|
||||
self._test_event_log(self.cluster_id)
|
||||
self._check_cinder_after_scaling()
|
||||
self._check_edp_after_scaling()
|
||||
self._check_mapreduce_after_scaling()
|
||||
|
@ -207,12 +207,13 @@ class HDP2GatingTest(swift.SwiftTest, scaling.ScalingTest,
|
||||
self._create_nm_dn_ng_template()
|
||||
self._create_cluster_template()
|
||||
self._create_cluster()
|
||||
|
||||
self._test_event_log(self.cluster_id)
|
||||
self._check_swift()
|
||||
self._check_edp()
|
||||
|
||||
if not self.plugin_config.SKIP_SCALING_TEST:
|
||||
self._check_scaling()
|
||||
self._test_event_log(self.cluster_id)
|
||||
self._check_swift_after_scaling()
|
||||
self._check_edp_after_scaling()
|
||||
|
||||
|
@ -130,7 +130,10 @@ class HDPGatingTest(cinder.CinderVolumeTest, edp.EDPTest,
|
||||
message = 'Failure while cluster creation: '
|
||||
self.print_error_log(message, e)
|
||||
|
||||
# --------------------------------CINDER TESTING-------------------------------
|
||||
# --------------------------------EVENT LOG TESTING---------------------------
|
||||
self._test_event_log(cluster_id)
|
||||
|
||||
# --------------------------------CINDER TESTING------------------------------
|
||||
|
||||
try:
|
||||
self.cinder_volume_testing(cluster_info)
|
||||
@ -226,7 +229,7 @@ class HDPGatingTest(cinder.CinderVolumeTest, edp.EDPTest,
|
||||
message = 'Failure during check of Swift availability: '
|
||||
self.print_error_log(message, e)
|
||||
|
||||
# -------------------------------CLUSTER SCALING-------------------------------
|
||||
# -------------------------------CLUSTER SCALING------------------------------
|
||||
|
||||
if not self.plugin_config.SKIP_SCALING_TEST:
|
||||
datanode_count_after_resizing = (
|
||||
@ -261,7 +264,10 @@ class HDPGatingTest(cinder.CinderVolumeTest, edp.EDPTest,
|
||||
message = 'Failure while cluster scaling: '
|
||||
self.print_error_log(message, e)
|
||||
|
||||
# -------------------------CINDER TESTING AFTER SCALING------------------------
|
||||
# --------------------------------EVENT LOG TESTING---------------------------
|
||||
self._test_event_log(cluster_id)
|
||||
|
||||
# -------------------------CINDER TESTING AFTER SCALING-----------------------
|
||||
|
||||
try:
|
||||
self.cinder_volume_testing(new_cluster_info)
|
||||
|
@ -146,11 +146,12 @@ class SparkGatingTest(swift.SwiftTest, scaling.ScalingTest,
|
||||
self._create_s_dn_ng_template()
|
||||
self._create_cluster_template()
|
||||
self._create_cluster()
|
||||
|
||||
self._test_event_log(self.cluster_id)
|
||||
self._check_edp()
|
||||
|
||||
if not self.plugin_config.SKIP_SCALING_TEST:
|
||||
self._check_scaling()
|
||||
self._test_event_log(self.cluster_id)
|
||||
self._check_edp_after_scaling()
|
||||
|
||||
def tearDown(self):
|
||||
|
@ -135,4 +135,7 @@ class TransientGatingTest(edp.EDPTest):
|
||||
self._prepare_test()
|
||||
self._create_cluster_template()
|
||||
self._create_cluster()
|
||||
for cluster_id in self.cluster_ids:
|
||||
self._test_event_log(cluster_id)
|
||||
|
||||
self._check_transient()
|
||||
|
@ -293,13 +293,16 @@ class VanillaGatingTest(cinder.CinderVolumeTest,
|
||||
self._create_dn_ng_template()
|
||||
self._create_cluster_template()
|
||||
self._create_cluster()
|
||||
self._test_event_log(self.cluster_id)
|
||||
self._check_cinder()
|
||||
self._check_cluster_config()
|
||||
self._check_edp()
|
||||
self._check_mapreduce()
|
||||
self._check_swift()
|
||||
|
||||
if not self.plugin_config.SKIP_SCALING_TEST:
|
||||
self._check_scaling()
|
||||
self._test_event_log(self.cluster_id)
|
||||
self._check_cinder_after_scaling()
|
||||
self._check_cluster_config_after_scaling()
|
||||
self._check_mapredure_after_scaling()
|
||||
|
@ -328,6 +328,7 @@ class VanillaTwoGatingTest(cluster_configs.ClusterConfigTest,
|
||||
self._create_dn_ng_template()
|
||||
self._create_cluster_template()
|
||||
self._create_cluster()
|
||||
self._test_event_log(self.cluster_id)
|
||||
|
||||
self._check_cinder()
|
||||
self._check_mapreduce()
|
||||
@ -336,6 +337,7 @@ class VanillaTwoGatingTest(cluster_configs.ClusterConfigTest,
|
||||
|
||||
if not self.plugin_config.SKIP_SCALING_TEST:
|
||||
self._check_scaling()
|
||||
self._test_event_log(self.cluster_id)
|
||||
self._check_cinder_after_scaling()
|
||||
self._check_mapreduce_after_scaling()
|
||||
self._check_swift_after_scaling()
|
||||
|
Loading…
Reference in New Issue
Block a user