mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-18 06:18:20 +00:00
Move testdata to root
Go mod automatically ignores the /testdata directory. This change ensures that the rootfs for source/pci tests are not included in the module definition. Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
cce709fb51
commit
56bbad8adb
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 (
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
@ -27,13 +26,6 @@ import (
|
|||
"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) {
|
||||
assert.Equal(t, src.Name(), Name)
|
||||
|
||||
|
@ -232,7 +224,8 @@ func TestPciSource(t *testing.T) {
|
|||
// Run test cases
|
||||
for _, tc := range tests {
|
||||
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
|
||||
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