Skip to content

Commit

Permalink
Fix logic in unit test for getting GPU device ID from file path.
Browse files Browse the repository at this point in the history
Without this, this test will behave differently on darwin vs linux, for example,
as the location for temporary directories are different.

Signed-off-by: Christopher Desiniotis <[email protected]>
  • Loading branch information
cdesiniotis committed Jun 9, 2023
1 parent 8f6a11b commit 462943f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/device_plugin/device_plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import (
"io/ioutil"
"os"
"path/filepath"
"strings"
"time"

. "github.com/onsi/ginkgo"
Expand Down Expand Up @@ -227,9 +226,8 @@ var _ = Describe("Device Plugin", func() {

It("Read gpu id corresponding to Vgpu with out error", func() {
driverID, err := readGpuIDForVgpu(workDir, "1/driver")
splitStr := strings.Split(linkDir, "/")
Expect(err).To(BeNil())
Expect(driverID).To(Equal(splitStr[2]))
Expect(driverID).To(Equal(filepath.Base(linkDir)))
})

It("Read gpu id from a missing location to throw error", func() {
Expand Down

0 comments on commit 462943f

Please sign in to comment.