Lines Matching +full:test +full:- +full:path

23 # pylint: disable=invalid-name
24 # pylint: disable=consider-using-f-string
29 This test uses a fork of the upstream bits and has numerous fixes
31 https://gitlab.com/qemu-project/biosbits-bits .
49 # default timeout of 120 secs is sometimes not enough for bits test.
52 class QEMUBitsMachine(QEMUMachine): # pylint: disable=too-few-public-methods
54 A QEMU VM, with isa-debugcon enabled and bits iso passed
55 using -cdrom to QEMU commandline.
64 debugcon_log: str = "debugcon-log.txt",
67 # pylint: disable=too-many-arguments
70 name = "qemu-bits-%d" % os.getpid()
79 def _base_args(self) -> List[str]:
82 '-chardev',
83 'file,path=%s,id=debugcon' %os.path.join(self.base_temp_dir,
85 '-device',
86 'isa-debugcon,iobase=%s,chardev=debugcon' %self.debugcon_addr,
96 class AcpiBitsTest(QemuSystemTest): #pylint: disable=too-many-instance-attributes
100 # in slower systems the test can take as long as 3 minutes to complete.
109 BITS_TAG = "qemu-bits-10262023"
111 ASSET_BITS = Asset(("https://gitlab.com/qemu-project/"
112 "biosbits-bits/-/jobs/artifacts/%s/"
113 "download?job=qemu-bits-build" % BITS_TAG),
121 self._debugcon_log = 'debugcon-log.txt'
132 bits_config_file = self.data_file('acpi-bits',
133 'bits-config',
134 'bits-cfg.txt')
135 target_config_dir = self.scratch_file('bits-%d' %
138 self.assertTrue(os.path.exists(bits_config_file))
139 self.assertTrue(os.path.exists(target_config_dir))
145 """copies the python test scripts into bits. """
147 bits_test_dir = self.data_file('acpi-bits', 'bits-tests')
148 target_test_dir = self.scratch_file('bits-%d' % self.BITS_INTERNAL_VER,
151 self.assertTrue(os.path.exists(bits_test_dir))
152 self.assertTrue(os.path.exists(target_test_dir))
155 if os.path.isfile(os.path.join(bits_test_dir, filename)) and \
157 # All test scripts are named with extension .py2 so that
160 # These scripts are intended to run inside the test VM
163 newfilename = os.path.splitext(filename)[0] + '.py'
164 shutil.copy2(os.path.join(bits_test_dir, filename),
165 os.path.join(target_test_dir, newfilename))
166 self.logger.info('copied test file %s to %s',
169 # now remove the pyc test file if it exists, otherwise the
170 # changes in the python test script won't be executed.
171 testfile_pyc = os.path.splitext(filename)[0] + '.pyc'
172 if os.access(os.path.join(target_test_dir, testfile_pyc),
174 os.remove(os.path.join(target_test_dir, testfile_pyc))
176 os.path.join(target_test_dir,
180 """ grub-mkrescue is a bash script with two variables, 'prefix' and
183 the directory where we have extracted our pre-built bits grub
186 grub_x86_64_mods = self.scratch_file('grub-inst-x86_64-efi')
187 grub_i386_mods = self.scratch_file('grub-inst')
189 self.assertTrue(os.path.exists(grub_x86_64_mods))
190 self.assertTrue(os.path.exists(grub_i386_mods))
193 with open(mkrescue, 'r', encoding='utf-8') as filehandle:
201 with open(mkrescue, 'w', encoding='utf-8') as filehandle:
205 """ Uses grub-mkrescue to generate a fresh bits iso with the python
206 test scripts
208 bits_dir = self.scratch_file('bits-%d' % self.BITS_INTERNAL_VER)
209 iso_file = self.scratch_file('bits-%d.iso' % self.BITS_INTERNAL_VER)
210 mkrescue_script = self.scratch_file('grub-inst-x86_64-efi',
212 'grub-mkrescue')
219 self.logger.info('using grub-mkrescue for generating biosbits iso ...')
223 proc = subprocess.run([mkrescue_script, '-o', iso_file,
228 self.logger.info("grub-mkrescue output %s" % proc.stdout)
230 subprocess.check_call([mkrescue_script, '-o',
234 except Exception as e: # pylint: disable=broad-except
243 def setUp(self): # pylint: disable=arguments-differ
248 if not os.path.isdir(prebuiltDir):
252 'bits-%d-%s.zip'
256 'bits-%d-%s-grub.tar.gz'
277 with open(debugconf, 'r', encoding='utf-8') as filehandle:
283 # verify that no test cases failed.
287 'Please check the test logs for more info.')
304 """The main test case implementation."""
307 iso_file = self.scratch_file('bits-%d.iso' % self.BITS_INTERNAL_VER)
316 self._vm.add_args('-cdrom', '%s' %iso_file)
320 self._vm.add_args('-icount', 'auto')
321 # currently there is no support in bits for recognizing 64-bit SMBIOS
322 # entry points. QEMU defaults to 64-bit entry points since the
324 # for newer machine models"). Therefore, enforce 32-bit entry point.
325 self._vm.add_args('-machine', 'smbios-entry-point-type=32')
332 # biosbits has been configured to run all the specified test suites