| 1 | // Copyright 2018 CNI authors |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | package mainscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/ |
| 16 | |
| 17 | import ( |
| 18 | "contextscip-go gomod github.com/golang/go/src go1.24.2 context/" |
| 19 | "encoding/jsonscip-go gomod github.com/golang/go/src go1.24.2 `encoding/json`/" |
| 20 | "fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/" |
| 21 | "netscip-go gomod github.com/golang/go/src go1.24.2 net/" |
| 22 | "osscip-go gomod github.com/golang/go/src go1.24.2 os/" |
| 23 | "timescip-go gomod github.com/golang/go/src go1.24.2 time/" |
| 24 | |
| 25 | . "github.com/onsi/ginkgo/v2scip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/" |
| 26 | . "github.com/onsi/gomegascip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/" |
| 27 | "github.com/onsi/gomega/gexecscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/gexec`/" |
| 28 | "github.com/vishvananda/netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/" |
| 29 | |
| 30 | "github.com/containernetworking/cni/pkg/invokescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/invoke`/" |
| 31 | "github.com/containernetworking/cni/pkg/skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/" |
| 32 | "github.com/containernetworking/cni/pkg/typesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/" |
| 33 | types100scip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/ "github.com/containernetworking/cni/pkg/types/100scip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/" |
| 34 | "github.com/containernetworking/plugins/pkg/netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/" |
| 35 | "github.com/containernetworking/plugins/pkg/nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/" |
| 36 | "github.com/containernetworking/plugins/pkg/testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/" |
| 37 | ) |
| 38 | |
| 39 | func buildOneConfigscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/buildOneConfig().(name, cniVersion string, orig *PluginConfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/PluginConf#, prevResult typesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/.Resultscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/Result#) ([]byte, error) { |
| 40 | var err error |
| 41 | |
| 42 | inject := map[string]interface{}{ |
| 43 | "name": name, |
| 44 | "cniVersion": cniVersion, |
| 45 | } |
| 46 | // Add previous plugin result |
| 47 | if prevResult != nil { |
| 48 | r, err := prevResult.GetAsVersionscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/Result#GetAsVersion().(cniVersion) |
| 49 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 50 | inject["prevResult"] = r |
| 51 | } |
| 52 | |
| 53 | // Ensure every config uses the same name and version |
| 54 | config := make(map[string]interface{}) |
| 55 | |
| 56 | confBytes, err := jsonscip-go gomod github.com/golang/go/src go1.24.2 `encoding/json`/.Marshalscip-go gomod github.com/golang/go/src go1.24.2 `encoding/json`/Marshal().(orig) |
| 57 | if err != nil { |
| 58 | return nil, err |
| 59 | } |
| 60 | |
| 61 | err = jsonscip-go gomod github.com/golang/go/src go1.24.2 `encoding/json`/.Unmarshalscip-go gomod github.com/golang/go/src go1.24.2 `encoding/json`/Unmarshal().(confBytes, &config) |
| 62 | if err != nil { |
| 63 | return nil, fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Errorf().("unmarshal existing network bytes: %s", err) |
| 64 | } |
| 65 | |
| 66 | for key, value := range inject { |
| 67 | config[key] = value |
| 68 | } |
| 69 | |
| 70 | newBytes, err := jsonscip-go gomod github.com/golang/go/src go1.24.2 `encoding/json`/.Marshalscip-go gomod github.com/golang/go/src go1.24.2 `encoding/json`/Marshal().(config) |
| 71 | if err != nil { |
| 72 | return nil, err |
| 73 | } |
| 74 | |
| 75 | conf := &PluginConfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/PluginConf#{} |
| 76 | if err := jsonscip-go gomod github.com/golang/go/src go1.24.2 `encoding/json`/.Unmarshalscip-go gomod github.com/golang/go/src go1.24.2 `encoding/json`/Unmarshal().(newBytes, &conf); err != nil { |
| 77 | return nil, fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Errorf().("error parsing configuration: %s", err) |
| 78 | } |
| 79 | |
| 80 | return newBytes, nil |
| 81 | } |
| 82 | |
| 83 | var _ = Describescip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/Describe().("bandwidth test", func() { |
| 84 | var ( |
| 85 | hostNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostNs. nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS# |
| 86 | containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs. nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS# |
| 87 | ifbDeviceNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:ifbDeviceName. string |
| 88 | hostIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIfname. string |
| 89 | containerIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIfname. string |
| 90 | hostIPscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIP. netscip-go gomod github.com/golang/go/src go1.24.2 net/.IPscip-go gomod github.com/golang/go/src go1.24.2 net/IP# |
| 91 | containerIPscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIP. netscip-go gomod github.com/golang/go/src go1.24.2 net/.IPscip-go gomod github.com/golang/go/src go1.24.2 net/IP# |
| 92 | hostIfaceMTUscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIfaceMTU. int |
| 93 | ) |
| 94 | |
| 95 | BeforeEachscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/BeforeEach().(func() { |
| 96 | var errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:err. error |
| 97 | |
| 98 | hostIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIfname. = "host-veth" |
| 99 | containerIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIfname. = "container-veth" |
| 100 | |
| 101 | hostNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostNs., errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:err. = testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.NewNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/NewNS().() |
| 102 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:err.).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 103 | |
| 104 | containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs., errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:err. = testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.NewNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/NewNS().() |
| 105 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:err.).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 106 | |
| 107 | hostIPscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIP. = netscip-go gomod github.com/golang/go/src go1.24.2 net/.IPscip-go gomod github.com/golang/go/src go1.24.2 net/IP#{169, 254, 0, 1} |
| 108 | containerIPscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIP. = netscip-go gomod github.com/golang/go/src go1.24.2 net/.IPscip-go gomod github.com/golang/go/src go1.24.2 net/IP#{10, 254, 0, 1} |
| 109 | hostIfaceMTUscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIfaceMTU. = 1024 |
| 110 | ifbDeviceNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:ifbDeviceName. = "bwpa8eda89404b7" |
| 111 | |
| 112 | createVethscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/createVeth().(hostNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostNs., hostIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIfname., containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs., containerIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIfname., hostIPscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIP., containerIPscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIP., hostIfaceMTUscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIfaceMTU.) |
| 113 | }) |
| 114 | |
| 115 | AfterEachscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/AfterEach().(func() { |
| 116 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Closescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Close.()).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 117 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.UnmountNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/UnmountNS().(containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs.)).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 118 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(hostNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostNs..Closescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Close.()).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 119 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.UnmountNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/UnmountNS().(hostNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostNs.)).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 120 | }) |
| 121 | |
| 122 | // Bandwidth requires host-side interface info, and thus only |
| 123 | // supports 0.3.0 and later CNI versions |
| 124 | for _, ver := range []string{"0.3.0", "0.3.1", "0.4.0", "1.0.0"} { |
| 125 | // Redefine ver inside for scope so real value is picked up by each dynamically defined It() |
| 126 | // See Gingkgo's "Patterns for dynamically generating tests" documentation. |
| 127 | ver := ver |
| 128 | |
| 129 | Describescip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/Describe().("cmdADD", func() { |
| 130 | Itscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/It().(fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().("[%s] works with a Veth pair", ver), func() { |
| 131 | conf := fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().(`{ |
| 132 | "cniVersion": "%s", |
| 133 | "name": "cni-plugin-bandwidth-test", |
| 134 | "type": "bandwidth", |
| 135 | "ingressRate": 8, |
| 136 | "ingressBurst": 8, |
| 137 | "egressRate": 16, |
| 138 | "egressBurst": 8, |
| 139 | "prevResult": { |
| 140 | "interfaces": [ |
| 141 | { |
| 142 | "name": "%s", |
| 143 | "sandbox": "" |
| 144 | }, |
| 145 | { |
| 146 | "name": "%s", |
| 147 | "sandbox": "%s" |
| 148 | } |
| 149 | ], |
| 150 | "ips": [ |
| 151 | { |
| 152 | "version": "4", |
| 153 | "address": "%s/24", |
| 154 | "gateway": "10.0.0.1", |
| 155 | "interface": 1 |
| 156 | } |
| 157 | ], |
| 158 | "routes": [] |
| 159 | } |
| 160 | }`, ver, hostIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIfname., containerIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIfname., containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), containerIPscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIP..Stringscip-go gomod github.com/golang/go/src go1.24.2 net/IP#String().()) |
| 161 | |
| 162 | args := &skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/.CmdArgsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#{ |
| 163 | ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID.: "dummy", |
| 164 | Netnsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#Netns.: containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 165 | IfNamescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#IfName.: containerIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIfname., |
| 166 | StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData.: []byte(conf), |
| 167 | } |
| 168 | |
| 169 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(hostNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostNs..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(_ nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 170 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 171 | r, out, err := testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdAdd().(containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), args.ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID., "", []byte(conf), func() error { return cmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/cmdAdd().(args) }) |
| 172 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().(), string(out)) |
| 173 | result, err := types100scip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/.GetResultscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/GetResult().(r) |
| 174 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 175 | |
| 176 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(result.Interfacesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Result#Interfaces.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveLenscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveLen().(3)) |
| 177 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(result.Interfacesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Result#Interfaces.[2].Namescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Interface#Name.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(ifbDeviceNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:ifbDeviceName.)) |
| 178 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(result.Interfacesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Result#Interfaces.[2].Sandboxscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Interface#Sandbox.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().("")) |
| 179 | |
| 180 | ifbLink, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(ifbDeviceNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:ifbDeviceName.) |
| 181 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 182 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(ifbLink.Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link#Attrs().().MTUscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAttrs#MTU.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(hostIfaceMTUscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIfaceMTU.)) |
| 183 | |
| 184 | qdiscs, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.QdiscListscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/QdiscList().(ifbLink) |
| 185 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 186 | |
| 187 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveLenscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveLen().(1)) |
| 188 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0].Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Qdisc#Attrs().().LinkIndexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/QdiscAttrs#LinkIndex.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(ifbLink.Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link#Attrs().().Indexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAttrs#Index.)) |
| 189 | |
| 190 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0]).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(BeAssignableToTypeOfscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeAssignableToTypeOf().(&netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Tbfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#{})) |
| 191 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0].(*netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Tbfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#).Ratescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#Rate.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(uint64(2))) |
| 192 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0].(*netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Tbfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#).Limitscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#Limit.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(uint32(1))) |
| 193 | |
| 194 | hostVethLink, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(hostIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIfname.) |
| 195 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 196 | |
| 197 | qdiscFilters, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.FilterListscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/FilterList().(hostVethLink, netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.MakeHandlescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/MakeHandle().(0xffff, 0)) |
| 198 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 199 | |
| 200 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscFilters).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveLenscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveLen().(1)) |
| 201 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscFilters[0].(*netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.U32scip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/U32#).Actionsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/U32#Actions.[0].(*netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.MirredActionscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/MirredAction#).Ifindexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/MirredAction#Ifindex.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(ifbLink.Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link#Attrs().().Indexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAttrs#Index.)) |
| 202 | |
| 203 | return nil |
| 204 | })).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 205 | |
| 206 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(hostNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostNs..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(_ nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 207 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 208 | |
| 209 | ifbLink, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(hostIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIfname.) |
| 210 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 211 | |
| 212 | qdiscs, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.QdiscListscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/QdiscList().(ifbLink) |
| 213 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 214 | |
| 215 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveLenscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveLen().(2)) |
| 216 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0].Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Qdisc#Attrs().().LinkIndexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/QdiscAttrs#LinkIndex.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(ifbLink.Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link#Attrs().().Indexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAttrs#Index.)) |
| 217 | |
| 218 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0]).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(BeAssignableToTypeOfscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeAssignableToTypeOf().(&netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Tbfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#{})) |
| 219 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0].(*netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Tbfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#).Ratescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#Rate.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(uint64(1))) |
| 220 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0].(*netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Tbfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#).Limitscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#Limit.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(uint32(1))) |
| 221 | return nil |
| 222 | })).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 223 | }) |
| 224 | |
| 225 | Itscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/It().(fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().("[%s] does not apply ingress when disabled", ver), func() { |
| 226 | conf := fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().(`{ |
| 227 | "cniVersion": "%s", |
| 228 | "name": "cni-plugin-bandwidth-test", |
| 229 | "type": "bandwidth", |
| 230 | "ingressRate": 0, |
| 231 | "ingressBurst": 0, |
| 232 | "egressRate": 8000, |
| 233 | "egressBurst": 80, |
| 234 | "prevResult": { |
| 235 | "interfaces": [ |
| 236 | { |
| 237 | "name": "%s", |
| 238 | "sandbox": "" |
| 239 | }, |
| 240 | { |
| 241 | "name": "%s", |
| 242 | "sandbox": "%s" |
| 243 | } |
| 244 | ], |
| 245 | "ips": [ |
| 246 | { |
| 247 | "version": "4", |
| 248 | "address": "%s/24", |
| 249 | "gateway": "10.0.0.1", |
| 250 | "interface": 1 |
| 251 | } |
| 252 | ], |
| 253 | "routes": [] |
| 254 | } |
| 255 | }`, ver, hostIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIfname., containerIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIfname., containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), containerIPscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIP..Stringscip-go gomod github.com/golang/go/src go1.24.2 net/IP#String().()) |
| 256 | |
| 257 | args := &skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/.CmdArgsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#{ |
| 258 | ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID.: "dummy", |
| 259 | Netnsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#Netns.: containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 260 | IfNamescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#IfName.: containerIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIfname., |
| 261 | StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData.: []byte(conf), |
| 262 | } |
| 263 | |
| 264 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(hostNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostNs..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(_ nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 265 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 266 | |
| 267 | _, out, err := testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdAdd().(containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), args.ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID., ifbDeviceNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:ifbDeviceName., []byte(conf), func() error { return cmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/cmdAdd().(args) }) |
| 268 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().(), string(out)) |
| 269 | |
| 270 | _, err = netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(ifbDeviceNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:ifbDeviceName.) |
| 271 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 272 | return nil |
| 273 | })).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 274 | |
| 275 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(hostNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostNs..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(_ nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 276 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 277 | |
| 278 | containerIfLink, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(hostIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIfname.) |
| 279 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 280 | |
| 281 | qdiscs, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.QdiscListscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/QdiscList().(containerIfLink) |
| 282 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 283 | |
| 284 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveLenscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveLen().(2)) |
| 285 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0]).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(BeAssignableToTypeOfscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeAssignableToTypeOf().(&netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Tbfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#{})) |
| 286 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[1]).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(BeAssignableToTypeOfscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeAssignableToTypeOf().(&netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Tbfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#{})) |
| 287 | |
| 288 | return nil |
| 289 | })).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 290 | }) |
| 291 | |
| 292 | Itscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/It().(fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().("[%s] does not apply egress when disabled", ver), func() { |
| 293 | conf := fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().(`{ |
| 294 | "cniVersion": "%s", |
| 295 | "name": "cni-plugin-bandwidth-test", |
| 296 | "type": "bandwidth", |
| 297 | "egressRate": 0, |
| 298 | "egressBurst": 0, |
| 299 | "ingressRate": 8000, |
| 300 | "ingressBurst": 80, |
| 301 | "prevResult": { |
| 302 | "interfaces": [ |
| 303 | { |
| 304 | "name": "%s", |
| 305 | "sandbox": "" |
| 306 | }, |
| 307 | { |
| 308 | "name": "%s", |
| 309 | "sandbox": "%s" |
| 310 | } |
| 311 | ], |
| 312 | "ips": [ |
| 313 | { |
| 314 | "version": "4", |
| 315 | "address": "%s/24", |
| 316 | "gateway": "10.0.0.1", |
| 317 | "interface": 1 |
| 318 | } |
| 319 | ], |
| 320 | "routes": [] |
| 321 | } |
| 322 | }`, ver, hostIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIfname., containerIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIfname., containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), containerIPscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIP..Stringscip-go gomod github.com/golang/go/src go1.24.2 net/IP#String().()) |
| 323 | |
| 324 | args := &skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/.CmdArgsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#{ |
| 325 | ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID.: "dummy", |
| 326 | Netnsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#Netns.: containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 327 | IfNamescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#IfName.: containerIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIfname., |
| 328 | StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData.: []byte(conf), |
| 329 | } |
| 330 | |
| 331 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(hostNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostNs..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(_ nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 332 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 333 | |
| 334 | _, out, err := testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdAdd().(containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), args.ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID., ifbDeviceNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:ifbDeviceName., []byte(conf), func() error { return cmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/cmdAdd().(args) }) |
| 335 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().(), string(out)) |
| 336 | |
| 337 | _, err = netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(ifbDeviceNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:ifbDeviceName.) |
| 338 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 339 | return nil |
| 340 | })).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 341 | |
| 342 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(hostNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostNs..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(_ nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 343 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 344 | |
| 345 | containerIfLink, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(hostIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIfname.) |
| 346 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 347 | |
| 348 | qdiscs, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.QdiscListscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/QdiscList().(containerIfLink) |
| 349 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 350 | |
| 351 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveLenscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveLen().(1)) |
| 352 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0].Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Qdisc#Attrs().().LinkIndexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/QdiscAttrs#LinkIndex.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(containerIfLink.Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link#Attrs().().Indexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAttrs#Index.)) |
| 353 | |
| 354 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0]).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(BeAssignableToTypeOfscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeAssignableToTypeOf().(&netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Tbfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#{})) |
| 355 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0].(*netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Tbfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#).Ratescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#Rate.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(uint64(1000))) |
| 356 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0].(*netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Tbfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#).Limitscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#Limit.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(uint32(35))) |
| 357 | return nil |
| 358 | })).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 359 | }) |
| 360 | |
| 361 | Itscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/It().(fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().("[%s] fails an invalid ingress config", ver), func() { |
| 362 | conf := fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().(`{ |
| 363 | "cniVersion": "%s", |
| 364 | "name": "cni-plugin-bandwidth-test", |
| 365 | "type": "bandwidth", |
| 366 | "ingressRate": 0, |
| 367 | "ingressBurst": 123, |
| 368 | "egressRate": 123, |
| 369 | "egressBurst": 123, |
| 370 | "prevResult": { |
| 371 | "interfaces": [ |
| 372 | { |
| 373 | "name": "%s", |
| 374 | "sandbox": "" |
| 375 | }, |
| 376 | { |
| 377 | "name": "%s", |
| 378 | "sandbox": "%s" |
| 379 | } |
| 380 | ], |
| 381 | "ips": [ |
| 382 | { |
| 383 | "version": "4", |
| 384 | "address": "%s/24", |
| 385 | "gateway": "10.0.0.1", |
| 386 | "interface": 1 |
| 387 | } |
| 388 | ], |
| 389 | "routes": [] |
| 390 | } |
| 391 | }`, ver, hostIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIfname., containerIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIfname., containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), containerIPscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIP..Stringscip-go gomod github.com/golang/go/src go1.24.2 net/IP#String().()) |
| 392 | |
| 393 | args := &skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/.CmdArgsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#{ |
| 394 | ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID.: "dummy", |
| 395 | Netnsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#Netns.: containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 396 | IfNamescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#IfName.: "eth0", |
| 397 | StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData.: []byte(conf), |
| 398 | } |
| 399 | |
| 400 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(hostNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostNs..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(_ nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 401 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 402 | |
| 403 | _, _, err := testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdAdd().(containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), args.ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID., "", []byte(conf), func() error { return cmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/cmdAdd().(args) }) |
| 404 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(MatchErrorscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/MatchError().("if burst is set, rate must also be set")) |
| 405 | return nil |
| 406 | })).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 407 | }) |
| 408 | |
| 409 | Itscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/It().(fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().("[%s] works with a Veth pair using runtime config", ver), func() { |
| 410 | conf := fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().(`{ |
| 411 | "cniVersion": "%s", |
| 412 | "name": "cni-plugin-bandwidth-test", |
| 413 | "type": "bandwidth", |
| 414 | "runtimeConfig": { |
| 415 | "bandWidth": { |
| 416 | "ingressRate": 8, |
| 417 | "ingressBurst": 8, |
| 418 | "egressRate": 16, |
| 419 | "egressBurst": 9 |
| 420 | } |
| 421 | }, |
| 422 | "prevResult": { |
| 423 | "interfaces": [ |
| 424 | { |
| 425 | "name": "%s", |
| 426 | "sandbox": "" |
| 427 | }, |
| 428 | { |
| 429 | "name": "%s", |
| 430 | "sandbox": "%s" |
| 431 | } |
| 432 | ], |
| 433 | "ips": [ |
| 434 | { |
| 435 | "version": "4", |
| 436 | "address": "%s/24", |
| 437 | "gateway": "10.0.0.1", |
| 438 | "interface": 1 |
| 439 | } |
| 440 | ], |
| 441 | "routes": [] |
| 442 | } |
| 443 | }`, ver, hostIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIfname., containerIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIfname., containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), containerIPscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIP..Stringscip-go gomod github.com/golang/go/src go1.24.2 net/IP#String().()) |
| 444 | |
| 445 | args := &skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/.CmdArgsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#{ |
| 446 | ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID.: "dummy", |
| 447 | Netnsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#Netns.: containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 448 | IfNamescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#IfName.: containerIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIfname., |
| 449 | StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData.: []byte(conf), |
| 450 | } |
| 451 | |
| 452 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(hostNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostNs..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(_ nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 453 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 454 | r, out, err := testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdAdd().(containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), args.ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID., "", []byte(conf), func() error { return cmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/cmdAdd().(args) }) |
| 455 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().(), string(out)) |
| 456 | result, err := types100scip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/.GetResultscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/GetResult().(r) |
| 457 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 458 | |
| 459 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(result.Interfacesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Result#Interfaces.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveLenscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveLen().(3)) |
| 460 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(result.Interfacesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Result#Interfaces.[2].Namescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Interface#Name.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(ifbDeviceNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:ifbDeviceName.)) |
| 461 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(result.Interfacesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Result#Interfaces.[2].Sandboxscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Interface#Sandbox.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().("")) |
| 462 | |
| 463 | ifbLink, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(ifbDeviceNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:ifbDeviceName.) |
| 464 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 465 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(ifbLink.Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link#Attrs().().MTUscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAttrs#MTU.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(hostIfaceMTUscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIfaceMTU.)) |
| 466 | |
| 467 | qdiscs, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.QdiscListscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/QdiscList().(ifbLink) |
| 468 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 469 | |
| 470 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveLenscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveLen().(1)) |
| 471 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0].Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Qdisc#Attrs().().LinkIndexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/QdiscAttrs#LinkIndex.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(ifbLink.Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link#Attrs().().Indexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAttrs#Index.)) |
| 472 | |
| 473 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0]).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(BeAssignableToTypeOfscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeAssignableToTypeOf().(&netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Tbfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#{})) |
| 474 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0].(*netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Tbfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#).Ratescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#Rate.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(uint64(2))) |
| 475 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0].(*netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Tbfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#).Limitscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#Limit.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(uint32(1))) |
| 476 | |
| 477 | hostVethLink, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(hostIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIfname.) |
| 478 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 479 | |
| 480 | qdiscFilters, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.FilterListscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/FilterList().(hostVethLink, netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.MakeHandlescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/MakeHandle().(0xffff, 0)) |
| 481 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 482 | |
| 483 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscFilters).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveLenscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveLen().(1)) |
| 484 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscFilters[0].(*netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.U32scip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/U32#).Actionsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/U32#Actions.[0].(*netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.MirredActionscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/MirredAction#).Ifindexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/MirredAction#Ifindex.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(ifbLink.Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link#Attrs().().Indexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAttrs#Index.)) |
| 485 | |
| 486 | return nil |
| 487 | })).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 488 | |
| 489 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(hostNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostNs..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(_ nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 490 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 491 | |
| 492 | ifbLink, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(hostIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIfname.) |
| 493 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 494 | |
| 495 | qdiscs, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.QdiscListscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/QdiscList().(ifbLink) |
| 496 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 497 | |
| 498 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveLenscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveLen().(2)) |
| 499 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0].Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Qdisc#Attrs().().LinkIndexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/QdiscAttrs#LinkIndex.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(ifbLink.Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link#Attrs().().Indexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAttrs#Index.)) |
| 500 | |
| 501 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0]).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(BeAssignableToTypeOfscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeAssignableToTypeOf().(&netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Tbfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#{})) |
| 502 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0].(*netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Tbfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#).Ratescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#Rate.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(uint64(1))) |
| 503 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0].(*netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Tbfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#).Limitscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#Limit.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(uint32(1))) |
| 504 | return nil |
| 505 | })).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 506 | }) |
| 507 | |
| 508 | Itscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/It().(fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().("[%s] should apply static config when both static config and runtime config exist", ver), func() { |
| 509 | conf := fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().(`{ |
| 510 | "cniVersion": "%s", |
| 511 | "name": "cni-plugin-bandwidth-test", |
| 512 | "type": "bandwidth", |
| 513 | "ingressRate": 0, |
| 514 | "ingressBurst": 123, |
| 515 | "egressRate": 123, |
| 516 | "egressBurst": 123, |
| 517 | "runtimeConfig": { |
| 518 | "bandWidth": { |
| 519 | "ingressRate": 8, |
| 520 | "ingressBurst": 8, |
| 521 | "egressRate": 16, |
| 522 | "egressBurst": 9 |
| 523 | } |
| 524 | }, |
| 525 | "prevResult": { |
| 526 | "interfaces": [ |
| 527 | { |
| 528 | "name": "%s", |
| 529 | "sandbox": "" |
| 530 | }, |
| 531 | { |
| 532 | "name": "%s", |
| 533 | "sandbox": "%s" |
| 534 | } |
| 535 | ], |
| 536 | "ips": [ |
| 537 | { |
| 538 | "version": "4", |
| 539 | "address": "%s/24", |
| 540 | "gateway": "10.0.0.1", |
| 541 | "interface": 1 |
| 542 | } |
| 543 | ], |
| 544 | "routes": [] |
| 545 | } |
| 546 | }`, ver, hostIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIfname., containerIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIfname., containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), containerIPscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIP..Stringscip-go gomod github.com/golang/go/src go1.24.2 net/IP#String().()) |
| 547 | |
| 548 | args := &skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/.CmdArgsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#{ |
| 549 | ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID.: "dummy", |
| 550 | Netnsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#Netns.: containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 551 | IfNamescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#IfName.: "eth0", |
| 552 | StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData.: []byte(conf), |
| 553 | } |
| 554 | |
| 555 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(hostNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostNs..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(_ nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 556 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 557 | |
| 558 | _, _, err := testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdAdd().(containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), args.ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID., "", []byte(conf), func() error { return cmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/cmdAdd().(args) }) |
| 559 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(MatchErrorscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/MatchError().("if burst is set, rate must also be set")) |
| 560 | return nil |
| 561 | })).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 562 | }) |
| 563 | }) |
| 564 | |
| 565 | Describescip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/Describe().("cmdDEL", func() { |
| 566 | Itscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/It().(fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().("[%s] works with a Veth pair using 0.3.0 config", ver), func() { |
| 567 | conf := fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().(`{ |
| 568 | "cniVersion": "%s", |
| 569 | "name": "cni-plugin-bandwidth-test", |
| 570 | "type": "bandwidth", |
| 571 | "ingressRate": 8, |
| 572 | "ingressBurst": 8, |
| 573 | "egressRate": 9, |
| 574 | "egressBurst": 9, |
| 575 | "prevResult": { |
| 576 | "interfaces": [ |
| 577 | { |
| 578 | "name": "%s", |
| 579 | "sandbox": "" |
| 580 | }, |
| 581 | { |
| 582 | "name": "%s", |
| 583 | "sandbox": "%s" |
| 584 | } |
| 585 | ], |
| 586 | "ips": [ |
| 587 | { |
| 588 | "version": "4", |
| 589 | "address": "%s/24", |
| 590 | "gateway": "10.0.0.1", |
| 591 | "interface": 1 |
| 592 | } |
| 593 | ], |
| 594 | "routes": [] |
| 595 | } |
| 596 | }`, ver, hostIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIfname., containerIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIfname., containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), containerIPscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIP..Stringscip-go gomod github.com/golang/go/src go1.24.2 net/IP#String().()) |
| 597 | |
| 598 | args := &skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/.CmdArgsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#{ |
| 599 | ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID.: "dummy", |
| 600 | Netnsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#Netns.: containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 601 | IfNamescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#IfName.: containerIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIfname., |
| 602 | StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData.: []byte(conf), |
| 603 | } |
| 604 | |
| 605 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(hostNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostNs..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(_ nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 606 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 607 | _, out, err := testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdAdd().(containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), args.ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID., "", []byte(conf), func() error { return cmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/cmdAdd().(args) }) |
| 608 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().(), string(out)) |
| 609 | |
| 610 | err = testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdDelscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdDel().(containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), args.ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID., "", func() error { return cmdDelscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/cmdDel().(args) }) |
| 611 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().(), string(out)) |
| 612 | |
| 613 | _, err = netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(ifbDeviceNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:ifbDeviceName.) |
| 614 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 615 | |
| 616 | return nil |
| 617 | })).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 618 | }) |
| 619 | }) |
| 620 | |
| 621 | Describescip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/Describe().("Getting the host interface which plugin should work on from veth peer of container interface", func() { |
| 622 | Itscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/It().(fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().("[%s] should work with multiple host veth interfaces", ver), func() { |
| 623 | // create veth peer in host ns |
| 624 | vethName, peerName := "host-veth-peer1", "host-veth-peer2" |
| 625 | createVethInOneNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/createVethInOneNs().(hostNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostNs., vethName, peerName) |
| 626 | |
| 627 | conf := fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().(`{ |
| 628 | "cniVersion": "%s", |
| 629 | "name": "cni-plugin-bandwidth-test", |
| 630 | "type": "bandwidth", |
| 631 | "ingressRate": 8, |
| 632 | "ingressBurst": 8, |
| 633 | "egressRate": 16, |
| 634 | "egressBurst": 8, |
| 635 | "prevResult": { |
| 636 | "interfaces": [ |
| 637 | { |
| 638 | "name": "%s", |
| 639 | "sandbox": "" |
| 640 | }, |
| 641 | { |
| 642 | "name": "%s", |
| 643 | "sandbox": "" |
| 644 | }, |
| 645 | { |
| 646 | "name": "%s", |
| 647 | "sandbox": "" |
| 648 | }, |
| 649 | { |
| 650 | "name": "%s", |
| 651 | "sandbox": "%s" |
| 652 | } |
| 653 | ], |
| 654 | "ips": [ |
| 655 | { |
| 656 | "version": "4", |
| 657 | "address": "%s/24", |
| 658 | "gateway": "10.0.0.1", |
| 659 | "interface": 1 |
| 660 | } |
| 661 | ], |
| 662 | "routes": [] |
| 663 | } |
| 664 | }`, ver, vethName, peerName, hostIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIfname., containerIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIfname., containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), containerIPscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIP..Stringscip-go gomod github.com/golang/go/src go1.24.2 net/IP#String().()) |
| 665 | |
| 666 | args := &skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/.CmdArgsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#{ |
| 667 | ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID.: "dummy", |
| 668 | Netnsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#Netns.: containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 669 | IfNamescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#IfName.: containerIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIfname., |
| 670 | StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData.: []byte(conf), |
| 671 | } |
| 672 | |
| 673 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(hostNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostNs..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(_ nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 674 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 675 | r, out, err := testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdAdd().(containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), args.ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID., "", []byte(conf), func() error { return cmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/cmdAdd().(args) }) |
| 676 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().(), string(out)) |
| 677 | result, err := types100scip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/.GetResultscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/GetResult().(r) |
| 678 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 679 | |
| 680 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(result.Interfacesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Result#Interfaces.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveLenscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveLen().(5)) |
| 681 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(result.Interfacesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Result#Interfaces.[4].Namescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Interface#Name.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(ifbDeviceNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:ifbDeviceName.)) |
| 682 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(result.Interfacesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Result#Interfaces.[4].Sandboxscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Interface#Sandbox.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().("")) |
| 683 | |
| 684 | ifbLink, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(ifbDeviceNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:ifbDeviceName.) |
| 685 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 686 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(ifbLink.Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link#Attrs().().MTUscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAttrs#MTU.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(hostIfaceMTUscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIfaceMTU.)) |
| 687 | |
| 688 | qdiscs, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.QdiscListscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/QdiscList().(ifbLink) |
| 689 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 690 | |
| 691 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveLenscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveLen().(1)) |
| 692 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0].Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Qdisc#Attrs().().LinkIndexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/QdiscAttrs#LinkIndex.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(ifbLink.Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link#Attrs().().Indexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAttrs#Index.)) |
| 693 | |
| 694 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0]).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(BeAssignableToTypeOfscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeAssignableToTypeOf().(&netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Tbfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#{})) |
| 695 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0].(*netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Tbfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#).Ratescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#Rate.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(uint64(2))) |
| 696 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0].(*netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Tbfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#).Limitscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#Limit.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(uint32(1))) |
| 697 | |
| 698 | hostVethLink, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(hostIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIfname.) |
| 699 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 700 | |
| 701 | qdiscFilters, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.FilterListscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/FilterList().(hostVethLink, netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.MakeHandlescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/MakeHandle().(0xffff, 0)) |
| 702 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 703 | |
| 704 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscFilters).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveLenscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveLen().(1)) |
| 705 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscFilters[0].(*netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.U32scip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/U32#).Actionsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/U32#Actions.[0].(*netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.MirredActionscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/MirredAction#).Ifindexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/MirredAction#Ifindex.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(ifbLink.Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link#Attrs().().Indexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAttrs#Index.)) |
| 706 | |
| 707 | return nil |
| 708 | })).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 709 | |
| 710 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(hostNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostNs..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(_ nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 711 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 712 | |
| 713 | ifbLink, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(hostIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIfname.) |
| 714 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 715 | |
| 716 | qdiscs, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.QdiscListscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/QdiscList().(ifbLink) |
| 717 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 718 | |
| 719 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveLenscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveLen().(2)) |
| 720 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0].Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Qdisc#Attrs().().LinkIndexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/QdiscAttrs#LinkIndex.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(ifbLink.Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link#Attrs().().Indexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAttrs#Index.)) |
| 721 | |
| 722 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0]).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(BeAssignableToTypeOfscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeAssignableToTypeOf().(&netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Tbfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#{})) |
| 723 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0].(*netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Tbfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#).Ratescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#Rate.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(uint64(1))) |
| 724 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(qdiscs[0].(*netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Tbfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#).Limitscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Tbf#Limit.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(uint32(1))) |
| 725 | return nil |
| 726 | })).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 727 | }) |
| 728 | |
| 729 | Itscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/It().(fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().("[%s] should fail when container interface has no veth peer", ver), func() { |
| 730 | // create a macvlan device to be container interface |
| 731 | macvlanContainerIfname := "container-macv" |
| 732 | createMacvlanscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/createMacvlan().(containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs., containerIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIfname., macvlanContainerIfname) |
| 733 | |
| 734 | conf := fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().(`{ |
| 735 | "cniVersion": "%s", |
| 736 | "name": "cni-plugin-bandwidth-test", |
| 737 | "type": "bandwidth", |
| 738 | "ingressRate": 8, |
| 739 | "ingressBurst": 8, |
| 740 | "egressRate": 16, |
| 741 | "egressBurst": 8, |
| 742 | "prevResult": { |
| 743 | "interfaces": [ |
| 744 | { |
| 745 | "name": "%s", |
| 746 | "sandbox": "" |
| 747 | }, |
| 748 | { |
| 749 | "name": "%s", |
| 750 | "sandbox": "%s" |
| 751 | } |
| 752 | ], |
| 753 | "ips": [ |
| 754 | { |
| 755 | "version": "4", |
| 756 | "address": "%s/24", |
| 757 | "gateway": "10.0.0.1", |
| 758 | "interface": 1 |
| 759 | } |
| 760 | ], |
| 761 | "routes": [] |
| 762 | } |
| 763 | }`, ver, hostIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIfname., macvlanContainerIfname, containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), containerIPscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIP..Stringscip-go gomod github.com/golang/go/src go1.24.2 net/IP#String().()) |
| 764 | |
| 765 | args := &skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/.CmdArgsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#{ |
| 766 | ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID.: "dummy", |
| 767 | Netnsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#Netns.: containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 768 | IfNamescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#IfName.: macvlanContainerIfname, |
| 769 | StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData.: []byte(conf), |
| 770 | } |
| 771 | |
| 772 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(hostNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostNs..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(_ nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 773 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 774 | |
| 775 | _, _, err := testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdAdd().(containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), args.ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID., "", []byte(conf), func() error { return cmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/cmdAdd().(args) }) |
| 776 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 777 | |
| 778 | return nil |
| 779 | })).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 780 | }) |
| 781 | |
| 782 | Itscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/It().(fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().("[%s] should fail when preResult has no interfaces", ver), func() { |
| 783 | conf := fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().(`{ |
| 784 | "cniVersion": "%s", |
| 785 | "name": "cni-plugin-bandwidth-test", |
| 786 | "type": "bandwidth", |
| 787 | "ingressRate": 8, |
| 788 | "ingressBurst": 8, |
| 789 | "egressRate": 16, |
| 790 | "egressBurst": 8, |
| 791 | "prevResult": { |
| 792 | "interfaces": [], |
| 793 | "ips": [], |
| 794 | "routes": [] |
| 795 | } |
| 796 | }`, ver) |
| 797 | |
| 798 | args := &skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/.CmdArgsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#{ |
| 799 | ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID.: "dummy", |
| 800 | Netnsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#Netns.: containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 801 | IfNamescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#IfName.: "eth0", |
| 802 | StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData.: []byte(conf), |
| 803 | } |
| 804 | |
| 805 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(hostNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostNs..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(_ nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 806 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 807 | |
| 808 | _, _, err := testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdAdd().(containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), args.ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID., "", []byte(conf), func() error { return cmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/cmdAdd().(args) }) |
| 809 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 810 | |
| 811 | return nil |
| 812 | })).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 813 | }) |
| 814 | |
| 815 | Itscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/It().(fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().("[%s] should fail when veth peer of container interface does not match any of host interfaces in preResult", ver), func() { |
| 816 | // fake a non-exist host interface name |
| 817 | fakeHostIfname := fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().("%s-fake", hostIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostIfname.) |
| 818 | |
| 819 | conf := fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().(`{ |
| 820 | "cniVersion": "%s", |
| 821 | "name": "cni-plugin-bandwidth-test", |
| 822 | "type": "bandwidth", |
| 823 | "ingressRate": 8, |
| 824 | "ingressBurst": 8, |
| 825 | "egressRate": 16, |
| 826 | "egressBurst": 8, |
| 827 | "prevResult": { |
| 828 | "interfaces": [ |
| 829 | { |
| 830 | "name": "%s", |
| 831 | "sandbox": "" |
| 832 | }, |
| 833 | { |
| 834 | "name": "%s", |
| 835 | "sandbox": "%s" |
| 836 | } |
| 837 | ], |
| 838 | "ips": [ |
| 839 | { |
| 840 | "version": "4", |
| 841 | "address": "%s/24", |
| 842 | "gateway": "10.0.0.1", |
| 843 | "interface": 1 |
| 844 | } |
| 845 | ], |
| 846 | "routes": [] |
| 847 | } |
| 848 | }`, ver, fakeHostIfname, containerIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIfname., containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), containerIPscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIP..Stringscip-go gomod github.com/golang/go/src go1.24.2 net/IP#String().()) |
| 849 | |
| 850 | args := &skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/.CmdArgsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#{ |
| 851 | ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID.: "dummy", |
| 852 | Netnsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#Netns.: containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 853 | IfNamescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#IfName.: containerIfnamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerIfname., |
| 854 | StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData.: []byte(conf), |
| 855 | } |
| 856 | |
| 857 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(hostNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostNs..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(_ nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 858 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 859 | |
| 860 | _, _, err := testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdAdd().(containerNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), args.ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID., "", []byte(conf), func() error { return cmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/cmdAdd().(args) }) |
| 861 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 862 | |
| 863 | return nil |
| 864 | })).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 865 | }) |
| 866 | }) |
| 867 | |
| 868 | Contextscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/Context.(fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().("[%s] when chaining bandwidth plugin with PTP", ver), func() { |
| 869 | var ptpConfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:ptpConf. string |
| 870 | var rateInBitsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:rateInBits. uint64 |
| 871 | var burstInBitsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:burstInBits. uint64 |
| 872 | var packetInBytesscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:packetInBytes. int |
| 873 | var containerWithoutTbfNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithoutTbfNS. nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS# |
| 874 | var containerWithTbfNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithTbfNS. nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS# |
| 875 | var portServerWithTbfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:portServerWithTbf. int |
| 876 | var portServerWithoutTbfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:portServerWithoutTbf. int |
| 877 | |
| 878 | var containerWithTbfResscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithTbfRes. typesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/.Resultscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/Result# |
| 879 | var containerWithoutTbfResscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithoutTbfRes. typesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/.Resultscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/Result# |
| 880 | var echoServerWithTbfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:echoServerWithTbf. *gexecscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/gexec`/.Sessionscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/gexec`/Session# |
| 881 | var echoServerWithoutTbfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:echoServerWithoutTbf. *gexecscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/gexec`/.Sessionscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/gexec`/Session# |
| 882 | var dataDirscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:dataDir. string |
| 883 | |
| 884 | BeforeEachscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/BeforeEach().(func() { |
| 885 | rateInBytes := 1000 |
| 886 | rateInBitsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:rateInBits. = uint64(rateInBytes * 8) |
| 887 | burstInBitsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:burstInBits. = rateInBitsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:rateInBits. * 2 |
| 888 | packetInBytesscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:packetInBytes. = rateInBytes * 25 |
| 889 | |
| 890 | var errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:err. error |
| 891 | dataDirscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:dataDir., errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:err. = osscip-go gomod github.com/golang/go/src go1.24.2 os/.MkdirTempscip-go gomod github.com/golang/go/src go1.24.2 os/MkdirTemp().("", "bandwidth_linux_test") |
| 892 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:err.).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 893 | |
| 894 | ptpConfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:ptpConf. = fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().(`{ |
| 895 | "cniVersion": "%s", |
| 896 | "name": "myBWnet", |
| 897 | "type": "ptp", |
| 898 | "ipMasq": true, |
| 899 | "mtu": 512, |
| 900 | "ipam": { |
| 901 | "type": "host-local", |
| 902 | "subnet": "10.1.2.0/24", |
| 903 | "dataDir": "%s" |
| 904 | } |
| 905 | }`, ver, dataDirscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:dataDir.) |
| 906 | |
| 907 | const ( |
| 908 | containerWithTbfIFNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithTbfIFName. = "ptp0" |
| 909 | containerWithoutTbfIFNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithoutTbfIFName. = "ptp1" |
| 910 | ) |
| 911 | |
| 912 | containerWithTbfNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithTbfNS., errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:err. = testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.NewNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/NewNS().() |
| 913 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:err.).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 914 | |
| 915 | containerWithoutTbfNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithoutTbfNS., errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:err. = testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.NewNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/NewNS().() |
| 916 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:err.).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 917 | |
| 918 | Byscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/By().("create two containers, and use the bandwidth plugin on one of them") |
| 919 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(hostNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostNs..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 920 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 921 | |
| 922 | containerWithTbfResscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithTbfRes., _, errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:err. = testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdAdd().(containerWithTbfNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithTbfNS..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), "dummy", containerWithTbfIFNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithTbfIFName., []byte(ptpConfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:ptpConf.), func() error { |
| 923 | r, err := invokescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/invoke`/.DelegateAddscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/invoke`/DelegateAdd().(contextscip-go gomod github.com/golang/go/src go1.24.2 context/.TODOscip-go gomod github.com/golang/go/src go1.24.2 context/TODO().(), "ptp", []byte(ptpConfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:ptpConf.), nil) |
| 924 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 925 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(r.Printscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/Result#Print().()).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 926 | |
| 927 | return err |
| 928 | }) |
| 929 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:err.).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 930 | |
| 931 | containerWithoutTbfResscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithoutTbfRes., _, errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:err. = testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdAdd().(containerWithoutTbfNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithoutTbfNS..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), "dummy2", containerWithoutTbfIFNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithoutTbfIFName., []byte(ptpConfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:ptpConf.), func() error { |
| 932 | r, err := invokescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/invoke`/.DelegateAddscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/invoke`/DelegateAdd().(contextscip-go gomod github.com/golang/go/src go1.24.2 context/.TODOscip-go gomod github.com/golang/go/src go1.24.2 context/TODO().(), "ptp", []byte(ptpConfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:ptpConf.), nil) |
| 933 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 934 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(r.Printscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/Result#Print().()).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 935 | |
| 936 | return err |
| 937 | }) |
| 938 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:err.).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 939 | |
| 940 | containerWithTbfResult, err := types100scip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/.GetResultscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/GetResult().(containerWithTbfResscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithTbfRes.) |
| 941 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 942 | |
| 943 | tbfPluginConf := &PluginConfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/PluginConf#{} |
| 944 | err = jsonscip-go gomod github.com/golang/go/src go1.24.2 `encoding/json`/.Unmarshalscip-go gomod github.com/golang/go/src go1.24.2 `encoding/json`/Unmarshal().([]byte(ptpConfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:ptpConf.), &tbfPluginConf) |
| 945 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 946 | |
| 947 | tbfPluginConf.RuntimeConfigscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/PluginConf#RuntimeConfig..Bandwidthscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/PluginConf#$anon_c15fe7d9e6186c79#Bandwidth. = &BandwidthEntryscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/BandwidthEntry#{ |
| 948 | IngressBurstscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/BandwidthEntry#IngressBurst.: burstInBitsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:burstInBits., |
| 949 | IngressRatescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/BandwidthEntry#IngressRate.: rateInBitsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:rateInBits., |
| 950 | EgressBurstscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/BandwidthEntry#EgressBurst.: burstInBitsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:burstInBits., |
| 951 | EgressRatescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/BandwidthEntry#EgressRate.: rateInBitsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:rateInBits., |
| 952 | } |
| 953 | tbfPluginConf.Typescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/PluginConf#Type. = "bandwidth" |
| 954 | newConfBytes, err := buildOneConfigscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/buildOneConfig().("myBWnet", ver, tbfPluginConf, containerWithTbfResult) |
| 955 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 956 | |
| 957 | args := &skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/.CmdArgsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#{ |
| 958 | ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID.: "dummy3", |
| 959 | Netnsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#Netns.: containerWithTbfNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithTbfNS..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 960 | IfNamescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#IfName.: containerWithTbfIFNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithTbfIFName., |
| 961 | StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData.: newConfBytes, |
| 962 | } |
| 963 | |
| 964 | result, out, err := testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdAdd().(containerWithTbfNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithTbfNS..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), args.ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID., "", newConfBytes, func() error { return cmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/cmdAdd().(args) }) |
| 965 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().(), string(out)) |
| 966 | |
| 967 | if testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.SpecVersionHasCHECKscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/SpecVersionHasCHECK().(ver) { |
| 968 | // Do CNI Check |
| 969 | checkConf := &PluginConfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/PluginConf#{} |
| 970 | err = jsonscip-go gomod github.com/golang/go/src go1.24.2 `encoding/json`/.Unmarshalscip-go gomod github.com/golang/go/src go1.24.2 `encoding/json`/Unmarshal().([]byte(ptpConfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:ptpConf.), &checkConf) |
| 971 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 972 | |
| 973 | checkConf.RuntimeConfigscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/PluginConf#RuntimeConfig..Bandwidthscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/PluginConf#$anon_c15fe7d9e6186c79#Bandwidth. = &BandwidthEntryscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/BandwidthEntry#{ |
| 974 | IngressBurstscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/BandwidthEntry#IngressBurst.: burstInBitsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:burstInBits., |
| 975 | IngressRatescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/BandwidthEntry#IngressRate.: rateInBitsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:rateInBits., |
| 976 | EgressBurstscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/BandwidthEntry#EgressBurst.: burstInBitsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:burstInBits., |
| 977 | EgressRatescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/BandwidthEntry#EgressRate.: rateInBitsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:rateInBits., |
| 978 | } |
| 979 | checkConf.Typescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/PluginConf#Type. = "bandwidth" |
| 980 | |
| 981 | newCheckBytes, err := buildOneConfigscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/buildOneConfig().("myBWnet", ver, checkConf, result) |
| 982 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 983 | |
| 984 | args = &skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/.CmdArgsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#{ |
| 985 | ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID.: "dummy3", |
| 986 | Netnsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#Netns.: containerWithTbfNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithTbfNS..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 987 | IfNamescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#IfName.: containerWithTbfIFNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithTbfIFName., |
| 988 | StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData.: newCheckBytes, |
| 989 | } |
| 990 | |
| 991 | err = testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdCheckscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdCheck().(containerWithTbfNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithTbfNS..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), args.ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID., "", func() error { return cmdCheckscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/cmdCheck().(args) }) |
| 992 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 993 | } |
| 994 | |
| 995 | return nil |
| 996 | })).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 997 | |
| 998 | Byscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/By().("starting a tcp server on both containers") |
| 999 | portServerWithTbfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:portServerWithTbf., echoServerWithTbfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:echoServerWithTbf. = startEchoServerInNamespacescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/startEchoServerInNamespace().(containerWithTbfNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithTbfNS.) |
| 1000 | portServerWithoutTbfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:portServerWithoutTbf., echoServerWithoutTbfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:echoServerWithoutTbf. = startEchoServerInNamespacescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/startEchoServerInNamespace().(containerWithoutTbfNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithoutTbfNS.) |
| 1001 | }) |
| 1002 | |
| 1003 | AfterEachscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/AfterEach().(func() { |
| 1004 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(osscip-go gomod github.com/golang/go/src go1.24.2 os/.RemoveAllscip-go gomod github.com/golang/go/src go1.24.2 os/RemoveAll().(dataDirscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:dataDir.)).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 1005 | |
| 1006 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(containerWithTbfNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithTbfNS..Closescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Close.()).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 1007 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.UnmountNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/UnmountNS().(containerWithTbfNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithTbfNS.)).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 1008 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(containerWithoutTbfNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithoutTbfNS..Closescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Close.()).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 1009 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.UnmountNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/UnmountNS().(containerWithoutTbfNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithoutTbfNS.)).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 1010 | |
| 1011 | if echoServerWithoutTbfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:echoServerWithoutTbf. != nil { |
| 1012 | echoServerWithoutTbfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:echoServerWithoutTbf..Killscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/gexec`/Session#Kill().() |
| 1013 | } |
| 1014 | if echoServerWithTbfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:echoServerWithTbf. != nil { |
| 1015 | echoServerWithTbfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:echoServerWithTbf..Killscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/gexec`/Session#Kill().() |
| 1016 | } |
| 1017 | }) |
| 1018 | |
| 1019 | Measurescip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/Measure().("limits ingress traffic on veth device", func(bscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:b. Benchmarkerscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/Benchmarker#) { |
| 1020 | var runtimeWithLimitscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:runtimeWithLimit. timescip-go gomod github.com/golang/go/src go1.24.2 time/.Durationscip-go gomod github.com/golang/go/src go1.24.2 time/Duration# |
| 1021 | var runtimeWithoutLimitscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:runtimeWithoutLimit. timescip-go gomod github.com/golang/go/src go1.24.2 time/.Durationscip-go gomod github.com/golang/go/src go1.24.2 time/Duration# |
| 1022 | |
| 1023 | Byscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/By().("gather timing statistics about both containers") |
| 1024 | Byscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/By().("sending tcp traffic to the container that has traffic shaped", func() { |
| 1025 | runtimeWithLimitscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:runtimeWithLimit. = bscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:b..Timescip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/Benchmarker#Time().("with tbf", func() { |
| 1026 | result, err := types100scip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/.GetResultscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/GetResult().(containerWithTbfResscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithTbfRes.) |
| 1027 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 1028 | |
| 1029 | makeTCPClientInNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/makeTCPClientInNS().(hostNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), result.IPsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Result#IPs.[0].Addressscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/IPConfig#Address..IPscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#IP..Stringscip-go gomod github.com/golang/go/src go1.24.2 net/IP#String().(), portServerWithTbfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:portServerWithTbf., packetInBytesscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:packetInBytes.) |
| 1030 | }) |
| 1031 | }) |
| 1032 | |
| 1033 | Byscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/By().("sending tcp traffic to the container that does not have traffic shaped", func() { |
| 1034 | runtimeWithoutLimitscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:runtimeWithoutLimit. = bscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:b..Timescip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/Benchmarker#Time().("without tbf", func() { |
| 1035 | result, err := types100scip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/.GetResultscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/GetResult().(containerWithoutTbfResscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:containerWithoutTbfRes.) |
| 1036 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 1037 | |
| 1038 | makeTCPClientInNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/makeTCPClientInNS().(hostNsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:hostNs..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), result.IPsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Result#IPs.[0].Addressscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/IPConfig#Address..IPscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#IP..Stringscip-go gomod github.com/golang/go/src go1.24.2 net/IP#String().(), portServerWithoutTbfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:portServerWithoutTbf., packetInBytesscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:packetInBytes.) |
| 1039 | }) |
| 1040 | }) |
| 1041 | |
| 1042 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(runtimeWithLimitscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:runtimeWithLimit.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(BeNumericallyscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeNumerically().(">", runtimeWithoutLimitscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/_:runtimeWithoutLimit.+1000*timescip-go gomod github.com/golang/go/src go1.24.2 time/.Millisecondscip-go gomod github.com/golang/go/src go1.24.2 time/Millisecond.)) |
| 1043 | }, 1) |
| 1044 | }) |
| 1045 | } |
| 1046 | |
| 1047 | Describescip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/Describe().("Validating input", func() { |
| 1048 | Itscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/It().("Should allow only 4GB burst rate", func() { |
| 1049 | err := validateRateAndBurstscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/validateRateAndBurst().(5000, 4*1024*1024*1024*8-16) // 2 bytes less than the max should pass |
| 1050 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 1051 | err = validateRateAndBurstscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/validateRateAndBurst().(5000, 4*1024*1024*1024*8) // we're 1 bit above MaxUint32 |
| 1052 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 1053 | err = validateRateAndBurstscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/validateRateAndBurst().(0, 1) |
| 1054 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 1055 | err = validateRateAndBurstscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/validateRateAndBurst().(1, 0) |
| 1056 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 1057 | err = validateRateAndBurstscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/bandwidth`/validateRateAndBurst().(0, 0) |
| 1058 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 1059 | }) |
| 1060 | }) |
| 1061 | }) |