Guest User

Untitled

a guest
Jun 22nd, 2017
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.85 KB | None | 0 0
  1.  def _entity_test_template(self, entity_name, entity_type, entity_id,
  2.                             chart_name, metrics):
  3.     """
  4.        Test template for entity - metrics combo of tests
  5.        Args:
  6.        entity_name(str): Name of the entity
  7.        entity_type(str): Type of the entity e.g., host
  8.        entity_id(int):ID of the entiry
  9.        chart_name(str): Name of the chart
  10.        metrics(list): List of the metrics to be collected
  11.    Returns:
  12.    """
  13.  
  14.     log.INFO("Testing - %s, %s" % (entity_name, chart_name))
  15.     self.main_menu.click_analysis()
  16.     self.analysis.dismiss_chart_helper()
  17.     if self.analysis.check_default_charts_button_is_visible():
  18.       self.analysis.create_default_charts()
  19.     log.INFO("Creating entity - metrics combo chart %s" % chart_name)
  20.     self.create_chart(entity_name, entity_type, chart_name, metrics.keys())
  21.     log.INFO("Performing a UI metric value comparison from graph to REST")
  22.     self.analysis._select_timeline_scale()
  23.     self._get_chart_details_from_rest()
  24.     chart_names = self._get_chart_names()
  25.     chart_dict = dict((v, k) for k, v in chart_names.iteritems())
  26.     chart_name1 = chart_name.encode("utf-8")
  27.     chart_id = chart_dict[chart_name1]
  28.     # create a rest client object and pass it to
  29.     prc = PrismRestClient(svm_ip=self.svm_ip,
  30.                           prism_user=self.prism_user,
  31.                           prism_password=self.prism_passwd)
  32.     self.analysis_chart = AnalysisChart(self.browser, chart_id)
  33.     self.analysis_chart.compare_chart_and_rest_values(chart_id,
  34.                                                       entity_type,
  35.                                                       metrics.values(),
  36.                                                       prc, entity_id)
  37.     log.INFO("Deleting entity - metrics combo chart %s" % chart_name1)
  38.     self.delete_chart(chart_name1)
Add Comment
Please, Sign In to add comment