def test_mode_module(name, interactive): print "[+] Enabling test mode." dispatcher = Dispatcher(interactive) module = dispatcher.get_processing_module(name) if not module: error("Could not find module '{}'".format(name)) return module
def _get_module(self, module_name): return dispatcher.get_processing_module(module_name)
'-t', '--test', action='store_true', help= 'Enable test mode. This mode does not require connection to the database. It is automatically enabled when a connection is not available or the module is disabled.' ) args = parser.parse_args() analysis = TestAnalysis(args.file, args.type) if args.test: module = test_mode_module(args.module, args.interactive) else: try: fame_init() module = dispatcher.get_processing_module(args.module) module.initialize() except: module = test_mode_module(args.module, args.interactive) ret = module.execute(analysis) print "\nResult: {}\n".format(ret) analysis.pprint() if module.results is not None: print "## Detailed results\n" print module.results