-
Notifications
You must be signed in to change notification settings - Fork 255
Open
Description
Hi,
I got the issue with this code when run sriov test!
status, output = utils_misc.cmd_status_output(
"lspci |awk '/Ethernet/ {print $1}'", shell=True, session=session)
if status or not output:
raise exceptions.TestError("Unable to get Ethernet controllers. status: %s,"
"stdout: %s." % (status, output))
for pci in output.split():
_, output = utils_misc.cmd_status_output("lspci -v -s %s" % pci,
shell=True,
session=session)
if re.search("SR-IOV", output):
pf_driver = re.search('driver in use: (.*)', output)[1]
tmp_info = {'driver': pf_driver, 'pci_id': '0000:%s' % pci}
iface_name = get_iface_name('0000:%s' % pci, session=session)
This code work when command "lspci |awk '/Ethernet/ {print $1}'" return pcie bus with short format like 02:00.0 Ethernet ...
mean domain numbers are omitted since they are all equal to zero!
but, on my system return output with the domain numbers are highlighted.
eg:
lspci | grep Ethernet
0000:01:00.0 Ethernet controller: Mellanox Technologies MT27710 Family [ConnectX-4 Lx]
0000:01:00.1 Ethernet controller: Mellanox Technologies MT27710 Family [ConnectX-4 Lx]
I suggest using -D
in command lspci
and remove prefix 0000:
Thanks,
Metadata
Metadata
Assignees
Labels
No labels