hs-test: fix install-kind-deps and kubeconfig path 81/43381/3
authorAdrian Villin <[email protected]>
Tue, 8 Jul 2025 08:45:55 +0000 (10:45 +0200)
committerFlorin Coras <[email protected]>
Tue, 8 Jul 2025 20:31:05 +0000 (20:31 +0000)
Type: test

Change-Id: Ic9f883e510e275e862c700e4aae4630ad3dcfee8
Signed-off-by: Adrian Villin <[email protected]>
extras/hs-test/Makefile
extras/hs-test/hs_test.sh
extras/hs-test/infra/kind/deployment.go
extras/hs-test/infra/kind/suite_kind.go
extras/hs-test/kind_test.go

index 2bc3db1..11b5235 100644 (file)
@@ -234,20 +234,24 @@ build-debug: .deps.ok build-vpp-debug build-go
 
 .PHONY: install-kind-deps
 install-kind-deps: .deps.ok
-       @go install sigs.k8s.io/[email protected]
-       -@if which kind > /dev/null 2>&1; then \
-        sudo ln -s $$(which kind) /usr/bin/kind; \
+       -@if ! command -v kind >/dev/null 2>&1; then \
+               echo "Installing KinD"; \
+               go install sigs.k8s.io/[email protected]; \
+               echo "Creating symlink from '$(HOME)/go/bin/kind' to '/usr/bin/kind'"; \
+               sudo ln -s $(HOME)/go/bin/kind /usr/bin/kind; \
+       else \
+               echo "KinD is already installed. Skipping."; \
        fi
        @if ! command -v kubectl >/dev/null 2>&1; then \
         echo "kubectl not found. Installing kubectl..."; \
         sudo -E apt-get update && sudo apt-get install -y apt-transport-https ca-certificates curl gnupg; \
-        curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.33/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg; \
+        curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.31/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg; \
         sudo -E chmod 644 /etc/apt/keyrings/kubernetes-apt-keyring.gpg; \
         echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.31/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list; \
         sudo -E chmod 644 /etc/apt/sources.list.d/kubernetes.list; \
         sudo apt-get update && sudo apt-get install -y kubectl; \
     else \
-        echo "kubectl is already installed. Skipping installation."; \
+        echo "kubectl is already installed. Skipping."; \
        fi
        @touch .kind_deps.ok
 
index 96d287a..0337489 100644 (file)
@@ -167,7 +167,7 @@ if [ $focused_test -eq 0 ] && [ $debug_set -eq 1 ]; then
     exit 2
 fi
 
-sudo_user="${SUDO_USER:-root}"
+sudo_user="${SUDO_USER:-${USER:-root}}"
 args="$args -sudo_user $sudo_user"
 
 if [ $leak_check_set -eq 1 ]; then
index d28ffc8..6404056 100644 (file)
@@ -20,7 +20,7 @@ func (s *KindSuite) loadDockerImages() {
        var err error
        for _, image := range s.images {
                s.Log("loading docker image %s...", image)
-               cmd = exec.Command("kind", "load", "docker-image", image)
+               cmd = exec.Command("go", "run", "sigs.k8s.io/[email protected]", "load", "docker-image", image)
                out, err = cmd.CombinedOutput()
                s.Log(string(out))
                s.AssertNil(err, string(out))
index 2095b7f..45b24fc 100644 (file)
@@ -59,6 +59,8 @@ func (s *KindSuite) SetupSuite() {
        } else {
                s.KubeconfigPath = "/home/" + *SudoUser + "/.kube/config"
        }
+       s.Log("User: '%s'", *SudoUser)
+       s.Log("Config path: '%s'", s.KubeconfigPath)
 
        s.Config, err = clientcmd.BuildConfigFromFlags("", s.KubeconfigPath)
        s.AssertNil(err)
index 05841b6..0e0431d 100644 (file)
@@ -37,7 +37,7 @@ func KindIperfVclTest(s *KindSuite) {
                vcl + " " + ldp + " iperf3 -s -D -4"})
        s.AssertNil(err, o)
        output, err := s.Exec(s.Pods.ClientGeneric, []string{"/bin/bash", "-c",
-               vcl + " " + ldp + " iperf3 -c " + s.Pods.ServerGeneric.IpAddress})
+               vcl + " " + ldp + " iperf3 -l 1460 -b 10g -c " + s.Pods.ServerGeneric.IpAddress})
        s.Log(output)
        s.AssertNil(err)
 }