grr/server/grr_response_server/flows/general/collectors_test.py
def testArtifactFilesWithPathspecAttribute(self):
    """Test collecting ArtifactFiles with specified pathspec attribute."""

    artifact_list = ["TestArtifactFilesArtifact"]

    self.InitializeTestFileArtifact(with_pathspec_attribute=True)

    # Run the ArtifactCollector to get the expected result.
    session_id = flow_test_lib.TestFlowHelper(
        aff4_flows.ArtifactCollectorFlow.__name__,
        action_mocks.FileFinderClientMock(),
        artifact_list=artifact_list,
        token=self.token,
        apply_parsers=False,
        client_id=self.client_id)
    results = flow_test_lib.GetFlowResults(self.client_id, session_id)
    expected = results[0]

    self.assertIsInstance(expected, rdf_client_fs.StatEntry)

    # Run the ClientArtifactCollector to get the actual result.
    cac_results = self._RunFlow(
        aff4_flows.ClientArtifactCollector,
        artifact_collector.ArtifactCollector,
        artifact_list,
        apply_parsers=False)
    self.assertLen(cac_results, 1)
    artifact_response = cac_results[0]

    self.assertEqual(artifact_response.pathspec.path, expected.pathspec.path)
Test collecting ArtifactFiles with specified pathspec attribute.
Test collecting ArtifactFiles with specified pathspec attribute.
Test collecting ArtifactFiles with specified pathspec attribute .
def testArtifactFilesWithPathspecAttribute(self):
    artifact_list = ["TestArtifactFilesArtifact"]
    self.InitializeTestFileArtifact(with_pathspec_attribute=True)
    session_id = flow_test_lib.TestFlowHelper(
        aff4_flows.ArtifactCollectorFlow.__name__,
        action_mocks.FileFinderClientMock(),
        artifact_list=artifact_list,
        token=self.token,
        apply_parsers=False,
        client_id=self.client_id)
    results = flow_test_lib.GetFlowResults(self.client_id, session_id)
    expected = results[0]
    self.assertIsInstance(expected, rdf_client_fs.StatEntry)
    cac_results = self._RunFlow(
        aff4_flows.ClientArtifactCollector,
        artifact_collector.ArtifactCollector,
        artifact_list,
        apply_parsers=False)
    self.assertLen(cac_results, 1)
    artifact_response = cac_results[0]
    self.assertEqual(artifact_response.pathspec.path, expected.pathspec.path)
def testArtifactFilesWithPathspecAttribute ( self ) : artifact_list = [ "TestArtifactFilesArtifact" ] self . InitializeTestFileArtifact ( with_pathspec_attribute = True ) session_id = flow_test_lib . TestFlowHelper ( aff4_flows . ArtifactCollectorFlow . __name__ , action_mocks . FileFinderClientMock ( ) , artifact_list = artifact_list , token = self . token , apply_parsers = False , client_id = self . client_id ) results = flow_test_lib . GetFlowResults ( self . client_id , session_id ) expected = results [ 0 ] self . assertIsInstance ( expected , rdf_client_fs . StatEntry ) cac_results = self . _RunFlow ( aff4_flows . ClientArtifactCollector , artifact_collector . ArtifactCollector , artifact_list , apply_parsers = False ) self . assertLen ( cac_results , 1 ) artifact_response = cac_results [ 0 ] self . assertEqual ( artifact_response . pathspec . path , expected . pathspec . path )
Test collecting ArtifactFiles with specified pathspec attribute.
Test collecting ArtifactFiles with specified pathspec attribute .
"""Test collecting ArtifactFiles with specified pathspec attribute.""" # Run the ArtifactCollector to get the expected result. # Run the ClientArtifactCollector to get the actual result.
self