How to use _included_platform method in autotest

Best Python code snippet using autotest_python

frontend.py

Source:frontend.py Github

copy

Full Screen

...397 elif False in results or "Abort" in results:398 return False399 else:400 return True401 def _included_platform(self, host, platforms):402 """403 See if host's platforms matches any of the patterns in the included404 platforms list.405 """406 if not platforms:407 return True # No filtering of platforms408 for platform in platforms:409 if re.search(platform, host.platform):410 return True411 return False412 def invoke_test(self, pairing, kernel, kernel_label, priority='Medium',413 kernel_cmdline=None, **dargs):414 """415 Given a pairing of a control file to a machine label, find all machines416 with that label, and submit that control file to them.417 :param kernel_label: Label (string) of the kernel to run such as418 '<kernel-version> : <config> : <date>'419 If any pairing object has its job_label attribute set it420 will override this value for that particular job.421 :return: A list of job objects.422 """423 # The pairing can override the job label.424 if pairing.job_label:425 kernel_label = pairing.job_label426 job_name = '%s : %s' % (pairing.machine_label, kernel_label)427 hosts = self.get_hosts(multiple_labels=[pairing.machine_label])428 platforms = pairing.platforms429 hosts = [h for h in hosts if self._included_platform(h, platforms)]430 dead_statuses = self.host_statuses(live=False)431 host_list = [h.hostname for h in hosts if h.status not in dead_statuses]432 print 'HOSTS: %s' % host_list433 if pairing.atomic_group_sched:434 dargs['synch_count'] = pairing.synch_count435 dargs['atomic_group_name'] = pairing.machine_label436 else:437 dargs['hosts'] = host_list438 new_job = self.create_job_by_test(name=job_name,439 dependencies=[pairing.machine_label],440 tests=[pairing.control_file],441 priority=priority,442 kernel=kernel,443 kernel_cmdline=kernel_cmdline,...

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