Exemplo n.º 1
0
    def runTest(self):
        """Launch our flows."""
        for flow, args in [
            ("ListDirectory", {
                "pathspec":
                rdf_paths.PathSpec(
                    pathtype=rdf_paths.PathSpec.PathType.REGISTRY,
                    path=self.reg_path)
            }),
            ("FindFiles", {
                "findspec":
                rdf_client.FindSpec(pathspec=rdf_paths.PathSpec(
                    path=self.reg_path,
                    pathtype=rdf_paths.PathSpec.PathType.REGISTRY),
                                    path_regex="ProfileImagePath"),
                "output":
                self.output_path
            })
        ]:

            if self.local_worker:
                self.session_id = debugging.StartFlowAndWorker(
                    self.client_id, flow, **args)
            else:
                self.session_id = flow_utils.StartFlowAndWait(self.client_id,
                                                              flow_name=flow,
                                                              token=self.token,
                                                              **args)

        self.CheckFlow()
Exemplo n.º 2
0
  def runTest(self):
    """Launch our flows."""
    for flow, args in [(filesystem.ListDirectory.__name__, {
        "pathspec":
            rdf_paths.PathSpec(
                pathtype=rdf_paths.PathSpec.PathType.REGISTRY,
                path=self.reg_path)
    }), (find.FindFiles.__name__, {
        "findspec":
            rdf_client.FindSpec(
                pathspec=rdf_paths.PathSpec(
                    path=self.reg_path,
                    pathtype=rdf_paths.PathSpec.PathType.REGISTRY),
                path_regex="ProfileImagePath"),
    })]:

      if self.local_worker:
        self.session_id = debugging.StartFlowAndWorker(self.client_id, flow,
                                                       **args)
      else:
        self.session_id = flow_utils.StartFlowAndWait(
            self.client_id, flow_name=flow, token=self.token, **args)

    results = self.CheckResultCollectionNotEmptyWithRetry(self.session_id)
    for stat_entry in results:
      self.assertTrue(isinstance(stat_entry, rdf_client.StatEntry))
      self.assertTrue("ProfileImagePath" in stat_entry.pathspec.path)
Exemplo n.º 3
0
    def runTest(self):
        if self.local_worker:
            self.session_id = debugging.StartFlowAndWorker(
                self.client_id, self.flow, **self.args)
        else:
            self.session_id = flow_utils.StartFlowAndWait(self.client_id,
                                                          flow_name=self.flow,
                                                          timeout=self.timeout,
                                                          token=self.token,
                                                          **self.args)

        self.CheckFlow()
Exemplo n.º 4
0
  def runTest(self):
    if self.client_min_version:
      target_client = aff4.FACTORY.Open(self.client_id, token=self.token)
      client_info = target_client.Get(target_client.Schema.CLIENT_INFO)
      if client_info.client_version < self.client_min_version:
        message = "Skipping version %s less than client_min_version: %s" % (
            client_info.client_version, self.client_min_version)
        return self.skipTest(message)

    if self.local_worker:
      self.session_id = debugging.StartFlowAndWorker(
          self.client_id, self.flow, **self.args)
    else:
      self.session_id = flow_utils.StartFlowAndWait(
          self.client_id, flow_name=self.flow,
          timeout=self.timeout, token=self.token, **self.args)

    self.CheckFlow()
Exemplo n.º 5
0
    def runTest(self):
        if self.local_worker:
            self.session_id = debugging.StartFlowAndWorker(
                self.client_id,
                self.flow,
                cpu_limit=self.cpu_limit,
                network_bytes_limit=self.network_bytes_limit,
                **self.args)
        else:
            self.session_id = flow_utils.StartFlowAndWait(
                self.client_id,
                flow_name=self.flow,
                cpu_limit=self.cpu_limit,
                network_bytes_limit=self.network_bytes_limit,
                token=self.token,
                **self.args)

        self.CheckFlow()