Lines Matching +full:test +full:- +full:path
1 # Test class and utilities for functional tests
5 # Original Author (Avocado-based tests):
12 # later. See the COPYING file in the top-level directory.
16 from pathlib import Path
37 @params compressed: filename, Asset, or file-like object to uncompress
43 from the filename or Asset URL. @format must be non-None if @uncompressed
44 is a file-like object.
46 Returns the fully qualified path to the uncompressed file
53 (name, ext) = os.path.splitext(str(compressed))
54 uncompressed = self.scratch_file(os.path.basename(name))
61 @params archive: filename, Asset, or file-like object to extract
63 @params sub_dir: optional sub-directory to extract into
71 from the filename or Asset URL. @format must be non-None if @archive
72 is a file-like object.
74 If @member is non-None, returns the fully qualified path to @member
106 Construct a path for accessing a data file located
113 reference a file nested below. The path components
114 will be joined using the platform appropriate path
117 Returns: string representing a file path
120 return str(Path(Path(__file__).parent.parent, *args))
125 Construct a path for accessing a data file located
131 reference a file nested below. The path components
132 will be joined using the platform appropriate path
135 Returns: string representing a file path
138 return str(Path(BUILD_DIR, *args))
143 Construct a path for accessing/creating a scratch file
145 this test case. The directory and its contents will be
146 purged upon completion of the test.
151 reference a file nested below. The path components
152 will be joined using the platform appropriate path
155 Returns: string representing a file path
158 return str(Path(self.workdir, *args))
163 Construct a path for accessing/creating a log file
165 this test case. The directory and its log files will be
166 preserved upon completion of the test.
171 reference a file nested below. The path components
172 will be joined using the platform appropriate path
175 Returns: string representing a file path
178 return str(Path(self.outputdir, *args))
183 Return the full path to the plugin taking into account any host OS
188 return os.path.join('tests', 'tcg', 'plugins', f'{plugin_name}.{sfx}')
201 self.arch = self.qemu_bin.split('-')[-1]
206 self.workdir = os.path.join(self.outputdir, 'scratch')
210 self.log = logging.getLogger('qemu-test')
215 '%(asctime)s - %(levelname)s: %(message)s')
237 path = os.path.basename(sys.argv[0])[:-3]
241 Asset.precache_suites(path, cache)
247 argv=["__dummy__", path])
248 for (test, message) in res.result.errors + res.result.failures:
250 if hasattr(test, "log_filename"):
251 print('More information on ' + test.id() + ' could be found here:'
252 '\n %s' % test.log_filename, file=sys.stderr)
253 if hasattr(test, 'console_log_name'):
254 print(' %s' % test.console_log_name, file=sys.stderr)
265 self._ldpath.append(os.path.abspath(ldpath))
269 + ["-L %s" % ldpath for ldpath in self._ldpath]
300 [self.qemu_bin, '-M', 'help'],
308 Requires an accelerator to be available for the test to continue
312 If the check fails, the test is canceled. If the check itself
313 for the given accelerator is not available, the test is also
330 '-M', 'none', '-netdev', 'help'],
337 '-M', 'none', '-device', 'help'],
352 vm.add_args("-chardev",
353 f"socket,id=backdoor,path={sockpath},server=on,wait=off",
354 "-mon", "chardev=backdoor,mode=control")
370 self._vms[name].add_args('-cpu', self.cpu)
380 :param arg: the QEMU argument, such as "-cpu" in "-cpu host"
382 :param value: the argument value, such as "host" in "-cpu host"