From cce10543888a9299c604b63d1fd67454857b3169 Mon Sep 17 00:00:00 2001 From: Miguel Duarte Barroso Date: Wed, 6 Oct 2021 13:46:35 +0200 Subject: [PATCH 1/2] e2e tests: make WB play along with containerd containerd sends CNI CMD check instructions to the plugins, and whereabouts does not implement that command, returning with an error. As per the CNI specification - [0] - the runtime "may assume that a failed CHECK means the container is permanently in a misconfigured state." and as a results replies with a CNI del. By instructing the CRI to not send CNI checks we work around this issue. [0] - https://github.com/containernetworking/cni/blob/master/SPEC.md#check-check-containers-networking-is-as-expected Signed-off-by: Miguel Duarte Barroso --- hack/e2e-test.sh | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/hack/e2e-test.sh b/hack/e2e-test.sh index cd20fa615..390207b3a 100755 --- a/hack/e2e-test.sh +++ b/hack/e2e-test.sh @@ -160,18 +160,23 @@ metadata: spec: config: '{ "cniVersion": "0.3.0", - "type": "macvlan", - "master": "$TEST_INTERFACE_NAME", - "mode": "bridge", - "ipam": { - "type": "whereabouts", - "leader_lease_duration": $LEADER_LEASE_DURATION, - "leader_renew_deadline": $LEADER_RENEW_DEADLINE, - "leader_retry_period": $LEADER_RETRY_PERIOD, - "range": "$1", - "log_level": "debug", - "log_file": "/tmp/wb" - } + "disableCheck": true, + "plugins": [ + { + "type": "macvlan", + "master": "$TEST_INTERFACE_NAME", + "mode": "bridge", + "ipam": { + "type": "whereabouts", + "leader_lease_duration": $LEADER_LEASE_DURATION, + "leader_renew_deadline": $LEADER_RENEW_DEADLINE, + "leader_retry_period": $LEADER_RETRY_PERIOD, + "range": "$1", + "log_level": "debug", + "log_file": "/tmp/wb" + } + } + ] }' EOF } From 876f0a29275c97b16802433c50713b9b384e1cf8 Mon Sep 17 00:00:00 2001 From: Miguel Duarte Barroso Date: Wed, 6 Oct 2021 14:50:19 +0200 Subject: [PATCH 2/2] e2e tests: manually reconcile the cluster Before checking for stale IP addresses, trigger the `ip-reconciler` tool, which will cleanup stale IP addresses. In order to manually run the reconciler, we need to build it first; as such, the github action must be updated. Signed-off-by: Miguel Duarte Barroso --- .github/workflows/test.yml | 2 +- hack/e2e-test.sh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1586828c8..860b4d30e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -75,7 +75,7 @@ jobs: uses: actions/checkout@v2 - name: Install requirements - run: sudo apt-get install nmap jq + run: sudo apt-get install nmap jq && ./hack/build-go.sh - name: Get tools, setup KinD cluster test environment run: source hack/e2e-get-test-tools.sh && ./hack/e2e-setup-kind-cluster.sh --number-of-compute $NUMBER_OF_COMPUTE_NODES diff --git a/hack/e2e-test.sh b/hack/e2e-test.sh index 390207b3a..3174fbffc 100755 --- a/hack/e2e-test.sh +++ b/hack/e2e-test.sh @@ -207,6 +207,10 @@ is_ippool_consistent() { local pod_ips local resolved_ippool_ip local exit_code=0 + + echo "Forcing reconciliation of the cluster ..." + bin/ip-reconciler -kubeconfig="${HOME}"/.kube/config + ippool_keys=($(kubectl get ippool $pool_name --namespace $pool_namespace --output json \ | jq --raw-output '.spec.allocations|to_entries |map("\(.key)")| .[]')) ips=($(nmap -sL -n $range | awk '/Nmap scan report for/{printf "%s ", $NF}'))