Ejemplo n.º 1
0
 def test_macs(self):
     """Test reporting of learned MACs."""
     self.write_prom_input_file(self.learned_macs_prom())
     (endpoints, report_metrics, label_matches, nonzero_only,
      _) = fctl.parse_args(self.fctl_args())
     metrics = fctl.scrape_prometheus(endpoints)
     report_out = fctl.report_label_match_metrics(
         report_metrics=report_metrics,
         metrics=metrics,
         label_matches=label_matches,
         nonzero_only=nonzero_only)
     self.assertEqual(report_out, self.learned_macs_result())
Ejemplo n.º 2
0
 def test_macs(self):
     prom_input_file_name = os.path.join(self.tmpdir, 'prom_input.txt')
     with open(prom_input_file_name, 'w') as prom_input_file:
         prom_input_file.write(self.learned_macs_prom())
     (endpoints, report_metrics, label_matches, nonzero_only,
      _) = fctl.parse_args(self.fctl_args())
     metrics = fctl.scrape_prometheus(endpoints)
     report_out = fctl.report_label_match_metrics(  # pylint: disable=assignment-from-no-return
         report_metrics=report_metrics,
         metrics=metrics,
         label_matches=label_matches,
         nonzero_only=nonzero_only)
     self.assertEqual(report_out, self.learned_macs_result())
Ejemplo n.º 3
0
 def test_macs(self):
     """Test reporting of learned MACs."""
     self.write_prom_input_file(self.learned_macs_prom())
     (
         endpoints,
         report_metrics,
         label_matches,
         nonzero_only,
         _
         ) = fctl.parse_args(self.fctl_args())
     metrics = fctl.scrape_prometheus(endpoints)
     report_out = fctl.report_label_match_metrics( # pylint: disable=assignment-from-no-return
         report_metrics=report_metrics,
         metrics=metrics,
         label_matches=label_matches,
         nonzero_only=nonzero_only)
     self.assertEqual(report_out, self.learned_macs_result())
Ejemplo n.º 4
0
 def test_macs(self):
     """Test reporting of learned MACs."""
     prom_input_file_name = os.path.join(self.tmpdir, 'prom_input.txt')
     with open(prom_input_file_name, 'w') as prom_input_file:
         prom_input_file.write(self.learned_macs_prom())
     (
         endpoints,
         report_metrics,
         label_matches,
         nonzero_only,
         _
         ) = fctl.parse_args(self.fctl_args())
     metrics = fctl.scrape_prometheus(endpoints)
     report_out = fctl.report_label_match_metrics( # pylint: disable=assignment-from-no-return
         report_metrics=report_metrics,
         metrics=metrics,
         label_matches=label_matches,
         nonzero_only=nonzero_only)
     self.assertEqual(report_out, self.learned_macs_result())