grr/server/grr_response_server/flows/general/collectors_test.py
def testLinuxMountCmdArtifact(self):
    """Test that LinuxMountCmd artifact can be collected."""

    artifact_list = ["LinuxMountCmd"]

    self.cleanup = InitGRRWithTestSources("""
name: LinuxMountCmd
doc: Linux output of mount.
sources:
- type: COMMAND
  attributes:
    cmd: '/bin/mount'
    args: []
labels: [System]
supported_os: [Linux]
""")

    self.assertTrue(artifact_registry.REGISTRY.GetArtifact("LinuxMountCmd"))

    # Run the ArtifactCollector to get the expected result.
    expected = self._RunFlow(
        aff4_flows.ArtifactCollectorFlow,
        standard.ExecuteCommand,
        artifact_list,
        apply_parsers=False)
    expected = expected[0]
    self.assertIsInstance(expected, rdf_client_action.ExecuteResponse)

    # Run the ClientArtifactCollector to get the actual result.
    results = self._RunFlow(
        aff4_flows.ClientArtifactCollector,
        artifact_collector.ArtifactCollector,
        artifact_list,
        apply_parsers=False)
    artifact_response = results[0]
    self.assertIsInstance(artifact_response, rdf_client_action.ExecuteResponse)

    self.assertEqual(artifact_response, expected)
Test that LinuxMountCmd artifact can be collected.
Test that LinuxMountCmd artifact can be collected.
Test that LinuxMountCmd artifact can be collected .
def testLinuxMountCmdArtifact(self):
    artifact_list = ["LinuxMountCmd"]
    self.cleanup = InitGRRWithTestSources("""
name: LinuxMountCmd
doc: Linux output of mount.
sources:
- type: COMMAND
  attributes:
    cmd: '/bin/mount'
    args: []
labels: [System]
supported_os: [Linux]
""")
    self.assertTrue(artifact_registry.REGISTRY.GetArtifact("LinuxMountCmd"))
    expected = self._RunFlow(
        aff4_flows.ArtifactCollectorFlow,
        standard.ExecuteCommand,
        artifact_list,
        apply_parsers=False)
    expected = expected[0]
    self.assertIsInstance(expected, rdf_client_action.ExecuteResponse)
    results = self._RunFlow(
        aff4_flows.ClientArtifactCollector,
        artifact_collector.ArtifactCollector,
        artifact_list,
        apply_parsers=False)
    artifact_response = results[0]
    self.assertIsInstance(artifact_response, rdf_client_action.ExecuteResponse)
    self.assertEqual(artifact_response, expected)
def testLinuxMountCmdArtifact ( self ) : artifact_list = [ "LinuxMountCmd" ] self . cleanup = InitGRRWithTestSources ( """
name: LinuxMountCmd
doc: Linux output of mount.
sources:
- type: COMMAND
  attributes:
    cmd: '/bin/mount'
    args: []
labels: [System]
supported_os: [Linux]
""" ) self . assertTrue ( artifact_registry . REGISTRY . GetArtifact ( "LinuxMountCmd" ) ) expected = self . _RunFlow ( aff4_flows . ArtifactCollectorFlow , standard . ExecuteCommand , artifact_list , apply_parsers = False ) expected = expected [ 0 ] self . assertIsInstance ( expected , rdf_client_action . ExecuteResponse ) results = self . _RunFlow ( aff4_flows . ClientArtifactCollector , artifact_collector . ArtifactCollector , artifact_list , apply_parsers = False ) artifact_response = results [ 0 ] self . assertIsInstance ( artifact_response , rdf_client_action . ExecuteResponse ) self . assertEqual ( artifact_response , expected )
Test that LinuxMountCmd artifact can be collected.
Test that LinuxMountCmd artifact can be collected .
"""Test that LinuxMountCmd artifact can be collected.""" # Run the ArtifactCollector to get the expected result. # Run the ClientArtifactCollector to get the actual result.
self