mirror of
https://github.com/k8snetworkplumbingwg/multus-cni.git
synced 2025-08-19 08:43:45 +00:00
adding unit test fixes
This commit is contained in:
parent
84a6ad5ccf
commit
07ab852520
@ -367,7 +367,7 @@ func updateRoutes(rObj cnitypes.Result) (cnitypes.Result, error) {
|
||||
|
||||
// fixInterfaces fixes bad result returned by CNI plugin
|
||||
// some plugins(for example calico) return empty Interfaces list but
|
||||
// in IPConfig sets Interface index to 0. In such case it should be nil
|
||||
// in IPConfig sets Interface index to 0. In such case it should be nil
|
||||
func fixInterfaces(rObj cnitypes.Result) (cnitypes.Result, error) {
|
||||
result, err := current.NewResultFromResult(rObj)
|
||||
if err != nil {
|
||||
|
@ -27,7 +27,7 @@ import (
|
||||
|
||||
"github.com/containernetworking/cni/pkg/skel"
|
||||
cnitypes "github.com/containernetworking/cni/pkg/types"
|
||||
"github.com/containernetworking/cni/pkg/types/020"
|
||||
types020 "github.com/containernetworking/cni/pkg/types/020"
|
||||
cniversion "github.com/containernetworking/cni/pkg/version"
|
||||
"github.com/containernetworking/plugins/pkg/ns"
|
||||
"github.com/containernetworking/plugins/pkg/testutils"
|
||||
@ -227,7 +227,7 @@ var _ = Describe("multus operations", func() {
|
||||
result, err := cmdAdd(args, fExec, nil)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(fExec.addIndex).To(Equal(len(fExec.plugins)))
|
||||
r := result.(*types020.Result)
|
||||
r, _ := result.GetAsVersion("0.2.0")
|
||||
// plugin 1 is the masterplugin
|
||||
Expect(reflect.DeepEqual(r, expectedResult1)).To(BeTrue())
|
||||
|
||||
@ -319,7 +319,7 @@ var _ = Describe("multus operations", func() {
|
||||
Expect(fExec.addIndex).To(Equal(len(fExec.plugins)))
|
||||
Expect(fKubeClient.PodCount).To(Equal(3))
|
||||
Expect(fKubeClient.NetCount).To(Equal(2))
|
||||
r := result.(*types020.Result)
|
||||
r, _ := result.GetAsVersion("0.2.0")
|
||||
// plugin 1 is the masterplugin
|
||||
Expect(reflect.DeepEqual(r, expectedResult1)).To(BeTrue())
|
||||
})
|
||||
@ -398,7 +398,7 @@ var _ = Describe("multus operations", func() {
|
||||
Expect(fExec.addIndex).To(Equal(len(fExec.plugins)))
|
||||
Expect(fKubeClient.PodCount).To(Equal(3))
|
||||
Expect(fKubeClient.NetCount).To(Equal(2))
|
||||
r := result.(*types020.Result)
|
||||
r, _ := result.GetAsVersion("0.2.0")
|
||||
// plugin 1 is the masterplugin
|
||||
Expect(reflect.DeepEqual(r, expectedResult1)).To(BeTrue())
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user