avocado
avocado copied to clipboard
avocado-vt tests fail for AMD hosts
Describe the bug Running avocado-vt tests on an Oracle Linux AMD host fails with the error:
JOB ID : 2d2563d6a1eee8a19d00bdf9297e3ba1a12f5c31
JOB LOG : /root/avocado/job-results/job-2024-09-19T10.25-2d2563d/job.log
(1/1) io-github-autotest-qemu.unattended_install.cdrom.extra_cdrom_ks.default_install.aio_native: STARTED
(1/1) io-github-autotest-qemu.unattended_install.cdrom.extra_cdrom_ks.default_install.aio_native: ERROR: argument of type 'int' is not iterable (0.55 s)
RESULTS : PASS 0 | ERROR 1 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB TIME : 10.51 s
More from debug logs:
[stdlog] 2024-09-19 10:25:32,683 avocado.test test L0314 ERROR| Exception raised during postprocessing: argument of type 'int' is not iterable
[stderr] Traceback (most recent call last):
[stderr] File "/usr/lib/python3.9/site-packages/avocado_vt/plugins/vt_runner.py", line 74, in runTest
[stderr] raise self.__status # pylint: disable-msg=E0702
[stderr] File "/usr/lib/python3.9/site-packages/avocado_vt/test.py", line 146, in setUp
[stderr] self._runTest()
[stderr] File "/usr/lib/python3.9/site-packages/avocado_vt/test.py", line 268, in _runTest
[stderr] params = env_process.preprocess(self, params, env)
[stderr] File "/usr/lib/python3.9/site-packages/virttest/error_context.py", line 141, in new_fn
[stderr] return fn(*args, **kwargs)
[stderr] File "/usr/lib/python3.9/site-packages/virttest/env_process.py", line 1039, in preprocess
[stderr] if cpu_family is not None and "power" in cpu_family:
[stderr] TypeError: argument of type 'int' is not iterable
**Steps to reproduce**
Steps to reproduce the behavior with a reproducible whenever possible.
Expected behavior Tests execute without errors
Current behavior Error
System information (please complete the following information):
- OS: Oracle Linux Server release 9.4
- Avocado version: Avocado 107.0
- Avocado installation method: Built from release tag 107.0
Additional information
The issue was rooted down to get_family
in avocado/utils/cpu.py
returning integer type for AMD hosts:
def get_family():
"""Get family name of the cpu like Broadwell, Haswell, power8, power9."""
family = None
arch = get_arch()
if arch == "x86_64" or arch == "i386":
if get_vendor() == "amd":
cpu_info = _get_info()
pattern = r"cpu family\s*:"
for line in cpu_info:
line = line.decode("utf-8")
if re.search(pattern, line):
family = int(line.split(":")[1])
return family