Module Expr Str Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias identifier ImportFrom alias identifier ImportFrom alias identifier ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults vararg kwarg body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad ListComp TupleLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr CompareIn NameLoad NameLoad Assign AttributeStore NameLoad attr Call NameLoad GeneratorExp TupleLoad NameLoad Num comprehension NameStore NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Pass decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr If Call NameLoad NameLoad AttributeLoad NameLoad attr body Return Call Call NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr TryExcept body Assign NameStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign NameStore SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index NameLoad handlers ExceptHandler type TupleLoad NameLoad NameLoad body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr Assign NameStore Call NameLoad keyword AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad AugAssignAdd SubscriptStore AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr Num Return Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults vararg body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Dict decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad ListLoad attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Raise Call NameLoad Str decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr keyword Str Assign NameStore Call AttributeLoad NameLoad attr keyword Str Assign NameStore ListLoad Call AttributeLoad NameLoad attr keyword NameLoad keyword Num keyword Num keyword Num keyword Num Call AttributeLoad NameLoad attr keyword NameLoad keyword Num keyword Num keyword Num keyword Num FunctionDef arguments args NameParam NameParam defaults body Return AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr keyword Str Assign NameStore Call AttributeLoad NameLoad attr keyword Str Assign NameStore ListLoad Call AttributeLoad NameLoad attr keyword NameLoad keyword Num keyword Num keyword Num keyword Num Call AttributeLoad NameLoad attr keyword NameLoad keyword Num keyword Num keyword Num keyword Num FunctionDef arguments args NameParam NameParam defaults body If CompareEq AttributeLoad NameLoad attr Str body Return AttributeLoad NameLoad attr orelse Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults vararg kwarg body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Str Str Str Str Str NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Str keyword Str keyword Call AttributeLoad NameLoad attr keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword Str Expr Call AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Str Str Str body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr ListLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body AugAssignAdd AttributeStore NameLoad attr Num Return ListLoad Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword Str keyword Str keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword Str decorator_list FunctionDef arguments args NameParam NameParam defaults body AugAssignAdd AttributeStore NameLoad attr Num Return ListLoad Call AttributeLoad NameLoad attr keyword Num decorator_list FunctionDef arguments args NameParam NameParam defaults body AugAssignAdd AttributeStore NameLoad attr Num Return ListLoad Call AttributeLoad NameLoad attr keyword Str keyword ListLoad Call AttributeLoad NameLoad attr keyword AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr keyword Str keyword Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam defaults body AugAssignAdd AttributeStore NameLoad attr Num Return ListLoad Call AttributeLoad NameLoad attr keyword Str keyword Str decorator_list FunctionDef arguments args NameParam NameParam defaults body AugAssignAdd AttributeStore NameLoad attr Num Return ListLoad Call AttributeLoad NameLoad attr keyword SubscriptLoad AttributeLoad NameLoad attr Index Str keyword Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Str keyword SubscriptLoad AttributeLoad NameLoad attr Index Str keyword ListLoad Str Str decorator_list FunctionDef arguments args NameParam NameParam defaults body AugAssignAdd AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr BinOpMod Str AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Return ListLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body AugAssignAdd AttributeStore NameLoad attr Num Return ListLoad Call AttributeLoad NameLoad attr Dict Str Str ListLoad Str Num decorator_list FunctionDef arguments args NameParam NameParam defaults body If CompareEq AttributeLoad NameLoad attr Str body AugAssignAdd AttributeStore NameLoad attr Num Return AttributeLoad NameLoad attr orelse If Call AttributeLoad AttributeLoad NameLoad attr attr Str body AugAssignAdd AttributeStore NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr For TupleStore NameStore NameStore NameLoad body If UnaryOpNot Call AttributeLoad NameLoad attr Str body TryExcept body Assign SubscriptStore NameLoad Index NameLoad NameLoad handlers ExceptHandler type NameLoad body Assign SubscriptStore NameLoad Index NameLoad BinOpMod Str NameLoad Return ListLoad NameLoad orelse Return NameLoad decorator_list decorator_list
N/A N/A A library of client action mocks for use in tests. N/A socket grr.client actions grr.lib access_control grr.lib aff4 grr.lib client_fixture grr.lib config_lib grr.lib worker_mocks grr.lib.rdfvalues client rdf_client grr.lib.rdfvalues flows rdf_flows grr.lib.rdfvalues protodict rdf_protodict ActionMock N/A object N/A N/A A client mock which runs a real action.

  This can be used as input for TestFlowHelper.

  It is possible to mix mocked actions with real actions. Simple extend this
  class and add methods for the mocked actions, while instantiating with the
  list of real actions to run:

  class MixedActionMock(ActionMock):
    def __init__(self):
      super(MixedActionMock, self).__init__("RealAction")

    def MockedAction(self, args):
      return []

  Will run the real action "RealAction" at the same time as a mocked action
  MockedAction.
   __init__ N/A N/A self N/A action_names kwargs N/A N/A N/A self client_id N/A N/A kwargs get client_id N/A N/A self action_names action_names N/A N/A self action_classes N/A dict N/A N/A k v N/A N/A k v N/A N/A N/A N/A actions ActionPlugin classes items N/A k action_names N/A N/A self action_counts N/A dict N/A N/A x 0 N/A x action_names N/A N/A self client_worker N/A N/A worker_mocks FakeClientWorker N/A RecordCall N/A N/A self action_name action_args N/A N/A N/A N/A HandleMessage N/A N/A self message N/A N/A N/A Consume a message and execute the client action. N/A N/A message auth_state N/A N/A N/A rdf_flows GrrMessage AuthorizationState AUTHENTICATED N/A N/A hasattr self N/A message name N/A N/A N/A N/A getattr self N/A message name N/A message payload N/A N/A N/A self RecordCall N/A message name N/A message payload N/A N/A N/A suspended_action_id N/A N/A N/A message payload iterator suspended_action N/A action N/A N/A N/A self client_worker suspended_actions N/A suspended_action_id N/A N/A N/A N/A AttributeError KeyError N/A N/A action_cls N/A N/A self action_classes N/A N/A message name N/A action N/A action_cls grr_worker N/A self client_worker N/A N/A N/A action Execute message N/A N/A N/A self action_counts N/A N/A message name 1 N/A N/A N/A N/A self client_worker Drain N/A N/A RecordingActionMock N/A ActionMock N/A __init__ N/A N/A self N/A action_names N/A N/A N/A N/A N/A super RecordingActionMock self __init__ action_names N/A N/A self recorded_args N/A N/A RecordCall N/A N/A self action_name action_args N/A N/A N/A N/A N/A N/A N/A N/A self recorded_args setdefault action_name N/A append action_args N/A N/A InvalidActionMock N/A object N/A N/A An action mock which raises for all actions. HandleMessage N/A N/A self unused_message N/A N/A N/A N/A RuntimeError Invalid Action Mock. N/A N/A UnixVolumeClientMock N/A ActionMock N/A N/A A mock of client filesystem volumes. N/A unix_local N/A N/A rdf_client UnixVolume mount_point /usr N/A unix_home N/A N/A rdf_client UnixVolume mount_point / N/A path_results N/A N/A N/A rdf_client Volume unixvolume unix_local bytes_per_sector 4096 sectors_per_allocation_unit 1 actual_available_allocation_units 50 total_allocation_units 100 N/A N/A rdf_client Volume unixvolume unix_home bytes_per_sector 4096 sectors_per_allocation_unit 1 actual_available_allocation_units 10 total_allocation_units 100 StatFS N/A N/A self _ N/A N/A N/A N/A self path_results N/A N/A WindowsVolumeClientMock N/A ActionMock N/A N/A A mock of client filesystem volumes. N/A windows_d N/A N/A rdf_client WindowsVolume drive_letter D: N/A windows_c N/A N/A rdf_client WindowsVolume drive_letter C: N/A path_results N/A N/A N/A rdf_client Volume windowsvolume windows_d bytes_per_sector 4096 sectors_per_allocation_unit 1 actual_available_allocation_units 50 total_allocation_units 100 N/A N/A rdf_client Volume windowsvolume windows_c bytes_per_sector 4096 sectors_per_allocation_unit 1 actual_available_allocation_units 10 total_allocation_units 100 WmiQuery N/A N/A self query N/A N/A N/A N/A N/A query query SELECT * FROM Win32_LogicalDisk N/A N/A N/A client_fixture WMI_SAMPLE N/A N/A None N/A N/A MemoryClientMock N/A ActionMock N/A N/A A mock of client state including memory actions. __init__ N/A N/A self N/A args kwargs N/A N/A N/A N/A N/A super MemoryClientMock self __init__ LoadComponent StatFile HashFile HashBuffer TransferBuffer args kwargs N/A fd N/A N/A N/A aff4 FACTORY Create aff4:/config/components/grr-rekall_0.1 ComponentObject mode w token N/A N/A access_control ACLToken username test reason reason N/A N/A N/A fd Set N/A N/A N/A fd Schema COMPONENT name grr-rekall version 0.1 N/A N/A N/A fd Close N/A N/A InterrogatedClient N/A ActionMock N/A N/A A mock of client state. InitializeClient N/A N/A self system version kernel N/A Linux 12.04 3.13.0-39-generic N/A N/A N/A self system system N/A N/A self version version N/A N/A self kernel kernel N/A N/A self response_count 0 N/A N/A self recorded_messages N/A N/A HandleMessage N/A N/A self message N/A N/A N/A Record all messages. N/A N/A N/A N/A self recorded_messages append message N/A N/A N/A N/A super InterrogatedClient self HandleMessage message N/A GetPlatformInfo N/A N/A self _ N/A N/A N/A N/A self response_count 1 N/A N/A N/A N/A rdf_client Uname system N/A self system node test_node release 5 version N/A self version kernel N/A self kernel machine i386 N/A GetInstallDate N/A N/A self _ N/A N/A N/A N/A self response_count 1 N/A N/A N/A N/A rdf_protodict DataBlob integer 100 N/A EnumerateInterfaces N/A N/A self _ N/A N/A N/A N/A self response_count 1 N/A N/A N/A N/A rdf_client Interface mac_address 123456 addresses N/A N/A N/A rdf_client NetworkAddress address_type N/A N/A N/A rdf_client NetworkAddress Family INET human_readable 100.100.100.1 packed_bytes N/A N/A socket inet_pton N/A socket AF_INET 100.100.100.1 N/A EnumerateFilesystems N/A N/A self _ N/A N/A N/A N/A self response_count 1 N/A N/A N/A N/A rdf_client Filesystem device /dev/sda mount_point /mnt/data N/A GetClientInfo N/A N/A self _ N/A N/A N/A N/A self response_count 1 N/A N/A N/A N/A rdf_client ClientInformation client_name N/A N/A config_lib CONFIG N/A Client.name client_version N/A int N/A N/A config_lib CONFIG N/A Client.version_numeric build_time N/A N/A config_lib CONFIG N/A Client.build_time labels N/A GRRLabel1 Label2 N/A GetUserInfo N/A N/A self user N/A N/A N/A N/A self response_count 1 N/A N/A user homedir N/A /usr/local/home/%s N/A user username N/A N/A user full_name N/A N/A N/A user username capitalize N/A N/A user N/A GetConfiguration N/A N/A self _ N/A N/A N/A N/A self response_count 1 N/A N/A N/A N/A rdf_protodict Dict N/A Client.server_urls Client.poll_min N/A http://localhost:8001/ 1.0 N/A WmiQuery N/A N/A self query N/A N/A N/A N/A N/A query query SELECT * FROM Win32_LogicalDisk N/A N/A N/A self response_count 1 N/A N/A client_fixture WMI_SAMPLE N/A N/A N/A N/A N/A query query startswith Select * from Win32_NetworkAdapterConfiguration N/A N/A N/A self response_count 1 N/A rdf_dict N/A N/A rdf_protodict Dict N/A wmi_properties N/A N/A N/A N/A client_fixture WMIWin32NetworkAdapterConfigurationMock __dict__ iteritems N/A N/A key value wmi_properties N/A N/A N/A N/A N/A key startswith __ N/A N/A N/A N/A N/A rdf_dict N/A key value N/A N/A N/A TypeError N/A N/A N/A rdf_dict N/A key N/A Failed to encode: %s value N/A N/A rdf_dict N/A N/A None N/A N/A