Skip to content

Commit

Permalink
Simplify unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Tomofumi Hayashi <tohayash@redhat.com>
  • Loading branch information
s1061123 committed Apr 8, 2024
1 parent 78ebd8b commit ccc1cfa
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions plugins/meta/bandwidth/bandwidth_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ var _ = Describe("bandwidth test", func() {
}

// Container egress (host ingress)
Expect(hostNs.Do(func(netNS ns.NetNS) error {
Expect(hostNs.Do(func(_ ns.NetNS) error {
defer GinkgoRecover()
r, out, err := testutils.CmdAdd(containerNs.Path(), args.ContainerID, "", []byte(conf), func() error { return cmdAdd(args) })
Expect(err).NotTo(HaveOccurred(), string(out))
Expand Down Expand Up @@ -266,7 +266,7 @@ var _ = Describe("bandwidth test", func() {
}

// Container egress (host ingress)
Expect(hostNs.Do(func(netNS ns.NetNS) error {
Expect(hostNs.Do(func(_ ns.NetNS) error {
defer GinkgoRecover()
r, out, err := testutils.CmdAdd(containerNs.Path(), args.ContainerID, "", []byte(conf), func() error { return cmdAdd(args) })
Expect(err).NotTo(HaveOccurred(), string(out))
Expand Down Expand Up @@ -523,7 +523,7 @@ var _ = Describe("bandwidth test", func() {
}

// Container egress (host ingress)
Expect(hostNs.Do(func(netNS ns.NetNS) error {
Expect(hostNs.Do(func(_ ns.NetNS) error {
defer GinkgoRecover()
r, out, err := testutils.CmdAdd(containerNs.Path(), args.ContainerID, "", []byte(conf), func() error { return cmdAdd(args) })
Expect(err).NotTo(HaveOccurred(), string(out))
Expand Down Expand Up @@ -779,7 +779,7 @@ var _ = Describe("bandwidth test", func() {
}

// check container egress side / host ingress side, we expect to get some QoS setup there
Expect(hostNs.Do(func(netNS ns.NetNS) error {
Expect(hostNs.Do(func(_ ns.NetNS) error {
defer GinkgoRecover()

_, out, err := testutils.CmdAdd(containerNs.Path(), args.ContainerID, ifbDeviceName, []byte(conf), func() error { return cmdAdd(args) })
Expand Down Expand Up @@ -944,7 +944,7 @@ var _ = Describe("bandwidth test", func() {
StdinData: []byte(conf),
}

Expect(hostNs.Do(func(netNS ns.NetNS) error {
Expect(hostNs.Do(func(_ ns.NetNS) error {
defer GinkgoRecover()

_, out, err := testutils.CmdAdd(containerNs.Path(), args.ContainerID, ifbDeviceName, []byte(conf), func() error { return cmdAdd(args) })
Expand Down Expand Up @@ -1050,7 +1050,7 @@ var _ = Describe("bandwidth test", func() {
StdinData: []byte(conf),
}

Expect(hostNs.Do(func(netNS ns.NetNS) error {
Expect(hostNs.Do(func(_ ns.NetNS) error {
defer GinkgoRecover()
r, out, err := testutils.CmdAdd(containerNs.Path(), args.ContainerID, "", []byte(conf), func() error { return cmdAdd(args) })
Expect(err).NotTo(HaveOccurred(), string(out))
Expand Down Expand Up @@ -1303,7 +1303,7 @@ var _ = Describe("bandwidth test", func() {
StdinData: []byte(conf),
}

Expect(hostNs.Do(func(netNS ns.NetNS) error {
Expect(hostNs.Do(func(_ ns.NetNS) error {
defer GinkgoRecover()
_, out, err := testutils.CmdAdd(containerNs.Path(), args.ContainerID, "", []byte(conf), func() error { return cmdAdd(args) })
Expect(err).NotTo(HaveOccurred(), string(out))
Expand Down

0 comments on commit ccc1cfa

Please sign in to comment.