Skip to content

Commit

Permalink
connectivity: test namespace suffix
Browse files Browse the repository at this point in the history
Always suffix test namespace with concurrent group number.
Unhide `--test-concurrency` input param.

Signed-off-by: viktor-kurchenko <[email protected]>
  • Loading branch information
viktor-kurchenko committed Jul 13, 2024
1 parent 9ffcbb4 commit fe60c11
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/kind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
# disruption), but we want to make sure that the command works as expected.
#
# Dispatch interval is set to 100ms, b/c otherwise (default is 0), the flow validation might time out.
cilium connectivity test --test-namespace test-namespace-1 \
cilium connectivity test --test-namespace test-namespace \
--conn-disrupt-dispatch-interval 100ms \
--include-conn-disrupt-test --conn-disrupt-test-setup
Expand Down
11 changes: 0 additions & 11 deletions cli/connectivity.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ func newCmdConnectivityTest(hooks api.Hooks) *cobra.Command {
cmd.Flags().DurationVar(&params.Timeout, "timeout", defaults.ConnectivityTestSuiteTimeout, "Maximum time to allow the connectivity test suite to take")

cmd.Flags().IntVar(&params.TestConcurrency, "test-concurrency", 1, "Count of namespaces to perform the connectivity tests in parallel (value <= 0 will be treated as 1)")
_ = cmd.Flags().MarkHidden("test-concurrency")

hooks.AddConnectivityTestFlags(cmd.Flags())

Expand Down Expand Up @@ -228,16 +227,6 @@ func newConnectivityTests(params check.Parameters, logger *check.ConcurrentLogge
fmt.Printf("--test-concurrency parameter value is invalid [%d], using 1 instead\n", params.TestConcurrency)
params.TestConcurrency = 1
}
if params.TestConcurrency < 2 {
if params.ExternalTargetCANamespace == "" {
params.ExternalTargetCANamespace = defaults.ConnectivityCheckNamespace
}
cc, err := check.NewConnectivityTest(k8sClient, params, defaults.CLIVersion, logger)
if err != nil {
return nil, err
}
return []*check.ConnectivityTest{cc}, nil
}

connTests := make([]*check.ConnectivityTest, 0, params.TestConcurrency)
for i := 0; i < params.TestConcurrency; i++ {
Expand Down
8 changes: 4 additions & 4 deletions cli/connectivity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ func TestNewConnectivityTests(t *testing.T) {
ExternalTargetCANamespace: "",
},
expectedCount: 1,
expectedTestNamespaces: []string{"cilium-test"},
expectedExternalTargetCANamespace: []string{"cilium-test"},
expectedTestNamespaces: []string{"cilium-test-1"},
expectedExternalTargetCANamespace: []string{"cilium-test-1"},
},
{
params: check.Parameters{
Expand All @@ -36,7 +36,7 @@ func TestNewConnectivityTests(t *testing.T) {
ExternalTargetCANamespace: "cilium-test",
},
expectedCount: 1,
expectedTestNamespaces: []string{"cilium-test"},
expectedTestNamespaces: []string{"cilium-test-1"},
expectedExternalTargetCANamespace: []string{"cilium-test"},
},
{
Expand All @@ -47,7 +47,7 @@ func TestNewConnectivityTests(t *testing.T) {
TestConcurrency: -1,
},
expectedCount: 1,
expectedTestNamespaces: []string{"cilium-test"},
expectedTestNamespaces: []string{"cilium-test-1"},
expectedExternalTargetCANamespace: []string{"cilium-test"},
},
{
Expand Down

0 comments on commit fe60c11

Please sign in to comment.