Example #1
0
    def testOSBreakdown(self):
        """Check that all client stats cron jobs are run."""
        run = rdf_cronjobs.CronJobRun()
        job = rdf_cronjobs.CronJob()
        system.OSBreakDownCronJob(run, job).Run()

        self._CheckOSBreakdown()
Example #2
0
    def testOSBreakdownReportPlugin(self):
        # Add a client to be reported.
        self.SetupClients(1)

        # Scan for clients to be reported (the one we just added).
        cron_system.OSBreakDownCronJob(None, None).Run()

        report = report_plugins.GetReportByName(
            client_report_plugins.OSBreakdown30ReportPlugin.__name__)

        api_report_data = report.GetReportData(
            stats_api.ApiGetReportArgs(name=report.__class__.__name__,
                                       client_label="All"))

        self.assertEqual(
            api_report_data,
            rdf_report_plugins.ApiReportData(
                pie_chart=rdf_report_plugins.ApiPieChartReportData(data=[
                    rdf_report_plugins.ApiReportDataPoint1D(label="Linux", x=1)
                ]),
                representation_type=RepresentationType.PIE_CHART))