def testClientMethodsAreAccessChecked(self):
    args = api_client.ApiInterrogateClientArgs(client_id=self.client_id)
    self.CheckMethodIsAccessChecked(
        self.router.InterrogateClient, "CheckClientAccess", args=args)

    args = api_client.ApiListClientCrashesArgs(client_id=self.client_id)
    self.CheckMethodIsAccessChecked(
        self.router.ListClientCrashes, "CheckClientAccess", args=args)

    args = api_client.ApiGetClientLoadStatsArgs(client_id=self.client_id)
    self.CheckMethodIsAccessChecked(
        self.router.GetClientLoadStats, "CheckClientAccess", args=args)
示例#2
0
    def testInterrogateFlowIsStarted(self):
        flows_fd = aff4.FACTORY.Open(self.client_id.Add("flows"),
                                     token=self.token)
        flows_urns = list(flows_fd.ListChildren())
        self.assertEqual(len(flows_urns), 0)

        args = client_plugin.ApiInterrogateClientArgs(client_id=self.client_id)
        result = self.handler.Handle(args, token=self.token)

        flows_fd = aff4.FACTORY.Open(self.client_id.Add("flows"),
                                     token=self.token)
        flows_urns = list(flows_fd.ListChildren())
        self.assertEqual(len(flows_urns), 1)
        self.assertEqual(str(flows_urns[0]), result.operation_id)