grr/server/grr_response_server/flows/general/collectors_test.py
def testRunGrrClientActionArtifactSplit(self):
    """Test that artifacts get split into separate collections."""
    client_id = self.SetupClient(0, system="Linux")
    with utils.Stubber(psutil, "process_iter", ProcessIter):
      client_mock = action_mocks.ActionMock(standard.ListProcesses)

      coll1 = rdf_artifacts.ArtifactSource(
          type=rdf_artifacts.ArtifactSource.SourceType.GRR_CLIENT_ACTION,
          attributes={"client_action": standard.ListProcesses.__name__})
      self.fakeartifact.sources.append(coll1)
      self.fakeartifact2.sources.append(coll1)
      artifact_list = ["FakeArtifact", "FakeArtifact2"]
      session_id = flow_test_lib.TestFlowHelper(
          aff4_flows.ArtifactCollectorFlow.__name__,
          client_mock,
          artifact_list=artifact_list,
          token=self.token,
          client_id=client_id,
          split_output_by_artifact=True)
      results_by_tag = flow_test_lib.GetFlowResultsByTag(
          client_id.Basename(), session_id)
      self.assertCountEqual(results_by_tag.keys(),
                            ["artifact:FakeArtifact", "artifact:FakeArtifact2"])
Test that artifacts get split into separate collections.
Test that artifacts get split into separate collections.
Test that artifacts get split into separate collections .
def testRunGrrClientActionArtifactSplit(self):
    client_id = self.SetupClient(0, system="Linux")
    with utils.Stubber(psutil, "process_iter", ProcessIter):
      client_mock = action_mocks.ActionMock(standard.ListProcesses)
      coll1 = rdf_artifacts.ArtifactSource(
          type=rdf_artifacts.ArtifactSource.SourceType.GRR_CLIENT_ACTION,
          attributes={"client_action": standard.ListProcesses.__name__})
      self.fakeartifact.sources.append(coll1)
      self.fakeartifact2.sources.append(coll1)
      artifact_list = ["FakeArtifact", "FakeArtifact2"]
      session_id = flow_test_lib.TestFlowHelper(
          aff4_flows.ArtifactCollectorFlow.__name__,
          client_mock,
          artifact_list=artifact_list,
          token=self.token,
          client_id=client_id,
          split_output_by_artifact=True)
      results_by_tag = flow_test_lib.GetFlowResultsByTag(
          client_id.Basename(), session_id)
      self.assertCountEqual(results_by_tag.keys(),
                            ["artifact:FakeArtifact", "artifact:FakeArtifact2"])
def testRunGrrClientActionArtifactSplit ( self ) : client_id = self . SetupClient ( 0 , system = "Linux" ) with utils . Stubber ( psutil , "process_iter" , ProcessIter ) : client_mock = action_mocks . ActionMock ( standard . ListProcesses ) coll1 = rdf_artifacts . ArtifactSource ( type = rdf_artifacts . ArtifactSource . SourceType . GRR_CLIENT_ACTION , attributes = { "client_action" : standard . ListProcesses . __name__ } ) self . fakeartifact . sources . append ( coll1 ) self . fakeartifact2 . sources . append ( coll1 ) artifact_list = [ "FakeArtifact" , "FakeArtifact2" ] session_id = flow_test_lib . TestFlowHelper ( aff4_flows . ArtifactCollectorFlow . __name__ , client_mock , artifact_list = artifact_list , token = self . token , client_id = client_id , split_output_by_artifact = True ) results_by_tag = flow_test_lib . GetFlowResultsByTag ( client_id . Basename ( ) , session_id ) self . assertCountEqual ( results_by_tag . keys ( ) , [ "artifact:FakeArtifact" , "artifact:FakeArtifact2" ] )
Test that artifacts get split into separate collections.
Test that artifacts get split into separate collections .
"""Test that artifacts get split into separate collections."""
self