hs-test: fix KinD cluster setup 99/43599/4
authorAdrian Villin <[email protected]>
Fri, 5 Sep 2025 07:01:45 +0000 (09:01 +0200)
committerFlorin Coras <[email protected]>
Tue, 9 Sep 2025 15:47:26 +0000 (15:47 +0000)
Type: test

Change-Id: I00dfe98e2bed81a5db6d50f3244c0b8ab546c356
Signed-off-by: Adrian Villin <[email protected]>
extras/hs-test/infra/kind/suite_kind.go
extras/hs-test/kubernetes/setup-cluster.sh

index 903e88a..eb386f5 100644 (file)
@@ -9,6 +9,7 @@ import (
        "regexp"
        "runtime"
        "strings"
+       "time"
 
        . "fd.io/hs-test/infra/common"
        "github.com/a8m/envsubst"
@@ -132,6 +133,10 @@ func (s *KindSuite) SetMtuAndRestart(CALICO_NETWORK_CONFIG string, ADDITIONAL_VP
        o, err = cmd.CombinedOutput()
        s.Log(string(o))
        s.AssertNil(err)
+
+       // let vpp-dataplane recover (tests might timeout otherwise)
+       s.Log("Waiting for 10 seconds")
+       time.Sleep(time.Second * 10)
 }
 
 func (s *KindSuite) TeardownTest() {
index 03ebf4f..c7dbdff 100755 (executable)
@@ -9,7 +9,7 @@ COMMIT_HASH=$(git rev-parse HEAD)
 reg_name='kind-registry'
 reg_port='5000'
 
-export CALICO_NETWORK_CONFIG=${CALICO_NETWORK_CONFIG:-9000}
+export CALICO_NETWORK_CONFIG=${CALICO_NETWORK_CONFIG:-"mtu: 9000"}
 export CALICOVPP_VERSION="${CALICOVPP_VERSION:-latest}"
 export TIGERA_VERSION="${TIGERA_VERSION:-v3.28.3}"
 echo "CALICOVPP_VERSION=$CALICOVPP_VERSION" > kubernetes/.vars
@@ -44,7 +44,7 @@ fi
 # create registry
 if [ "$(docker inspect -f '{{.State.Running}}' "${reg_name}" 2>/dev/null || true)" != 'true' ]; then
   docker run \
-    -d --restart=always -p "127.0.0.1:${reg_port}" --name "${reg_name}" \
+    -d --restart=always -p "127.0.0.1:${reg_port}:5000" --name "${reg_name}" \
     registry:2
 fi
 
@@ -93,7 +93,7 @@ cherry_pick() {
   STASHED_CHANGES=0
   echo "checkpoint: $COMMIT_HASH"
   # chery-vpp hard resets the repo to a commit - we want to keep our changes
-  if ! git diff-index --quiet HEAD --; then
+  if [[ -n $(git status --porcelain) ]]; then
            echo "Saving stash"
       git stash save "HST: temp stash"
       STASHED_CHANGES=1
@@ -115,7 +115,7 @@ build_load_start_cni() {
 
 restore_repo() {
   # stash changes, reset local repo to the original state and unstash changes (removes CalicoVPP's patches)
-  if ! git diff-index --quiet HEAD --; then
+  if [[ -n $(git status --porcelain) ]]; then
            echo "Saving stash"
       git stash save "HST: temp stash"
       git reset --hard $COMMIT_HASH