def __init__(self, host = None): self.host = host self.got = False self.installed = False self.lightweight = False self.serverdir = utils.get_server_dir() super(BaseAutotest, self).__init__()
def _install_boottool(self): if self._host() is None: raise error.AutoservError( "Host does not exist anymore") tmpdir = self._host().get_tmp_dir() self._host().send_file(os.path.abspath(os.path.join( utils.get_server_dir(), BOOTTOOL_SRC)), tmpdir) self._boottool_path= os.path.join(tmpdir, os.path.basename(BOOTTOOL_SRC))
def _get_conmux_attach(cls, conmux_attach=None): if conmux_attach: return conmux_attach # assume we're using the conmux-attach provided with autotest server_dir = server_utils.get_server_dir() path = os.path.join(server_dir, "..", "conmux", "conmux-attach") path = os.path.abspath(path) return path
def _initialize(self, target_file_owner=None, *args, **dargs): super(Host, self)._initialize(*args, **dargs) self.serverdir = utils.get_server_dir() self.monitordir = os.path.join(os.path.dirname(__file__), "monitors") self.bootloader = bootloader.Bootloader(self) self.env = {} self.target_file_owner = target_file_owner
def _initialize(self, target_file_owner=None, *args, **dargs): self.serverdir = utils.get_server_dir() self.monitordir = os.path.join(os.path.dirname(__file__), "monitors") self.bootloader = bootloader.Bootloader(self) self.env = {} self.target_file_owner = target_file_owner self._already_repaired = [] self._removed_files = False
def generate_minidump_stacktrace(minidump_path): """ Generates a stacktrace for the specified minidump. This function expects the debug symbols to reside under: /build/<board>/usr/lib/debug @param minidump_path: absolute path to minidump to by symbolicated. @raise client_utils.error.CmdError if minidump_stackwalk return code != 0. """ symbol_dir = '%s/../../../lib/debug' % utils.get_server_dir() logging.info('symbol_dir: %s', symbol_dir) client_utils.run('minidump_stackwalk "%s" "%s" > "%s.txt"' % (minidump_path, symbol_dir, minidump_path))
def __init__(self, host=None): self.host = host self.got = False self.installed = False self.serverdir = utils.get_server_dir() super(BaseAutotest, self).__init__()
def main(): # get options and args options, args = parse_args() server_dir = server_utils.get_server_dir() autotest_dir = os.path.abspath(os.path.join(server_dir, '..')) # extract the pkg locations from global config repo_urls = c.get_config_value('PACKAGES', 'fetch_location', type=list, default=[]) upload_paths = c.get_config_value('PACKAGES', 'upload_location', type=list, default=[]) if options.repo: upload_paths.append(options.repo) # Having no upload paths basically means you're not using packaging. if not upload_paths: print( "No upload locations found. Please set upload_location under" " PACKAGES in the global_config.ini or provide a location using" " the --repository option.") return client_dir = os.path.join(autotest_dir, "client") # Bail out if the client directory does not exist if not os.path.exists(client_dir): sys.exit(0) dep_dir = os.path.join(client_dir, "deps") prof_dir = os.path.join(client_dir, "profilers") # Due to the delayed uprev-ing of certain ebuilds, we need to support # both the legacy command line and the new one. # So, if the new "action" option isn't specified, try looking for the # old style remove/upload argument if options.action is None: if len(args) == 0 or args[0] not in ['upload', 'remove']: print( "Either 'upload' or 'remove' needs to be specified " "for the package") sys.exit(0) cur_action = args[0] else: cur_action = options.action if cur_action == ACTION_TAR_ONLY and options.output_dir is None: print("An output dir has to be specified") sys.exit(0) pkgmgr = packages.PackageManager(autotest_dir, repo_urls=repo_urls, upload_paths=upload_paths, run_function_dargs={'timeout': 600}) if options.all: process_all_packages(pkgmgr, client_dir, action=cur_action) if options.client: process_packages(pkgmgr, 'client', 'autotest', client_dir, action=cur_action) if options.dep: process_packages(pkgmgr, 'dep', options.dep, dep_dir, action=cur_action, dest_dir=options.output_dir) if options.test: process_packages(pkgmgr, 'test', options.test, client_dir, action=cur_action, dest_dir=options.output_dir) if options.prof: process_packages(pkgmgr, 'profiler', options.prof, prof_dir, action=cur_action, dest_dir=options.output_dir) if options.file: if cur_action == ACTION_REMOVE: pkgmgr.remove_pkg(options.file, remove_checksum=True) elif cur_action == ACTION_UPLOAD: pkgmgr.upload_pkg(options.file, update_checksum=True)
def main(): # get options and args options, args = parse_args() server_dir = server_utils.get_server_dir() autotest_dir = os.path.abspath(os.path.join(server_dir, "..")) # extract the pkg locations from global config repo_urls = c.get_config_value("PACKAGES", "fetch_location", type=list, default=[]) upload_paths = c.get_config_value("PACKAGES", "upload_location", type=list, default=[]) # Having no upload paths basically means you're not using packaging. if len(upload_paths) == 0: return pkgmgr = packages.PackageManager( autotest_dir, repo_urls=repo_urls, upload_paths=upload_paths, run_function_dargs={"timeout": 600} ) client_dir = os.path.join(autotest_dir, "client") # Bail out if the client directory does not exist if not os.path.exists(client_dir): sys.exit(0) dep_dir = os.path.join(client_dir, "deps") prof_dir = os.path.join(client_dir, "profilers") if len(args) == 0 or args[0] not in ["upload", "remove"]: print ("Either 'upload' or 'remove' needs to be specified " "for the package") sys.exit(0) if args[0] == "upload": remove_flag = False elif args[0] == "remove": remove_flag = True else: # we should not be getting here assert False if options.all: if options.repo: upload_path_list = [options.repo] else: upload_path_list = upload_paths process_all_packages(pkgmgr, client_dir, upload_path_list, remove=remove_flag) if options.client: process_packages(pkgmgr, "client", "autotest", client_dir, options.repo, remove=remove_flag) if options.dep: process_packages(pkgmgr, "dep", options.dep, dep_dir, options.repo, remove=remove_flag) if options.test: process_packages(pkgmgr, "test", options.test, client_dir, options.repo, remove=remove_flag) if options.prof: process_packages(pkgmgr, "profiler", options.prof, prof_dir, options.repo, remove=remove_flag) if options.file: if remove_flag: pkgmgr.remove_pkg(options.file, options.repo, remove_checksum=True) else: pkgmgr.upload_pkg(options.file, options.repo, update_checksum=True)
def _initialize(self, *args, **dargs): super(Host, self)._initialize(*args, **dargs) self.serverdir = utils.get_server_dir() self.env = {}
def main(): # get options and args options, args = parse_args() server_dir = server_utils.get_server_dir() autotest_dir = os.path.abspath(os.path.join(server_dir, '..')) # extract the pkg locations from global config repo_urls = c.get_config_value('PACKAGES', 'fetch_location', type=list, default=[]) upload_paths = c.get_config_value('PACKAGES', 'upload_location', type=list, default=[]) if options.repo: upload_paths.append(options.repo) # Having no upload paths basically means you're not using packaging. if not upload_paths: print( "No upload locations found. Please set upload_location under" " PACKAGES in the global_config.ini or provide a location using" " the --repository option.") return client_dir = os.path.join(autotest_dir, "client") # Bail out if the client directory does not exist if not os.path.exists(client_dir): sys.exit(0) dep_dir = os.path.join(client_dir, "deps") prof_dir = os.path.join(client_dir, "profilers") if len(args) == 0 or args[0] not in ['upload', 'remove']: print( "Either 'upload' or 'remove' needs to be specified " "for the package") sys.exit(0) if args[0] == 'upload': remove_flag = False elif args[0] == 'remove': remove_flag = True else: # we should not be getting here assert (False) pkgmgr = packages.PackageManager(autotest_dir, repo_urls=repo_urls, upload_paths=upload_paths, run_function_dargs={'timeout': 600}) if options.all: process_all_packages(pkgmgr, client_dir, remove=remove_flag) if options.client: process_packages(pkgmgr, 'client', 'autotest', client_dir, remove=remove_flag) if options.dep: process_packages(pkgmgr, 'dep', options.dep, dep_dir, remove=remove_flag) if options.test: process_packages(pkgmgr, 'test', options.test, client_dir, remove=remove_flag) if options.prof: process_packages(pkgmgr, 'profiler', options.prof, prof_dir, remove=remove_flag) if options.file: if remove_flag: pkgmgr.remove_pkg(options.file, remove_checksum=True) else: pkgmgr.upload_pkg(options.file, update_checksum=True)
def main(): # get options and args options, args = parse_args() server_dir = server_utils.get_server_dir() autotest_dir = os.path.abspath(os.path.join(server_dir, '..')) # extract the pkg locations from global config repo_urls = c.get_config_value('PACKAGES', 'fetch_location', type=list, default=[]) upload_paths = c.get_config_value('PACKAGES', 'upload_location', type=list, default=[]) if options.repo: upload_paths.append(options.repo) # Having no upload paths basically means you're not using packaging. if not upload_paths: print("No upload locations found. Please set upload_location under" " PACKAGES in the global_config.ini or provide a location using" " the --repository option.") return client_dir = os.path.join(autotest_dir, "client") # Bail out if the client directory does not exist if not os.path.exists(client_dir): sys.exit(0) dep_dir = os.path.join(client_dir, "deps") prof_dir = os.path.join(client_dir, "profilers") if len(args) == 0 or args[0] not in ['upload', 'remove']: print("Either 'upload' or 'remove' needs to be specified " "for the package") sys.exit(0) if args[0] == 'upload': remove_flag = False elif args[0] == 'remove': remove_flag = True else: # we should not be getting here assert(False) pkgmgr = packages.PackageManager(autotest_dir, repo_urls=repo_urls, upload_paths=upload_paths, run_function_dargs={'timeout':600}) if options.all: process_all_packages(pkgmgr, client_dir, remove=remove_flag) if options.client: process_packages(pkgmgr, 'client', 'autotest', client_dir, remove=remove_flag) if options.dep: process_packages(pkgmgr, 'dep', options.dep, dep_dir, remove=remove_flag) if options.test: process_packages(pkgmgr, 'test', options.test, client_dir, remove=remove_flag) if options.prof: process_packages(pkgmgr, 'profiler', options.prof, prof_dir, remove=remove_flag) if options.file: if remove_flag: pkgmgr.remove_pkg(options.file, remove_checksum=True) else: pkgmgr.upload_pkg(options.file, update_checksum=True)