-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
connectivity: add endpointslice clustermesh sync test
This adds endpointslice synchronization testing inside a clustermesh. It does that by checking that we can get a DNS answer with a global headless service with endpointslice synchronization enabled across two clusters. Testing it via DNS ensures that the created EndpointSlice are correctly linked to the headless service. Signed-off-by: Arthur Outhenin-Chalandre <[email protected]>
- Loading branch information
1 parent
f0cf9f0
commit d7fa6d4
Showing
8 changed files
with
155 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Copyright Authors of Cilium | ||
|
||
package builder | ||
|
||
import ( | ||
"github.com/cilium/cilium-cli/connectivity/check" | ||
"github.com/cilium/cilium-cli/connectivity/tests" | ||
"github.com/cilium/cilium-cli/utils/features" | ||
) | ||
|
||
type clusterMeshEndpointSliceSync struct{} | ||
|
||
func (t clusterMeshEndpointSliceSync) build(ct *check.ConnectivityTest, _ map[string]string) { | ||
newTest("clustermesh-endpointslice-sync", ct). | ||
WithCondition(func() bool { return ct.Params().MultiCluster != "" }). | ||
WithFeatureRequirements(features.RequireEnabled(features.ClusterMeshEnableEndpointSync)). | ||
WithScenarios(tests.ClusterMeshEndpointSliceSync()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Copyright Authors of Cilium | ||
|
||
package tests | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/cilium/cilium-cli/connectivity/check" | ||
"github.com/cilium/cilium-cli/utils/features" | ||
) | ||
|
||
func ClusterMeshEndpointSliceSync() check.Scenario { | ||
return &clusterMeshEndpointSliceSync{} | ||
} | ||
|
||
type clusterMeshEndpointSliceSync struct{} | ||
|
||
func (s *clusterMeshEndpointSliceSync) Name() string { | ||
return "clustermesh-endpointslice-sync" | ||
} | ||
|
||
func (s *clusterMeshEndpointSliceSync) Run(ctx context.Context, t *check.Test) { | ||
ct := t.Context() | ||
client := ct.RandomClientPod() | ||
|
||
service, ok := ct.EchoServicesAll()[check.EchoOtherNodeDeploymentHeadlessServiceName] | ||
if !ok { | ||
t.Fatalf("Cannot get %s service", check.EchoOtherNodeDeploymentHeadlessServiceName) | ||
} | ||
|
||
t.ForEachIPFamily(func(ipFam features.IPFamily) { | ||
t.NewAction(s, fmt.Sprintf("dig-%s", ipFam), client, service, ipFam).Run(func(a *check.Action) { | ||
a.ExecInPod(ctx, ct.DigCommandService(service, ipFam)) | ||
}) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters