mirror of
https://github.com/intel/intel-device-plugins-for-kubernetes.git
synced 2025-06-03 03:59:37 +00:00
bitstream: remove unused code
This commit is contained in:
parent
320725adee
commit
f5754f490e
@ -15,33 +15,9 @@
|
|||||||
package bitstream
|
package bitstream
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
|
||||||
"path"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
"k8s.io/utils/exec"
|
|
||||||
fakeexec "k8s.io/utils/exec/testing"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func createTestDirs(sysfs string, sysfsDirs []string, sysfsFiles map[string][]byte) error {
|
|
||||||
for _, sysfsdir := range sysfsDirs {
|
|
||||||
err := os.MkdirAll(path.Join(sysfs, sysfsdir), 0755)
|
|
||||||
if err != nil {
|
|
||||||
return errors.Wrap(err, "Failed to create fake device directory")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for filename, body := range sysfsFiles {
|
|
||||||
err := ioutil.WriteFile(path.Join(sysfs, filename), body, 0644)
|
|
||||||
if err != nil {
|
|
||||||
return errors.Wrap(err, "Failed to create fake vendor file")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestGetFPGABitstream(t *testing.T) {
|
func TestGetFPGABitstream(t *testing.T) {
|
||||||
var fpgaBitStreamDir = "testdata/intel.com/fpga"
|
var fpgaBitStreamDir = "testdata/intel.com/fpga"
|
||||||
|
|
||||||
@ -88,13 +64,3 @@ func TestGetFPGABitstream(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func genFakeActions(fcmd *fakeexec.FakeCmd, num int) []fakeexec.FakeCommandAction {
|
|
||||||
var actions []fakeexec.FakeCommandAction
|
|
||||||
for i := 0; i < num; i++ {
|
|
||||||
actions = append(actions, func(cmd string, args ...string) exec.Cmd {
|
|
||||||
return fakeexec.InitFakeCmd(fcmd, cmd, args...)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
return actions
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user