Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion io/net/irqbalance.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import re
import os
from avocado import Test
from avocado import Test, skipIf
from avocado.utils import process, cpu, wait, dmesg, genio, pci
from avocado.utils.network.interfaces import NetworkInterface
from avocado.utils.network.hosts import LocalHost
Expand Down Expand Up @@ -564,6 +564,31 @@ def test_taskset(self):

dmesg.collect_errors_dmesg(errorlog)

@skipIf("ppc" not in os.uname()[4], "Skip, Powerpc specific tests")
@skipIf(lambda self: not pci.is_accelerator(), "Unsupported: PCI adapter is not an accelerator")
def test_accelerator(self):
'''
Check that vfio-msi interrupts appear in /proc/interrupts when a
container is running, and are absent when no container is present.
'''
# Verify a container is running
result = process.run("podman ps -q", shell=True, ignore_status=True)
running = result.stdout.decode().strip()
if not running:
self.fail("No running container found; vfio-msi interrupt check "
"requires an active container")

# Check /proc/interrupts for vfio-msi entries
interrupts = process.run(
"grep vfio-msi /proc/interrupts",
shell=True, ignore_status=True
).stdout.decode().strip()

if not interrupts:
self.fail("No vfio-msi interrupts found in /proc/interrupts")

self.log.info("vfio-msi interrupts found:\n%s", interrupts)

def tearDown(self):
"""
Sets back SMT to original value as was before the test.
Expand Down
Loading