Skip to content

Commit

Permalink
Revert "Merge pull request containernetworking#921 from oOraph/dev/ex…
Browse files Browse the repository at this point in the history
…clude_subnets_from_traffic_shapping2"

This reverts commit ef076af, reversing
changes made to 5974089.
  • Loading branch information
h0nIg committed Oct 11, 2024
1 parent cc8b1bd commit 6cf3cdb
Show file tree
Hide file tree
Showing 9 changed files with 610 additions and 2,886 deletions.
35 changes: 10 additions & 25 deletions integration/integration_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"bytes"
"fmt"
"io"
"log"
"math/rand"
"net"
"os"
Expand Down Expand Up @@ -61,13 +60,6 @@ var _ = Describe("Basic PTP using cnitool", func() {
netConfPath, err := filepath.Abs("./testdata")
Expect(err).NotTo(HaveOccurred())

// Flush ipam stores to avoid conflicts
err = os.RemoveAll("/tmp/chained-ptp-bandwidth-test")
Expect(err).NotTo(HaveOccurred())

err = os.RemoveAll("/tmp/basic-ptp-test")
Expect(err).NotTo(HaveOccurred())

env = TestEnv([]string{
"CNI_PATH=" + cniPath,
"NETCONFPATH=" + netConfPath,
Expand All @@ -90,7 +82,6 @@ var _ = Describe("Basic PTP using cnitool", func() {
env.runInNS(hostNS, cnitoolBin, "add", netName, contNS.LongName())

addrOutput := env.runInNS(contNS, "ip", "addr")

Expect(addrOutput).To(ContainSubstring(expectedIPPrefix))

env.runInNS(hostNS, cnitoolBin, "del", netName, contNS.LongName())
Expand Down Expand Up @@ -154,13 +145,9 @@ var _ = Describe("Basic PTP using cnitool", func() {

chainedBridgeBandwidthEnv.runInNS(hostNS, cnitoolBin, "del", "network-chain-test", contNS1.LongName())
basicBridgeEnv.runInNS(hostNS, cnitoolBin, "del", "network-chain-test", contNS2.LongName())

contNS1.Del()
contNS2.Del()
hostNS.Del()
})

It("limits traffic only on the restricted bandwidth veth device", func() {
Measure("limits traffic only on the restricted bandwidth veth device", func(b Benchmarker) {
ipRegexp := regexp.MustCompile(`10\.1[12]\.2\.\d{1,3}`)

By(fmt.Sprintf("adding %s to %s\n\n", "chained-bridge-bandwidth", contNS1.ShortName()))
Expand All @@ -181,23 +168,21 @@ var _ = Describe("Basic PTP using cnitool", func() {
By(fmt.Sprintf("starting echo server in %s\n\n", contNS2.ShortName()))
basicBridgePort, basicBridgeSession = startEchoServerInNamespace(contNS2)

packetInBytes := 3000
packetInBytes := 20000 // The shaper needs to 'warm'. Send enough to cause it to throttle,
// balanced by run time.

By(fmt.Sprintf("sending tcp traffic to the chained, bridged, traffic shaped container on ip address '%s:%d'\n\n", chainedBridgeIP, chainedBridgeBandwidthPort))
start := time.Now()
makeTCPClientInNS(hostNS.ShortName(), chainedBridgeIP, chainedBridgeBandwidthPort, packetInBytes)
runtimeWithLimit := time.Since(start)

log.Printf("Runtime with qos limit %.2f seconds", runtimeWithLimit.Seconds())
runtimeWithLimit := b.Time("with chained bridge and bandwidth plugins", func() {
makeTCPClientInNS(hostNS.ShortName(), chainedBridgeIP, chainedBridgeBandwidthPort, packetInBytes)
})

By(fmt.Sprintf("sending tcp traffic to the basic bridged container on ip address '%s:%d'\n\n", basicBridgeIP, basicBridgePort))
start = time.Now()
makeTCPClientInNS(hostNS.ShortName(), basicBridgeIP, basicBridgePort, packetInBytes)
runtimeWithoutLimit := time.Since(start)
log.Printf("Runtime without qos limit %.2f seconds", runtimeWithLimit.Seconds())
runtimeWithoutLimit := b.Time("with basic bridged plugin", func() {
makeTCPClientInNS(hostNS.ShortName(), basicBridgeIP, basicBridgePort, packetInBytes)
})

Expect(runtimeWithLimit).To(BeNumerically(">", runtimeWithoutLimit+1000*time.Millisecond))
})
}, 1)
})
})

Expand Down
3 changes: 1 addition & 2 deletions integration/testdata/basic-ptp.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"mtu": 512,
"ipam": {
"type": "host-local",
"subnet": "10.1.2.0/24",
"dataDir": "/tmp/basic-ptp-test"
"subnet": "10.1.2.0/24"
}
}
3 changes: 1 addition & 2 deletions integration/testdata/chained-ptp-bandwidth.conflist
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"mtu": 512,
"ipam": {
"type": "host-local",
"subnet": "10.9.2.0/24",
"dataDir": "/tmp/chained-ptp-bandwidth-test"
"subnet": "10.9.2.0/24"
}
},
{
Expand Down
Loading

0 comments on commit 6cf3cdb

Please sign in to comment.