def __init__(self, config, options): self.options = options self.config = config self.logCollector = LogCollector(self.config['device_name'], self.config['logs']) self.forceStopped = False self.device = DeviceOperator(self.config['work_dir']) self.device.pushBinary(self.config['orangutan']) # generate scripts self.script_folder = self.config['script_repo'] if options.gen_scripts: if options.gen_scripts_output: self.script_folder = options.gen_scripts_output if not int(options.gen_scripts_amount ): #if has argv, type will become a string logger.info("Generate script for amount: %d" % self.config['script_amount']) else: logger.info("Generate script for amount: %d" % int(options.gen_scripts_amount)) self.script_folder += '/' + GenRandomSC().gen_random_sc() logger.info("Get scripts from script folder: %s" % self.script_folder) self.scripts = self.getScripts(self.script_folder) # Push binary and scripts onto device logger.info("Orangutan binary: %s" % self.config['orangutan']) logger.info("Orangutan work directory: %s" % self.config['work_dir'])