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

[WIP NotForReview Multicast] Improve kind e2e tests for multicast #3944

Closed
wants to merge 2 commits into from
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
3 changes: 1 addition & 2 deletions .github/workflows/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,7 @@ jobs:
run: |
mkdir log
mkdir test-e2e-encap-all-features-enabled-coverage
# Currently multicast tests require specific testbeds, exclude it for now.
ANTREA_LOG_DIR=$PWD/log ANTREA_COV_DIR=$PWD/test-e2e-encap-all-features-enabled-coverage ./ci/kind/test-e2e-kind.sh --encap-mode encap --coverage --feature-gates AllAlpha=true,AllBeta=true,Multicast=false --proxy-all
ANTREA_LOG_DIR=$PWD/log ANTREA_COV_DIR=$PWD/test-e2e-encap-all-features-enabled-coverage ./ci/kind/test-e2e-kind.sh --encap-mode encap --coverage --feature-gates AllAlpha=true,AllBeta=true --proxy-all
- name: Tar coverage files
run: tar -czf test-e2e-encap-all-features-enabled-coverage.tar.gz test-e2e-encap-all-features-enabled-coverage
- name: Upload coverage for test-e2e-encap-all-features-enabled-coverage
Expand Down
7 changes: 7 additions & 0 deletions ci/kind/kind-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ function configure_networks {
networks=$(docker network ls -f name=antrea --format '{{.Name}}')
networks="$(echo $networks)"
if [[ -z $SUBNETS ]] && [[ -z $networks ]]; then
docker network create -d bridge multicast-bridge
node="$(kind get nodes --name kind | grep control-plane)"
docker network connect multicast-bridge $node
docker run -d --name mcjoin --network multicast-bridge troglobit/mcjoin
docker run -d --name mcjoin1 --network kind troglobit/mcjoin
docker run -d --name mcjoin2 --network kind troglobit/mcjoin
docker run -d --name mcjoin3 --network kind troglobit/mcjoin
echo "Using default kind docker network"
return
fi
Expand Down
7 changes: 5 additions & 2 deletions ci/kind/test-e2e-kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@ trap "quit" INT EXIT

manifest_args="$manifest_args --verbose-log"
if [ -n "$feature_gates" ]; then
manifest_args="$manifest_args --feature-gates $feature_gates"
if [[ "$feature_gates" == *"Multicast=true"* ]] || ([[ "$feature_gates" == *"AllAlpha=true"* ]] && [[ "$feature_gates" != *"AllAlpha=false"* ]]); then
manifest_args="$manifest_args --multicast --multicast-interfaces eth1 --extra-helm-values multicast.igmpQueryInterval=10s"
fi
manifest_args="$manifest_args --feature-gates $feature_gates"
fi
if $proxy_all; then
manifest_args="$manifest_args --proxy-all"
Expand All @@ -160,7 +163,7 @@ if $coverage; then
manifest_args="$manifest_args --coverage"
COMMON_IMAGES_LIST+=("antrea/antrea-ubuntu-coverage:latest")
else
COMMON_IMAGES_LIST+=("antrea/antrea-ubuntu:latest")
COMMON_IMAGES_LIST+=("projects.registry.vmware.com/antrea/antrea-ubuntu:latest")
fi
if $proxy_all; then
COMMON_IMAGES_LIST+=("k8s.gcr.io/echoserver:1.10")
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/antreapolicy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3777,12 +3777,12 @@ func testACNPIGMPQuery(t *testing.T, data *TestData, acnpName, caseName, groupAd
testNamespace := data.testNamespace
mc := multicastTestcase{
name: caseName,
senderConfig: multicastTestPodConfig{nodeIdx: 0, isHostNetwork: false},
senderConfig: multicastTestPodConfig{nodeIdx: 0, isExternalHost: false},
receiverConfigs: []multicastTestPodConfig{{1, false}},
port: 3457,
group: net.ParseIP(groupAddress),
}
senderName, _, cleanupFunc := createAndWaitForPod(t, data, data.createMcJoinPodOnNode, "test-sender-", nodeName(mc.senderConfig.nodeIdx), testNamespace, mc.senderConfig.isHostNetwork)
senderName, _, cleanupFunc := createAndWaitForPod(t, data, data.createMcJoinPodOnNode, "test-sender-", nodeName(mc.senderConfig.nodeIdx), testNamespace, mc.senderConfig.isExternalHost)
defer cleanupFunc()
var wg sync.WaitGroup
receiverNames, cleanupFuncs := setupReceivers(t, data, mc, mcjoinWaitTimeout, &wg)
Expand Down Expand Up @@ -3863,12 +3863,12 @@ func testACNPMulticastEgress(t *testing.T, data *TestData, acnpName, caseName, g
testNamespace := data.testNamespace
mc := multicastTestcase{
name: caseName,
senderConfig: multicastTestPodConfig{nodeIdx: 0, isHostNetwork: false},
senderConfig: multicastTestPodConfig{nodeIdx: 0, isExternalHost: false},
receiverConfigs: []multicastTestPodConfig{{1, false}},
port: 3457,
group: net.ParseIP(groupAddress),
}
senderName, _, cleanupFunc := createAndWaitForPod(t, data, data.createMcJoinPodOnNode, "test-sender-", nodeName(mc.senderConfig.nodeIdx), testNamespace, mc.senderConfig.isHostNetwork)
senderName, _, cleanupFunc := createAndWaitForPod(t, data, data.createMcJoinPodOnNode, "test-sender-", nodeName(mc.senderConfig.nodeIdx), testNamespace, mc.senderConfig.isExternalHost)
defer cleanupFunc()
var wg sync.WaitGroup
receiverNames, cleanupFuncs := setupReceivers(t, data, mc, mcjoinWaitTimeout, &wg)
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -2202,7 +2202,7 @@ func (data *TestData) GetMulticastInterfaces(antreaNamespace string) ([]string,
}

func GetTransportInterface(data *TestData) (string, error) {
_, transportInterfaceUntrimmed, _, err := data.RunCommandOnNode(nodeName(0), fmt.Sprintf("ip -br addr show | grep %s | awk '{print $1}'", clusterInfo.nodes[0].ipv4Addr))
_, transportInterfaceUntrimmed, _, err := data.RunCommandOnNode(nodeName(0), fmt.Sprintf("/bin/sh -c ip -br addr show | grep %s | sed \"s/[ @].*//\"", clusterInfo.nodes[0].ipv4Addr))
if err != nil {
return "", err
}
Expand Down
Loading