@@ -19,18 +19,17 @@ import (
1919 "os"
2020 "testing"
2121
22- CDImocks "github.com/k8snetworkplumbingwg/sriov-network-device-plugin/pkg/cdi/mocks"
22+ . "github.com/onsi/ginkgo"
23+ . "github.com/onsi/ginkgo/extensions/table"
24+ . "github.com/onsi/gomega"
25+ "github.com/stretchr/testify/mock"
2326
27+ CDImocks "github.com/k8snetworkplumbingwg/sriov-network-device-plugin/pkg/cdi/mocks"
2428 "github.com/k8snetworkplumbingwg/sriov-network-device-plugin/pkg/factory"
2529 "github.com/k8snetworkplumbingwg/sriov-network-device-plugin/pkg/netdevice"
2630 "github.com/k8snetworkplumbingwg/sriov-network-device-plugin/pkg/types"
2731 "github.com/k8snetworkplumbingwg/sriov-network-device-plugin/pkg/types/mocks"
2832 "github.com/k8snetworkplumbingwg/sriov-network-device-plugin/pkg/utils"
29-
30- . "github.com/onsi/ginkgo"
31- . "github.com/onsi/ginkgo/extensions/table"
32- . "github.com/onsi/gomega"
33- "github.com/stretchr/testify/mock"
3433)
3534
3635func TestSriovdp (t * testing.T ) {
@@ -126,7 +125,7 @@ var _ = Describe("Resource manager", func() {
126125 Expect (err ).NotTo (HaveOccurred ())
127126 })
128127 It ("should load resources list" , func () {
129- Expect (len ( rm .configList )) .To (Equal (2 ))
128+ Expect (rm .configList ).To (HaveLen (2 ))
130129 })
131130 })
132131 Context ("when the multi-selector config reading is successful" , func () {
@@ -235,7 +234,7 @@ var _ = Describe("Resource manager", func() {
235234 })
236235 It ("should return false" , func () {
237236 defer fs .Use ()()
238- Expect (rm .validConfigs ()).To (Equal ( false ))
237+ Expect (rm .validConfigs ()).To (BeFalse ( ))
239238 })
240239 })
241240 Context ("when resource name is duplicated" , func () {
@@ -269,7 +268,7 @@ var _ = Describe("Resource manager", func() {
269268 })
270269 It ("should return false" , func () {
271270 defer fs .Use ()()
272- Expect (rm .validConfigs ()).To (Equal ( false ))
271+ Expect (rm .validConfigs ()).To (BeFalse ( ))
273272 })
274273 })
275274 Context ("when both IsRdma and VdpaType are configured" , func () {
@@ -298,7 +297,7 @@ var _ = Describe("Resource manager", func() {
298297 })
299298 It ("should return false" , func () {
300299 defer fs .Use ()()
301- Expect (rm .validConfigs ()).To (Equal ( false ))
300+ Expect (rm .validConfigs ()).To (BeFalse ( ))
302301 })
303302 })
304303 Context ("when isRdma and vdpaType are configured in separate selectors" , func () {
@@ -331,7 +330,7 @@ var _ = Describe("Resource manager", func() {
331330 })
332331 It ("should return true" , func () {
333332 defer fs .Use ()()
334- Expect (rm .validConfigs ()).To (Equal ( true ))
333+ Expect (rm .validConfigs ()).To (BeTrue ( ))
335334 })
336335 })
337336 Context ("when isRdma and vdpaType are configured in a second selector" , func () {
@@ -365,7 +364,7 @@ var _ = Describe("Resource manager", func() {
365364 })
366365 It ("should return false" , func () {
367366 defer fs .Use ()()
368- Expect (rm .validConfigs ()).To (Equal ( false ))
367+ Expect (rm .validConfigs ()).To (BeFalse ( ))
369368 })
370369 })
371370 Describe ("managing resources servers" , func () {
@@ -386,7 +385,7 @@ var _ = Describe("Resource manager", func() {
386385 Expect (rm .initServers ()).NotTo (HaveOccurred ())
387386 })
388387 It ("should finish with empty list of servers" , func () {
389- Expect (len ( rm .resourceServers )) .To (Equal ( 0 ))
388+ Expect (rm .resourceServers ).To (BeEmpty ( ))
390389 })
391390 })
392391 Context ("when server is properly initialized" , func () {
0 commit comments