Skip to content

cpuhotplug.py fails on x86_64 due to incorrect access to cpu0/online (non-hotpluggable CPU) #3013

Description

@kumarmuthu
  • cpuhotplug.py fails on x86_64 architecture

Base Exception:
avocado.core.exceptions.TestCancel: Processor is not powerpc

  • This exception is expected and correctly raised because the system is not a PowerPC (ppc) architecture.

Additional Error:
[Errno 2] No such file or directory: '/sys/devices/system/cpu/cpu0/online'

On AMD (x86_64) systems, cpu0 is not hotpluggable and does not have an online file, unlike higher-numbered CPUs (cpu1, cpu2, etc.). Accessing cpu0/online therefore leads to a FileNotFoundError.

Suggestion:

  • There is already an architecture check in setUp():
if 'ppc' not in distro.detect().arch:
    self.cancel("Processor is not powerpc")
  • To prevent similar errors during cleanup, we recommend applying the same condition inside tearDown() as well:
Relevant section in tearDown
if 'ppc' not in distro.detect().arch:
    return

Execution Log:

Running avocado run: /root/avocado-misc-tests/cpu/cpuhotplug.py
/root/.local/share/pipx/venvs/avocado-framework/lib/python3.12/site-packages/avocado/core/__init__.py:18: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  import pkg_resources
JOB ID     : 973e308f67951dae13f409a019a37dd3f2b222d8
JOB LOG    : /root/avocado/job-results/job-2025-06-29T13.51-973e308/job.log
 (1/1) /root/avocado-misc-tests/cpu/cpuhotplug.py:cpuHotplug.test: STARTED
 (1/1) /root/avocado-misc-tests/cpu/cpuhotplug.py:cpuHotplug.test:  ERROR: [Errno 2] No such file or directory: '/sys/devices/system/cpu/cpu0/online' (0.06 s)
RESULTS    : PASS 0 | ERROR 1 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML   : /root/avocado/job-results/job-2025-06-29T13.51-973e308/results.html
JOB TIME   : 1.54 s

Test summary:
1-/root/avocado-misc-tests/cpu/cpuhotplug.py:cpuHotplug.test: ERROR

/root/avocado-misc-tests/cpu/cpuhotplug.py : RESULTS    : PASS 0 | ERROR 1 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions