Esempio n. 1
0
    def Run(self):
        self.CreateCronJob(flow_name=cron_system.OSBreakDown.__name__,
                           token=self.token)
        self.CreateCronJob(flow_name=cron_system.GRRVersionBreakDown.__name__,
                           token=self.token)

        self.Check("ModifyCronJob",
                   args=cron_plugin.ApiModifyCronJobArgs(
                       cron_job_id=cron_system.OSBreakDown.__name__,
                       state="ENABLED"))
        self.Check("ModifyCronJob",
                   args=cron_plugin.ApiModifyCronJobArgs(
                       cron_job_id=cron_system.GRRVersionBreakDown.__name__,
                       state="DISABLED"))
Esempio n. 2
0
  def testCronJobMethodsAreAccessChecked(self):
    args = api_cron.ApiForceRunCronJobArgs(cron_job_id="TestCronJob")
    self.CheckMethodIsAccessChecked(
        self.router.ForceRunCronJob, "CheckCronJobAccess", args=args)

    args = api_cron.ApiModifyCronJobArgs(cron_job_id="TestCronJob")
    self.CheckMethodIsAccessChecked(
        self.router.ModifyCronJob, "CheckCronJobAccess", args=args)

    args = api_cron.ApiDeleteCronJobArgs(cron_job_id="TestCronJob")
    self.CheckMethodIsAccessChecked(
        self.router.DeleteCronJob, "CheckCronJobAccess", args=args)