mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-18 06:18:20 +00:00
Merge pull request #1921 from elezar/move-source-pci-testdata
Move testdata to root
This commit is contained in:
commit
b9d7fa045d
263 changed files with 2 additions and 9 deletions
source/pci
testdata/source/pci/rootfs-1/sys/bus/pci/devices
0000:00:04.0
ari_enabledbroken_parity_statusclassconfigconsistent_dma_mask_bitscurrent_link_speedcurrent_link_widthd3cold_alloweddevicedma_mask_bitsdriver_overrideenableirqlocal_cpulistlocal_cpusmax_link_speedmax_link_widthmodaliasmsi_busnuma_nodepoolspower_staterevisionsubsystem_devicesubsystem_vendorvendor
0000:00:11.1
ari_enabledbroken_parity_statusclassconfigconsistent_dma_mask_bitsd3cold_alloweddevicedma_mask_bitsdriver_overrideenableirqlocal_cpulistlocal_cpusmodaliasmsi_busnuma_nodepower_staterevisionsubsystem_devicesubsystem_vendorvendorwaiting_for_supplier
0000:00:11.5
ari_enabledbroken_parity_statusclassconfigconsistent_dma_mask_bitsd3cold_alloweddevicedma_mask_bitsdriver_overrideenableindexirqlabellocal_cpulistlocal_cpusmodaliasmsi_busnuma_nodepower_stateremapped_nvmerevisionsubsystem_devicesubsystem_vendorvendor
0000:00:14.2
ari_enabledbroken_parity_statusclassconfigconsistent_dma_mask_bitsd3cold_alloweddevicedma_mask_bitsdriver_overrideenableirqlocal_cpulistlocal_cpusmodaliasmsi_busnuma_nodepower_staterevisionsubsystem_devicesubsystem_vendorvendor
0000:00:16.0
|
@ -18,7 +18,6 @@ package pci
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
@ -27,13 +26,6 @@ import (
|
||||||
"sigs.k8s.io/node-feature-discovery/source"
|
"sigs.k8s.io/node-feature-discovery/source"
|
||||||
)
|
)
|
||||||
|
|
||||||
var packagePath string
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
_, thisFile, _, _ := runtime.Caller(0)
|
|
||||||
packagePath = filepath.Dir(thisFile)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestSingletonPciSource(t *testing.T) {
|
func TestSingletonPciSource(t *testing.T) {
|
||||||
assert.Equal(t, src.Name(), Name)
|
assert.Equal(t, src.Name(), Name)
|
||||||
|
|
||||||
|
@ -232,7 +224,8 @@ func TestPciSource(t *testing.T) {
|
||||||
// Run test cases
|
// Run test cases
|
||||||
for _, tc := range tests {
|
for _, tc := range tests {
|
||||||
t.Run(tc.name, func(t *testing.T) {
|
t.Run(tc.name, func(t *testing.T) {
|
||||||
hostpath.SysfsDir = hostpath.HostDir(filepath.Join(packagePath, "testdata", tc.rootfs, "sys"))
|
mockSysfsPath := filepath.Join("..", "..", "testdata", "source", "pci", tc.rootfs, "sys")
|
||||||
|
hostpath.SysfsDir = hostpath.HostDir(mockSysfsPath)
|
||||||
|
|
||||||
config := tc.config
|
config := tc.config
|
||||||
if config == nil {
|
if config == nil {
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue