Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cilium-issue-26243/Re-add-Bandwith-Manager-in-CI #1833

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions connectivity/check/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ type Parameters struct {
PerfSamples int
CurlImage string
PerformanceImage string
// BandWidth
BandWidthManager bool
JSONMockImage string
AgentDaemonSetName string
DNSTestServerImage string
Expand Down
8 changes: 8 additions & 0 deletions connectivity/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,14 @@ func Run(ctx context.Context, ct *check.ConnectivityTest, addExtraTests func(*ch
return ct.Run(ctx)
}

// BandWidth Manager Test
if ct.Params().BandWidthManager {
ct.NewTest("bandwidth-manager").WithScenarios(
tests.BandWidthManager(""),
)
return ct.Run(ctx)
}

// Conn disrupt Test
if ct.Params().IncludeConnDisruptTest {
ct.NewTest("no-interrupted-connections").WithScenarios(
Expand Down
41 changes: 41 additions & 0 deletions connectivity/tests/bandwidth.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright Authors of Cilium

package tests

import (
"context"
"fmt"

"github.com/cilium/cilium-cli/connectivity/check"
)

// BandWidth Manager
func BandWidthManager(n string) check.Scenario {
return &bandWidthManager{
name: n,
}
}

// bandWidthManager implements a Scenario.
type bandWidthManager struct {
name string
}

func (b *bandWidthManager) Name() string {
tn := "bandwidth-manager"
if b.name == "" {
return tn
}
return fmt.Sprintf("%s:%s", tn, b.name)
}

func (b *bandWidthManager) Run(ctx context.Context, t *check.Test) {
for _, c := range t.Context().PerfClientPods() {
c := c
for _, server := range t.Context().PerfServerPod() {
action := t.NewAction(b, "bandwidth", &c, server, check.IPFamilyV4)
action.Run(func(a *check.Action) {})
}
}
}
2 changes: 2 additions & 0 deletions internal/cli/cmd/connectivity.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ func newCmdConnectivityTest(hooks Hooks) *cobra.Command {
cmd.Flags().BoolVar(&params.PerfCRR, "perf-crr", false, "Run Netperf CRR Test. --perf-samples and --perf-duration ignored")
cmd.Flags().BoolVar(&params.PerfHostNet, "host-net", false, "Use host networking during network performance tests")

cmd.Flags().BoolVar(&params.BandWidthManager, "bandwidth-manager", false, "Run bandwidth manager tests")

cmd.Flags().StringVar(&params.CurlImage, "curl-image", defaults.ConnectivityCheckAlpineCurlImage, "Image path to use for curl")
cmd.Flags().StringVar(&params.PerformanceImage, "performance-image", defaults.ConnectivityPerformanceImage, "Image path to use for performance")
cmd.Flags().StringVar(&params.JSONMockImage, "json-mock-image", defaults.ConnectivityCheckJSONMockImage, "Image path to use for json mock")
Expand Down
Loading