Project

General

Profile

Actions

Bug #14461

closed

pcieadm-priv tests fail in the face of duplicate /devices paths

Added by Robert Mustacchi 6 months ago. Updated 6 months ago.

Status:
Closed
Priority:
Normal
Category:
tests
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

While running the pcieadm-priv tests in a QEMU VM, I noticed that they were failing where as they don't elsewhere. In particular, I saw the following message:

pcieadm: device name matched two device nodes: pci1af4,1100 and pci1af4,1100
TEST FAILED: pcieadm-priv: failed to show-cfgspace with filter /pci@0,0/pci1af4,1100
pcieadm: device name matched two device nodes: pci1af4,1100 and pci1af4,1100
TEST FAILED: pcieadm-priv: failed to use save-cfgspace -d /pci@0,0/pci1af4,1100

If we look at the system in question, this is actually the case:

rm@nienor:~$ pfexec /usr/lib/pci/pcieadm show-devs -o bdf,driver,path
BDF     DRIVER         PATH
0/0/0   --             /pci@0,0/pci1af4,1100
0/1/0   isa0           /pci@0,0/isa@1
0/1/1   pci-ide0       /pci@0,0/pci-ide@1,1
0/1/2   uhci0          /pci@0,0/pci1af4,1100@1,2
0/1/3   --             /pci@0,0/pci1af4,1100
0/2/0   vioif0         /pci@0,0/pci1af4,1@2
0/3/0   vioblk0        /pci@0,0/pci1af4,2@3
0/4/0   vioblk1        /pci@0,0/pci1af4,2@4
0/5/0   --             /pci@0,0/pci1af4,5

So, what do we see here. The VM has a traditional PCI bus without PCI express present. This means everything on the bus has the same base path generally speaking and otherwise would have instances as appropriate. The simple solution to this is to reorder the tests a little bit. Later on in the test we grab a driver instance and then feed that into printing the path. The thing is the driver instance will be unique and that should also generate a unique path as well as we'll have appended a unit-address to the path.

Actions #1

Updated by Robert Mustacchi 6 months ago

I tested this by running the pcieadm test suite in a VM that exhibited this. Everything passed on its own now:

rm@nienor:~$ pfexec /opt/util-tests/tests/pcieadm-priv 
successfully listed devices
TEST PASSED: show-devs 0/0/0
BDF     TYPE           DRIVER         DEVICE
0/0/0   PCI            --             440FX - 82441FX PMC [Natoma]
pcieadm: filter '9000/9000/9000' did not match any devices
TEST PASSED: show-devs 0/0/0 9000/9000/9000
TEST PASSED: show-cfgspace -d 0/0/0
TEST PASSED: save-cfgspace -d 0/0/0
TEST PASSED: show-devs isa0
BDF     TYPE           DRIVER         DEVICE
0/1/0   PCI            isa0           82371SB PIIX3 ISA [Natoma/Triton II]
pcieadm: filter '9000/9000/9000' did not match any devices
TEST PASSED: show-devs isa0 9000/9000/9000
TEST PASSED: show-cfgspace -d isa0
TEST PASSED: save-cfgspace -d isa0
TEST PASSED: show-devs /pci@0,0/isa@1
BDF     TYPE           DRIVER         DEVICE
0/1/0   PCI            isa0           82371SB PIIX3 ISA [Natoma/Triton II]
pcieadm: filter '9000/9000/9000' did not match any devices
TEST PASSED: show-devs /pci@0,0/isa@1 9000/9000/9000
TEST PASSED: show-cfgspace -d /pci@0,0/isa@1
TEST PASSED: save-cfgspace -d /pci@0,0/isa@1
pcieadm: filter '/enoent' did not match any devices
TEST PASSED: show-devs /enoent
TEST PASSED: save-cfgspace -a
All tests passed successfully!
rm@nienor:~$ pfexec /opt/util-tests/tests/pcieadm
pfexec: unable to execute /opt/util-tests/tests/pcieadm: No such file or directory
rm@nienor:~$ set -o vi
rm@nienor:~$ /opt/util-tests/tests/pcieadm
pcieadm-priv  pcieadmtest   
rm@nienor:~$ /opt/util-tests/tests/pcieadm
pcieadm-priv  pcieadmtest   
rm@nienor:~$ /opt/util-tests/tests/pcieadmtest 
TEST PASSED: invalid arguments 
TEST PASSED: invalid arguments -d
TEST PASSED: invalid arguments foobar
TEST PASSED: invalid arguments save-cfgspace
TEST PASSED: invalid arguments save-cfgspace -a
TEST PASSED: invalid arguments save-cfgspace -d
TEST PASSED: invalid arguments save-cfgspace -d final
TEST PASSED: invalid arguments save-cfgspace -a -d fantasy
TEST PASSED: invalid arguments show-devs -h
TEST PASSED: invalid arguments show-devs -p
TEST PASSED: invalid arguments show-devs -s -o
TEST PASSED: invalid arguments show-cfgspace
TEST PASSED: invalid arguments show-cfgspace -d -H
TEST PASSED: invalid arguments show-cfgspace -d
TEST PASSED: invalid arguments show-cfgspace -f
TEST PASSED: invalid arguments show-cfgspace -h
TEST PASSED: invalid arguments show-cfgspace -L
TEST PASSED: invalid arguments show-cfgspace -L -n -f /opt/util-tests/tests/pci/igb.pci
TEST PASSED: invalid arguments show-cfgspace -L -p -f /opt/util-tests/tests/pci/igb.pci
TEST PASSED: invalid arguments show-cfgspace -p -f /opt/util-tests/tests/pci/igb.pci
TEST PASSED: invalid arguments show-cfgspace -o foo -f /opt/util-tests/tests/pci/igb.pci
TEST PASSED: invalid arguments show-cfgspace -L -o foo -f /opt/util-tests/tests/pci/igb.pci
TEST PASSED: show-cfgspace -f /dev/stdin header0.vendor header0.device
TEST PASSED: show-cfgspace -L -f /dev/stdin header0.vendor header0.device
TEST PASSED: show-cfgspace -n -f /dev/stdin header0.vendor header0.device
TEST PASSED: show-cfgspace -L -H -f /dev/stdin header0.vendor header0.device
TEST PASSED: show-cfgspace -f /dev/stdin ltr
TEST PASSED: show-cfgspace -p -o short,value -f /dev/stdin ltr
TEST PASSED: show-cfgspace -p -o short,value -f /dev/stdin header0.vendor header0.device
TEST PASSED: show-cfgspace -f /dev/stdin ht
TEST PASSED: show-cfgspace -f /dev/stdin ht.msi
TEST PASSED: show-cfgspace -f /dev/stdin ht.msi.command
TEST PASSED: show-cfgspace -p -o value,short -f /dev/stdin ht
TEST PASSED: show-cfgspace -p -o value,short -f /dev/stdin ht.msi
TEST PASSED: show-cfgspace -p -o value,short -f /dev/stdin ht.msi.command
TEST PASSED: show-cfgspace -f /dev/stdin pcie.linksts atelier
TEST PASSED: show-cfgspace -p -o short,value -f /dev/stdin pcie.linksts atelier
All tests passed successfully!
Actions #2

Updated by Electric Monk 6 months ago

  • Gerrit CR set to 1989
Actions #3

Updated by Electric Monk 6 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 92f11af9ee66cf1fac02dc46553e805de69f204c

commit  92f11af9ee66cf1fac02dc46553e805de69f204c
Author: Robert Mustacchi <rm@fingolfin.org>
Date:   2022-02-08T15:12:38.000Z

    14460 pcieadm show-devs should warn on unused filters
    14459 pcieadm show-cfgspace sometimes confuses hex and strings
    14461 pcieadm-priv tests fail in the face of duplicate /devices paths
    Reviewed by: Gordon Ross <Gordon.W.Ross@gmail.com>
    Reviewed by: Andy Fiddaman <andy@omnios.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF