-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for sriov.DiscoverSriovDevices function
Signed-off-by: Yury Kulazhenkov <[email protected]>
- Loading branch information
1 parent
700ca02
commit 808907f
Showing
6 changed files
with
314 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package ghw | ||
|
||
import ( | ||
"github.com/jaypipes/ghw" | ||
) | ||
|
||
func New() GHWLib { | ||
return &libWrapper{} | ||
} | ||
|
||
//go:generate ../../../../../bin/mockgen -destination mock/mock_ghw.go -source ghw.go | ||
type GHWLib interface { | ||
// PCI returns a pointer to an Info that provide methods to access info about devices | ||
PCI() (Info, error) | ||
} | ||
|
||
// Info interface provide methods to access info about devices | ||
type Info interface { | ||
// ListDevices returns a list of pointers to Device structs present on the | ||
// host system | ||
ListDevices() []*ghw.PCIDevice | ||
} | ||
|
||
type libWrapper struct{} | ||
|
||
// PCI returns a pointer to an Info that provide methods to access info about devices | ||
func (w *libWrapper) PCI() (Info, error) { | ||
return ghw.PCI() | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.