How to use get_client_autodir_paths method in autotest

Best Python code snippet using autotest_python

autotest_remote.py

Source:autotest_remote.py Github

copy

Full Screen

...70 a temporary directory.71 """72 cls.install_in_tmpdir = flag73 @classmethod74 def get_client_autodir_paths(cls, host):75 return settings.get_value('AUTOSERV', 'client_autodir_paths', type=list)76 @classmethod77 def get_installed_autodir(cls, host):78 """79 Find where the Autotest client is installed on the host.80 :return: an absolute path to an installed Autotest client root.81 :raise AutodirNotFoundError if no Autotest installation can be found.82 """83 autodir = host.get_autodir()84 if autodir:85 logging.debug('Using existing host autodir: %s', autodir)86 return autodir87 if not _server_system_wide_install():88 for path in Autotest.get_client_autodir_paths(host):89 try:90 autotest_binary = os.path.join(path, CLIENT_BINARY)91 host.run('test -x %s' % utils.sh_escape(autotest_binary))92 host.run('test -w %s' % utils.sh_escape(path))93 logging.debug('Found existing autodir at %s', path)94 return path95 except error.AutoservRunError:96 logging.debug('%s does not exist on %s', autotest_binary,97 host.hostname)98 else:99 for path in Autotest.get_client_autodir_paths(host):100 host.run('test -w %s' % utils.sh_escape(path))101 logging.debug('Found existing autodir at %s', path)102 host.autodir = path103 return path104 raise AutodirNotFoundError105 @classmethod106 def get_install_dir(cls, host):107 """108 Determines the location where autotest should be installed on109 host. If self.install_in_tmpdir is set, it will return a unique110 temporary directory that autotest can be installed in. Otherwise, looks111 for an existing installation to use; if none is found, looks for a112 usable directory in the global config client_autodir_paths.113 """114 try:115 install_dir = cls.get_installed_autodir(host)116 except AutodirNotFoundError:117 install_dir = cls._find_installable_dir(host)118 if cls.install_in_tmpdir:119 return host.get_tmp_dir(parent=install_dir)120 return install_dir121 @classmethod122 def _find_installable_dir(cls, host):123 client_autodir_paths = cls.get_client_autodir_paths(host)124 for path in client_autodir_paths:125 try:126 host.run('mkdir -p %s' % utils.sh_escape(path))127 host.run('test -w %s' % utils.sh_escape(path))128 return path129 except error.AutoservRunError:130 logging.debug('Failed to create %s', path)131 raise error.AutoservInstallError(132 'Unable to find a place to install Autotest; tried %s' %133 ', '.join(client_autodir_paths))134 def _create_test_output_dir(self, host, autodir):135 tmpdir = os.path.join(autodir, 'tmp')136 state_autodir = settings.get_value('COMMON', 'test_output_dir',137 default=tmpdir)...

Full Screen

Full Screen

auto_remote.py

Source:auto_remote.py Github

copy

Full Screen

...31 #self.server_system_wide_install = _server_system_wide_install()32 super(BaseAutotest, self).__init__()33 install_in_tmpdir = False34 @classmethod35 def get_client_autodir_paths(cls, host):36 return settings.get_value('auto', 'client_autodir_paths', type=list)37 def install(self, host=None, autodir=None):38 self._install(host=host, autodir=autodir)39 def _install(self, host=None, autodir=None, use_auto=True, use_packaging=True):40 """41 Install Caliper.42 :param host: A host instance on which caliper will be installed43 :param autodir: Location on the remote host to install to44 :param use_auto: Enable install modes that depend on the client running with 'autoserv harness'45 :param use_packaging: Enable install modes that use the packaging system46 """47 if not host:48 host = self.host49 if not self.got:...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run autotest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful