def Run(self): output_plugins = [ rdf_output_plugin.OutputPluginDescriptor( plugin_name=test_plugins.DummyHuntTestOutputPlugin.__name__, plugin_args=test_plugins.DummyHuntTestOutputPlugin.args_type( filename_regex="blah!", fetch_binaries=True)) ] with test_lib.FakeTime(42): hunt_id = self.CreateHunt(description="the hunt", output_plugins=output_plugins) hunt.StartHunt(hunt_id) self.Check( "ListHuntOutputPlugins", args=hunt_plugin.ApiListHuntOutputPluginsArgs(hunt_id=hunt_id), replace={hunt_id: "H:123456"})
def Run(self): with test_lib.FakeTime(42): with self.CreateHunt(description="the hunt", output_plugins=[ output_plugin.OutputPluginDescriptor( plugin_name=test_plugins. DummyHuntTestOutputPlugin.__name__, plugin_args=test_plugins. DummyHuntTestOutputPlugin.args_type( filename_regex="blah!", fetch_binaries=True)) ]) as hunt_obj: pass self.Check("ListHuntOutputPlugins", args=hunt_plugin.ApiListHuntOutputPluginsArgs( hunt_id=hunt_obj.urn.Basename()), replace={hunt_obj.urn.Basename(): "H:123456"})
def Run(self): output_plugins = [ rdf_output_plugin.OutputPluginDescriptor( plugin_name=test_plugins.DummyHuntTestOutputPlugin.__name__, plugin_args=test_plugins.DummyHuntTestOutputPlugin.args_type( filename_regex="blah!", fetch_binaries=True)) ] with test_lib.FakeTime(42): if data_store.RelationalDBReadEnabled("hunts"): hunt_id = self.CreateHunt(description="the hunt", output_plugins=output_plugins) hunt.StartHunt(hunt_id) else: with self.CreateHunt( description="the hunt", output_plugins=output_plugins) as hunt_obj: hunt_id = hunt_obj.urn.Basename() self.Check( "ListHuntOutputPlugins", args=hunt_plugin.ApiListHuntOutputPluginsArgs(hunt_id=hunt_id), replace={hunt_id: "H:123456"})