supply override PCIDB_PATH env var in unit tests #376
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some of the unit tests inspect snapshot filesystems and for the GPU Info-collection, the
github.com/jaypipes/pcidb
library is used to get PCI information. That library no longer (as of version v0.9) does an automatic fetch of the canonical pci.ids file if it cannot find a pci.ids file in the local filesystem. It no longer does that network fetch because the upstream maintainer of the pci.ids database noticed too many fetches coming from projects that importedghw
which transitively importedpcidb
.Because of this change in behaviour of no longer doing an automatic network fetch of the pci.ids database, a unit test in
ghw
that was relying on the pcidb library was no longer working. This patch fixes two things related to the PCI handling in thepkg/gpu
package. First, it cleans up the parsing of the/sys/class/drm
symlink contents by looking through the path parts and attempting a regex match for a PCI address. Second, it adds an env-var override to the GPU unit tests to pointgithub.com/jaypipes/pcidb
to a specific pci.ids file that I've included in thetestdata/
directory.Closes Issue #375