arm_systemready_ir_acs.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. from oeqa.runtime.case import OERuntimeTestCase
  2. class SystemReadyACSTest(OERuntimeTestCase):
  3. def setUp(self):
  4. self.console = self.td.get('ARM_SYSTEMREADY_ACS_CONSOLE')
  5. self.assertNotEqual(self.console, '',
  6. msg='ARM_SYSTEMREADY_ACS_CONSOLE is not set')
  7. def test_acs(self):
  8. """
  9. The purpose of this test case is to detect any issues with the ACS
  10. tests themselves. The intention is to fail only if there is an issue
  11. running the tests, not if an ACS test fails
  12. """
  13. self.target.transition('on')
  14. # The tests finish on a root shell
  15. test_patterns = [r'([a-zA-Z0-9_ ]+): \[([a-zA-Z_ ]+)\]',
  16. 'ACS run is completed'] # Signifies successful completion
  17. while True:
  18. match_id = self.target.expect(self.console, test_patterns,
  19. timeout=10*60*60)
  20. if match_id == 0:
  21. # A test group's result has been printed
  22. matches = self.target.match(self.console)
  23. group_name = matches[1].decode().strip()
  24. status = matches[2].decode().strip()
  25. self.logger.info(f'Test Group ({group_name}): {status}')
  26. elif match_id == 1:
  27. break
  28. # Workaround to ensure the model syncs the log files to disk
  29. self.target.sendline(self.console, r'sync /mnt')
  30. self.target.expect(self.console, r'root@generic-arm64:~#')
  31. self.logger.info('Linux tests complete')