From 86aab597b0bdf7e78fe466489c22b1e1b600ccaa Mon Sep 17 00:00:00 2001 From: sivakami Date: Sun, 9 Nov 2025 21:18:31 -0800 Subject: [PATCH 01/19] test ginkgo change. --- go.mod | 14 ++-- go.sum | 34 ++++++-- .../integration/swiftv2/helpers/az_helpers.go | 53 +++++++++++++ .../long_running_cluster/datapath-test.go | 78 +++++++++++++++++++ .../swiftv2/long_running_cluster/datapath.go | 76 ++++++++++++++++++ 5 files changed, 238 insertions(+), 17 deletions(-) create mode 100644 test/integration/swiftv2/helpers/az_helpers.go create mode 100644 test/integration/swiftv2/long_running_cluster/datapath-test.go create mode 100644 test/integration/swiftv2/long_running_cluster/datapath.go diff --git a/go.mod b/go.mod index bf07d7f6ac..4daba52873 100644 --- a/go.mod +++ b/go.mod @@ -68,7 +68,6 @@ require ( github.com/gofrs/uuid v4.4.0+incompatible // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/hpcloud/tail v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -104,12 +103,9 @@ require ( golang.org/x/term v0.36.0 // indirect golang.org/x/text v0.30.0 // indirect golang.org/x/time v0.14.0 - golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect - gopkg.in/fsnotify.v1 v1.4.7 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect @@ -125,6 +121,7 @@ require ( github.com/cilium/cilium v1.15.16 github.com/cilium/ebpf v0.19.0 github.com/jsternberg/zap-logfmt v1.3.0 + github.com/onsi/ginkgo/v2 v2.23.4 golang.org/x/sync v0.17.0 gotest.tools/v3 v3.5.2 k8s.io/kubectl v0.34.1 @@ -147,9 +144,11 @@ require ( github.com/go-openapi/spec v0.20.11 // indirect github.com/go-openapi/strfmt v0.21.9 // indirect github.com/go-openapi/validate v0.22.3 // indirect + github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/go-viper/mapstructure/v2 v2.4.0 // indirect github.com/google/btree v1.1.3 // indirect github.com/google/gopacket v1.1.19 // indirect + github.com/google/pprof v0.0.0-20250630185457-6e76a2b096b5 // indirect github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/kr/pretty v0.3.1 // indirect @@ -174,10 +173,12 @@ require ( go.opentelemetry.io/otel/sdk v1.38.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.38.0 // indirect go.opentelemetry.io/otel/trace v1.38.0 // indirect + go.uber.org/automaxprocs v1.6.0 // indirect go.uber.org/dig v1.17.1 // indirect go.yaml.in/yaml/v2 v2.4.3 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect + golang.org/x/tools v0.37.0 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect sigs.k8s.io/randfill v1.0.0 // indirect sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect @@ -193,11 +194,6 @@ require ( k8s.io/kubelet v0.34.1 ) -replace ( - github.com/onsi/ginkgo => github.com/onsi/ginkgo v1.12.0 - github.com/onsi/gomega => github.com/onsi/gomega v1.10.0 -) - retract ( v1.16.17 // contains only retractions, new version to retract 1.15.22. v1.16.16 // contains only retractions, has to be newer than 1.16.15. diff --git a/go.sum b/go.sum index dbcced8ba9..c1ac6b2891 100644 --- a/go.sum +++ b/go.sum @@ -114,6 +114,7 @@ github.com/evanphx/json-patch/v5 v5.9.11/go.mod h1:3j+LviiESTElxA4p3EMKAB9HXj3/X github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= @@ -160,6 +161,7 @@ github.com/go-openapi/validate v0.22.3 h1:KxG9mu5HBRYbecRb37KRCihvGGtND2aXziBAv0 github.com/go-openapi/validate v0.22.3/go.mod h1:kVxh31KbfsxU8ZyoHaDbLBWU5CnMdqBUEtadQ2G4d5M= github.com/go-quicktest/qt v1.101.1-0.20240301121107-c6c8733fa1e6 h1:teYtXy9B7y5lHTp8V9KPxpYRAVA7dozigQcMiBust1s= github.com/go-quicktest/qt v1.101.1-0.20240301121107-c6c8733fa1e6/go.mod h1:p4lGIVX+8Wa6ZPNDvqcxq36XpUDLh42FLetFU7odllI= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs= @@ -186,6 +188,7 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= @@ -224,7 +227,6 @@ github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKe github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= -github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= @@ -297,16 +299,24 @@ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRW github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU= -github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.23.4 h1:ktYTpKJAVZnDT4VjxSbiBenUjmlL/5QkBEocaWXiQus= github.com/onsi/ginkgo/v2 v2.23.4/go.mod h1:Bt66ApGPBFzHyR+JO10Zbt0Gsp4uWxu5mIOTusL46e8= -github.com/onsi/gomega v1.10.0 h1:Gwkk+PTu/nfOwNMtUB/mRUv0X7ewW5dO4AERT1ThVKo= -github.com/onsi/gomega v1.10.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= +github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.37.0 h1:CdEG8g0S133B4OswTDC/5XPSzE1OeP29QOioj2PID2Y= +github.com/onsi/gomega v1.37.0/go.mod h1:8D9+Txp43QWKhM24yyOBEdpkzN8FvJyAwecBgsU4KU0= github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b h1:FfH+VrHHk6Lxt9HdVS0PXzSXFyS2NbZKXv33FYPol0A= github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b/go.mod h1:AC62GU6hc0BrNm+9RK9VSiwa/EUe1bkIeFORAMcHvJU= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= @@ -325,6 +335,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= +github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o= github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -367,6 +379,7 @@ github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpE github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -465,6 +478,7 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -489,11 +503,15 @@ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -532,6 +550,7 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= @@ -541,8 +560,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= @@ -582,7 +599,6 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= @@ -590,8 +606,10 @@ gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/test/integration/swiftv2/helpers/az_helpers.go b/test/integration/swiftv2/helpers/az_helpers.go new file mode 100644 index 0000000000..817b6bcd40 --- /dev/null +++ b/test/integration/swiftv2/helpers/az_helpers.go @@ -0,0 +1,53 @@ +package helpers + +import ( + "fmt" + "os/exec" + "strings" +) + +func runAzCommand(cmd string, args ...string) string { + out, err := exec.Command(cmd, args...).CombinedOutput() + if err != nil { + panic(fmt.Sprintf("Failed to run %s %v: %s", cmd, args, string(out))) + } + return strings.TrimSpace(string(out)) +} + +func GetVnetGUID(rg, vnet string) string { + return runAzCommand("az", "network", "vnet", "show", "--resource-group", rg, "--name", vnet, "--query", "id", "-o", "tsv") +} + +func GetSubnetARMID(rg, vnet, subnet string) string { + return runAzCommand("az", "network", "vnet", "subnet", "show", "--resource-group", rg, "--vnet-name", vnet, "--name", subnet, "--query", "id", "-o", "tsv") +} + +func GetSubnetGUID(rg, vnet, subnet string) string { + subnetID := GetSubnetARMID(rg, vnet, subnet) + return runAzCommand("az", "resource", "show", "--ids", subnetID, "--api-version", "2023-09-01", "--query", "properties.serviceAssociationLinks[0].properties.subnetId", "-o", "tsv") +} + +func GetSubnetToken(rg, vnet, subnet string) string { + // Optionally implement if you use subnet token override + return "" +} + +// GetClusterNodes returns a slice of node names from a cluster using the given kubeconfig +func GetClusterNodes(kubeconfig string) []string { + cmd := exec.Command("kubectl", "--kubeconfig", kubeconfig, "get", "nodes", "-o", "name") + out, err := cmd.CombinedOutput() + if err != nil { + panic(fmt.Sprintf("Failed to get nodes using kubeconfig %s: %s\n%s", kubeconfig, err, string(out))) + } + + lines := strings.Split(strings.TrimSpace(string(out)), "\n") + nodes := make([]string, 0, len(lines)) + + for _, line := range lines { + // kubectl returns "node/", we strip the prefix + if strings.HasPrefix(line, "node/") { + nodes = append(nodes, strings.TrimPrefix(line, "node/")) + } + } + return nodes +} diff --git a/test/integration/swiftv2/long_running_cluster/datapath-test.go b/test/integration/swiftv2/long_running_cluster/datapath-test.go new file mode 100644 index 0000000000..72f4eb878f --- /dev/null +++ b/test/integration/swiftv2/long_running_cluster/datapath-test.go @@ -0,0 +1,78 @@ +package long_running_cluster + +import ( + "fmt" + "os" + "testing" + + "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + + "github.com/Azure/azure-container-networking/test/integration/swiftv2/helpers" +) + +func TestDatapath(t *testing.T) { + RegisterFailHandler(ginkgo.Fail) + ginkgo.RunSpecs(t, "Datapath Suite") +} + +var _ = ginkgo.Describe("Datapath Tests", func() { + RG := os.Getenv("RG") + BUILD_ID := os.Getenv("BUILD_ID") + + if RG == "" || BUILD_ID == "" { + ginkgo.Fail(fmt.Sprintf("Missing required environment variables: RG='%s', BUILD_ID='%s'", RG, BUILD_ID)) + } + CLUSTER2 := "aks-2" + KUBECONFIG2 := fmt.Sprintf("/tmp/%s.kubeconfig", CLUSTER2) + PN_NAME := fmt.Sprintf("pn-%s-c2", BUILD_ID) + PNI_NAME := fmt.Sprintf("pni-%s-c2", BUILD_ID) + + ginkgo.It("creates PodNetwork", func() { + vnetName := "cx_vnet_b1" + subnetName := "s1" + + vnetGUID := helpers.GetVnetGUID(RG, vnetName) + subnetGUID := helpers.GetSubnetGUID(RG, vnetName, subnetName) + subnetARMID := helpers.GetSubnetARMID(RG, vnetName, subnetName) + subnetToken := helpers.GetSubnetToken(RG, vnetName, subnetName) + + err := CreatePodNetwork(KUBECONFIG2, PodNetworkData{ + PNName: PN_NAME, + VnetGUID: vnetGUID, + SubnetGUID: subnetGUID, + SubnetARMID: subnetARMID, + SubnetToken: subnetToken, + }, "../../manifests/swiftv2/long-running-cluster/podnetwork.yaml") + Expect(err).To(BeNil()) + }) + + ginkgo.It("creates PodNetworkInstance", func() { + err := CreatePodNetworkInstance(KUBECONFIG2, PNIData{ + PNIName: PNI_NAME, + PNName: PN_NAME, + Namespace: PN_NAME, // namespace same as PN + Type: "explicit", + Reservations: 2, + }, "../../manifests/swiftv2/long-running-cluster/podnetworkinstance.yaml") + Expect(err).To(BeNil()) + }) + + ginkgo.It("creates pods on each node", func() { + nodes := helpers.GetClusterNodes(KUBECONFIG2) + Expect(len(nodes)).To(BeNumerically(">", 0)) + + for i, node := range nodes[:2] { + podName := fmt.Sprintf("pod-c2-%d", i) + err := CreatePod(KUBECONFIG2, PodData{ + PodName: podName, + NodeName: node, + OS: "linux", + PNName: PN_NAME, + PNIName: PNI_NAME, + Image: "weibeld/ubuntu-networking", + }, "../../manifests/swiftv2/long-running-cluster/pod.yaml") + Expect(err).To(BeNil()) + } + }) +}) diff --git a/test/integration/swiftv2/long_running_cluster/datapath.go b/test/integration/swiftv2/long_running_cluster/datapath.go new file mode 100644 index 0000000000..58359dcc4e --- /dev/null +++ b/test/integration/swiftv2/long_running_cluster/datapath.go @@ -0,0 +1,76 @@ +package long_running_cluster + +import ( + "bytes" + "fmt" + "os/exec" + "text/template" +) + +func applyTemplate(templatePath string, data interface{}, kubeconfig string) error { + tmpl, err := template.ParseFiles(templatePath) + if err != nil { + return err + } + + var buf bytes.Buffer + if err := tmpl.Execute(&buf, data); err != nil { + return err + } + + cmd := exec.Command("kubectl", "--kubeconfig", kubeconfig, "apply", "-f", "-") + cmd.Stdin = &buf + out, err := cmd.CombinedOutput() + if err != nil { + return fmt.Errorf("kubectl apply failed: %s\n%s", err, string(out)) + } + + fmt.Println(string(out)) + return nil +} + +// ------------------------- +// PodNetwork +// ------------------------- +type PodNetworkData struct { + PNName string + VnetGUID string + SubnetGUID string + SubnetARMID string + SubnetToken string +} + +func CreatePodNetwork(kubeconfig string, data PodNetworkData, templatePath string) error { + return applyTemplate(templatePath, data, kubeconfig) +} + +// ------------------------- +// PodNetworkInstance +// ------------------------- +type PNIData struct { + PNIName string + PNName string + Namespace string + Type string + Reservations int +} + +func CreatePodNetworkInstance(kubeconfig string, data PNIData, templatePath string) error { + return applyTemplate(templatePath, data, kubeconfig) +} + +// ------------------------- +// Pod +// ------------------------- +type PodData struct { + PodName string + NodeName string + OS string + PNName string + PNIName string + Image string +} + +func CreatePod(kubeconfig string, data PodData, templatePath string) error { + return applyTemplate(templatePath, data, kubeconfig) +} From 2c6d4de933c80034d8991509bc2971fdb7c8813b Mon Sep 17 00:00:00 2001 From: sivakami Date: Sun, 9 Nov 2025 22:07:45 -0800 Subject: [PATCH 02/19] Stage 2 for long running cluster test pipeline. --- .../scripts/create_aks.sh | 21 +++-- .../scripts/create_vnets.sh | 89 +++++++++---------- .../long-running-pipeline-template.yaml | 32 +++++++ hack/aks/Makefile | 32 +++++-- 4 files changed, 113 insertions(+), 61 deletions(-) diff --git a/.pipelines/swiftv2-long-running/scripts/create_aks.sh b/.pipelines/swiftv2-long-running/scripts/create_aks.sh index 4ab38c0f42..b458b3f0b9 100644 --- a/.pipelines/swiftv2-long-running/scripts/create_aks.sh +++ b/.pipelines/swiftv2-long-running/scripts/create_aks.sh @@ -8,9 +8,7 @@ VM_SKU_DEFAULT=$4 VM_SKU_HIGHNIC=$5 CLUSTER_COUNT=2 -CLUSTER_PREFIX="aks" -DEFAULT_NODE_COUNT=1 -COMMON_TAGS="fastpathenabled=true RGOwner=LongRunningTestPipelines stampcreatorserviceinfo=true" +CLUSTER_PREFIX="aks" wait_for_provisioning() { # Helper for safe retry/wait for provisioning states (basic) local rg="$1" clusterName="$2" @@ -44,9 +42,7 @@ for i in $(seq 1 "$CLUSTER_COUNT"); do AZCLI=az REGION=$LOCATION \ SUB=$SUBSCRIPTION_ID \ GROUP=$RG \ - CLUSTER=$CLUSTER_NAME \ - NODE_COUNT=$DEFAULT_NODE_COUNT \ - VM_SIZE=$VM_SKU_DEFAULT \ + CLUSTER=$CLUSTER_NAME echo " - waiting for AKS provisioning state..." wait_for_provisioning "$RG" "$CLUSTER_NAME" @@ -57,7 +53,18 @@ for i in $(seq 1 "$CLUSTER_COUNT"); do GROUP=$RG \ VM_SIZE=$VM_SKU_HIGHNIC \ CLUSTER=$CLUSTER_NAME \ - SUB=$SUBSCRIPTION_ID \ + SUB=$SUBSCRIPTION_ID + + KUBECONFIG_PATH="/tmp/${CLUSTER_NAME}.kubeconfig" + echo "Exporting admin kubeconfig for '$CLUSTER_NAME' to ${KUBECONFIG_PATH}..." + + az aks get-credentials \ + --resource-group "$RG" \ + --name "$CLUSTER_NAME" \ + --overwrite-existing \ + --admin \ + --file "$KUBECONFIG_PATH" + echo "Kubeconfig saved: ${KUBECONFIG_PATH}" done echo "All done. Created $CLUSTER_COUNT cluster set(s)." diff --git a/.pipelines/swiftv2-long-running/scripts/create_vnets.sh b/.pipelines/swiftv2-long-running/scripts/create_vnets.sh index eb894d06ff..33e9eb0513 100644 --- a/.pipelines/swiftv2-long-running/scripts/create_vnets.sh +++ b/.pipelines/swiftv2-long-running/scripts/create_vnets.sh @@ -2,27 +2,22 @@ set -e trap 'echo "[ERROR] Failed while creating VNets or subnets. Check Azure CLI logs above." >&2' ERR -SUBSCRIPTION_ID=$1 +SUB_ID=$1 LOCATION=$2 RG=$3 +BUILD_ID=$4 -az account set --subscription "$SUBSCRIPTION_ID" - -# VNets and subnets -VNET_A1="cx_vnet_a1" -VNET_A2="cx_vnet_a2" -VNET_A3="cx_vnet_a3" -VNET_B1="cx_vnet_b1" - -A1_S1="10.10.1.0/24" -A1_S2="10.10.2.0/24" -A1_PE="10.10.100.0/24" - -A2_MAIN="10.11.1.0/24" - -A3_MAIN="10.12.1.0/24" - -B1_MAIN="10.20.1.0/24" +# --- VNet definitions --- +# Create customer vnets for two customers A and B. +VNAMES=( "cx_vnet_a1" "cx_vnet_a2" "cx_vnet_a3" "cx_vnet_b1" ) +VCIDRS=( "10.10.0.0/16" "10.11.0.0/16" "10.12.0.0/16" "10.13.0.0/16" ) +NODE_SUBNETS=( "10.10.0.0/24" "10.11.0.0/24" "10.12.0.0/24" "10.13.0.0/24" ) +EXTRA_SUBNETS_LIST=( "s1 s2 pe" "s1" "s1" "s1" ) +EXTRA_CIDRS_LIST=( "10.10.1.0/24,10.10.2.0/24,10.10.3.0/24" \ + "10.11.1.0/24" \ + "10.12.1.0/24" \ + "10.13.1.0/24" ) +az account set --subscription "$SUB_ID" # ------------------------------- # Verification functions @@ -49,36 +44,36 @@ verify_subnet() { fi } -# ------------------------------- -# Create VNets and Subnets -# ------------------------------- -# A1 -az network vnet create -g "$RG" -n "$VNET_A1" --address-prefix 10.10.0.0/16 --subnet-name s1 --subnet-prefix "$A1_S1" -l "$LOCATION" --output none \ - && echo "Created $VNET_A1 with subnet s1" -az network vnet subnet create -g "$RG" --vnet-name "$VNET_A1" -n s2 --address-prefix "$A1_S2" --output none \ - && echo "Created $VNET_A1 with subnet s2" -az network vnet subnet create -g "$RG" --vnet-name "$VNET_A1" -n pe --address-prefix "$A1_PE" --output none \ - && echo "Created $VNET_A1 with subnet pe" -# Verify A1 -verify_vnet "$RG" "$VNET_A1" -for sn in s1 s2 pe; do verify_subnet "$RG" "$VNET_A1" "$sn"; done +# --- Loop over VNets --- +for i in "${!VNAMES[@]}"; do + VNET=${VNAMES[$i]} + VNET_CIDR=${VCIDRS[$i]} + NODE_SUBNET_CIDR=${NODE_SUBNETS[$i]} + EXTRA_SUBNETS=${EXTRA_SUBNETS_LIST[$i]} + EXTRA_SUBNET_CIDRS=${EXTRA_CIDRS_LIST[$i]} -# A2 -az network vnet create -g "$RG" -n "$VNET_A2" --address-prefix 10.11.0.0/16 --subnet-name s1 --subnet-prefix "$A2_MAIN" -l "$LOCATION" --output none \ - && echo "Created $VNET_A2 with subnet s1" -verify_vnet "$RG" "$VNET_A2" -verify_subnet "$RG" "$VNET_A2" "s1" + # Create VNet + subnets + make -C ./hack/aks swift-delegated-subnet-up \ + AZCLI=az REGION=$LOCATION GROUP=$RG VNET=$VNET \ + VNET_CIDR=$VNET_CIDR NODE_SUBNET_CIDR=$NODE_SUBNET_CIDR \ + EXTRA_SUBNETS="$EXTRA_SUBNETS" EXTRA_SUBNET_CIDRS="$EXTRA_SUBNET_CIDRS" \ + && echo "Created $VNET with subnets $EXTRA_SUBNETS" -# A3 -az network vnet create -g "$RG" -n "$VNET_A3" --address-prefix 10.12.0.0/16 --subnet-name s1 --subnet-prefix "$A3_MAIN" -l "$LOCATION" --output none \ - && echo "Created $VNET_A3 with subnet s1" -verify_vnet "$RG" "$VNET_A3" -verify_subnet "$RG" "$VNET_A3" "s1" + verify_vnet "$RG" "$VNET" # Verify VNet -# B1 -az network vnet create -g "$RG" -n "$VNET_B1" --address-prefix 10.20.0.0/16 --subnet-name s1 --subnet-prefix "$B1_MAIN" -l "$LOCATION" --output none \ - && echo "Created $VNET_B1 with subnet s1" -verify_vnet "$RG" "$VNET_B1" -verify_subnet "$RG" "$VNET_B1" "s1" + # Loop over extra subnets to verify and create dummy clusters to delegate the pod subnets. + for PODSUBNET in $EXTRA_SUBNETS; do + verify_subnet "$RG" "$VNET" "$PODSUBNET" + if [[ "$PODSUBNET" == "pe" ]]; then + # Skip creating dummy cluster for private endpoint subnet. + continue + fi + cluster_name="${BUILD_ID}-${VNET}-${PODSUBNET}" + make -C ./hack/aks swiftv2-dummy-cluster-subnet-delegator-up \ + AZCLI=az CLUSTER=$cluster_name GROUP=$RG REGION=$LOCATION \ + SUB=$SUB_ID VNET=$VNET POD_SUBNET=$PODSUBNET \ + && echo "Created dummy cluster for $VNET subnet $PODSUBNET" + done +done -echo " All VNets and subnets created and verified successfully." +echo "All VNets and subnets created and verified successfully." \ No newline at end of file diff --git a/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml b/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml index cc6016f17a..7b65622623 100644 --- a/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml +++ b/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml @@ -67,6 +67,7 @@ stages: # Job 3: Networking & Storage # ------------------------------------------------------------ - job: NetworkingAndStorage + timeoutInMinutes: 0 displayName: "Networking and Storage Setup" dependsOn: CreateResourceGroup pool: @@ -86,6 +87,7 @@ stages: ${{ parameters.subscriptionId }} ${{ parameters.location }} ${{ parameters.resourceGroupName }} + $(Build.BuildId) # Task 2: Create Peerings - task: AzureCLI@2 @@ -138,3 +140,33 @@ stages: ${{ parameters.location }} ${{ parameters.resourceGroupName }} $(CreateStorageAccounts.StorageAccount1) + # ================================================================= + # Stage 2: Datapath Tests + # ================================================================= + - stage: DataPathTests + displayName: "Stage: Swiftv2 Data Path Tests" + dependsOn: AKSClusterAndNetworking + condition: succeeded() + jobs: + - job: RunDataPathTests + displayName: "Run PodNetwork and Data Path Tests" + timeoutInMinutes: 0 # Run indefinitely + pool: + vmImage: ubuntu-latest + steps: + - checkout: self + + - task: GoTool@0 + displayName: "Use Go 1.22.5" + inputs: + version: "1.22.5" + + - script: | + echo "==> Installing Ginkgo CLI" + go install github.com/onsi/ginkgo/v2/ginkgo@latest + + echo "==> Running datapath tests" + export RG=${{ parameters.resourceGroupName }} + export BUILD_ID=$(Build.BuildId) + ginkgo -v -trace -fail-fast ./test/integration/swiftv2/long_running_cluster + displayName: "Run Ginkgo Datapath Suite" \ No newline at end of file diff --git a/hack/aks/Makefile b/hack/aks/Makefile index 5e1c8f3f9b..fbb9b1201a 100644 --- a/hack/aks/Makefile +++ b/hack/aks/Makefile @@ -122,6 +122,16 @@ rg-up: ## Create resource group rg-down: ## Delete resource group $(AZCLI) group delete -g $(GROUP) --yes +swift-delegated-subnet-up: ## Create VNet, node subnet, and optional extra subnets + $(AZCLI) network vnet create -g $(GROUP) -l $(REGION) --name $(VNET) --address-prefixes $(VNET_CIDR) -o none + $(AZCLI) network vnet subnet create -g $(GROUP) --vnet-name $(VNET) --name nodenet --address-prefixes $(NODE_SUBNET_CIDR) -o none + @i=1; \ + for subnet in $(EXTRA_SUBNETS); do \ + prefix=$$(echo $(EXTRA_SUBNET_CIDRS) | cut -d',' -f$$i); \ + $(AZCLI) network vnet subnet create -g $(GROUP) --vnet-name $(VNET) --name $$subnet --address-prefixes $$prefix -o none; \ + i=$$((i+1)); \ + done + swift-net-up: ## Create vnet, nodenet and podnet subnets $(AZCLI) network vnet create -g $(GROUP) -l $(REGION) --name $(VNET) --address-prefixes 10.0.0.0/8 -o none $(AZCLI) network vnet subnet create -g $(GROUP) --vnet-name $(VNET) --name nodenet --address-prefixes 10.240.0.0/16 -o none @@ -285,17 +295,25 @@ swiftv2-dummy-cluster-up: rg-up ipv4 swift-net-up ## Bring up a SWIFT AzCNI clus --yes @$(MAKE) set-kubeconf -swiftv2-podsubnet-cluster-up: ipv4 swift-net-up ## Bring up a SWIFTv2 PodSubnet cluster - $(COMMON_AKS_FIELDS) +swiftv2-dummy-cluster-subnet-delegator-up: ipv4 ## Bring up a SWIFT AzCNI cluster for delegating subnet. + $(AZCLI) aks create -n $(CLUSTER) -g $(GROUP) -l $(REGION) \ --network-plugin azure \ - --nodepool-name nodepool1 \ + --vnet-subnet-id /subscriptions/$(SUB)/resourceGroups/$(GROUP)/providers/Microsoft.Network/virtualNetworks/$(VNET)/subnets/nodenet \ + --pod-subnet-id /subscriptions/$(SUB)/resourceGroups/$(GROUP)/providers/Microsoft.Network/virtualNetworks/$(VNET)/subnets/$(POD_SUBNET) \ --load-balancer-outbound-ips $(PUBLIC_IPv4) \ + --no-ssh-key \ + --yes + @$(MAKE) set-kubeconf + +swiftv2-podsubnet-cluster-up: ipv4 swift-net-up ## Bring up a SWIFTv2 PodSubnet cluster + $(COMMON_AKS_FIELDS) \ + --network-plugin azure \ --vnet-subnet-id /subscriptions/$(SUB)/resourceGroups/$(GROUP)/providers/Microsoft.Network/virtualNetworks/$(VNET)/subnets/nodenet \ --pod-subnet-id /subscriptions/$(SUB)/resourceGroups/$(GROUP)/providers/Microsoft.Network/virtualNetworks/$(VNET)/subnets/podnet \ - --service-cidr "10.0.0.0/16" \ - --dns-service-ip "10.0.0.10" \ - --tags fastpathenabled=true RGOwner=LongRunningTestPipelines stampcreatorserviceinfo=true \ + --nodepool-tags fastpathenabled=true aks-nic-enable-multi-tenancy=true \ + --tags stampcreatorserviceinfo=true \ --aks-custom-headers AKSHTTPCustomFeatures=Microsoft.ContainerService/NetworkingMultiTenancyPreview \ + --load-balancer-outbound-ips $(PUBLIC_IPv4) \ --yes @$(MAKE) set-kubeconf @@ -446,7 +464,7 @@ linux-swiftv2-nodepool-up: ## Add linux node pool to swiftv2 cluster --os-type Linux \ --max-pods 250 \ --subscription $(SUB) \ - --tags fastpathenabled=true,aks-nic-enable-multi-tenancy=true \ + --tags fastpathenabled=true aks-nic-enable-multi-tenancy=true \ --aks-custom-headers AKSHTTPCustomFeatures=Microsoft.ContainerService/NetworkingMultiTenancyPreview \ --pod-subnet-id /subscriptions/$(SUB)/resourceGroups/$(GROUP)/providers/Microsoft.Network/virtualNetworks/$(VNET)/subnets/podnet From 4704bb21d28487e2eed3743305caefd2ca0af4fd Mon Sep 17 00:00:00 2001 From: sivakami Date: Sun, 9 Nov 2025 22:09:47 -0800 Subject: [PATCH 03/19] fix yaml alignment. --- .../long-running-pipeline-template.yaml | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml b/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml index 7b65622623..db27ce5850 100644 --- a/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml +++ b/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml @@ -144,29 +144,29 @@ stages: # Stage 2: Datapath Tests # ================================================================= - stage: DataPathTests - displayName: "Stage: Swiftv2 Data Path Tests" - dependsOn: AKSClusterAndNetworking - condition: succeeded() - jobs: - - job: RunDataPathTests - displayName: "Run PodNetwork and Data Path Tests" - timeoutInMinutes: 0 # Run indefinitely - pool: - vmImage: ubuntu-latest - steps: - - checkout: self + displayName: "Stage: Swiftv2 Data Path Tests" + dependsOn: AKSClusterAndNetworking + condition: succeeded() + jobs: + - job: RunDataPathTests + displayName: "Run PodNetwork and Data Path Tests" + timeoutInMinutes: 0 # Run indefinitely + pool: + vmImage: ubuntu-latest + steps: + - checkout: self - - task: GoTool@0 - displayName: "Use Go 1.22.5" - inputs: - version: "1.22.5" + - task: GoTool@0 + displayName: "Use Go 1.22.5" + inputs: + version: "1.22.5" - - script: | - echo "==> Installing Ginkgo CLI" - go install github.com/onsi/ginkgo/v2/ginkgo@latest - - echo "==> Running datapath tests" - export RG=${{ parameters.resourceGroupName }} - export BUILD_ID=$(Build.BuildId) - ginkgo -v -trace -fail-fast ./test/integration/swiftv2/long_running_cluster - displayName: "Run Ginkgo Datapath Suite" \ No newline at end of file + - script: | + echo "==> Installing Ginkgo CLI" + go install github.com/onsi/ginkgo/v2/ginkgo@latest + + echo "==> Running datapath tests" + export RG=${{ parameters.resourceGroupName }} + export BUILD_ID=$(Build.BuildId) + ginkgo -v -trace -fail-fast ./test/integration/swiftv2/long_running_cluster + displayName: "Run Ginkgo Datapath Suite" \ No newline at end of file From 6e168a79b4cee50f4de968f1d757daccefdfaa8d Mon Sep 17 00:00:00 2001 From: sivakami Date: Sun, 9 Nov 2025 23:43:02 -0800 Subject: [PATCH 04/19] Add templates for pod objects. --- .../swiftv2/long-running-cluster/pod.yaml | 33 +++++++++++++++++++ .../long-running-cluster/podnetwork.yaml | 15 +++++++++ .../podnetworkinstance.yaml | 12 +++++++ .../integration/swiftv2/helpers/az_helpers.go | 21 +++++++++++- .../long_running_cluster/datapath-test.go | 6 +++- 5 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 test/integration/manifests/swiftv2/long-running-cluster/pod.yaml create mode 100644 test/integration/manifests/swiftv2/long-running-cluster/podnetwork.yaml create mode 100644 test/integration/manifests/swiftv2/long-running-cluster/podnetworkinstance.yaml diff --git a/test/integration/manifests/swiftv2/long-running-cluster/pod.yaml b/test/integration/manifests/swiftv2/long-running-cluster/pod.yaml new file mode 100644 index 0000000000..98ef55041c --- /dev/null +++ b/test/integration/manifests/swiftv2/long-running-cluster/pod.yaml @@ -0,0 +1,33 @@ +apiVersion: v1 +kind: Pod +metadata: + name: {{ .PodName }} + namespace: default + labels: + kubernetes.azure.com/pod-network-instance: {{ .PNIName }} + kubernetes.azure.com/pod-network: {{ .PNName }} +spec: + nodeSelector: + kubernetes.io/hostname: {{ .NodeName }} + containers: + - name: net-debugger + image: {{ .Image }} + command: ["/bin/sh", "-c"] + args: + - | + echo "Pod Network Diagnostics started on $(hostname)"; + while true; do + ip addr show + ip route show + sleep 60 + done + resources: + limits: + cpu: 300m + memory: 600Mi + requests: + cpu: 300m + memory: 600Mi + securityContext: + privileged: true + restartPolicy: Always diff --git a/test/integration/manifests/swiftv2/long-running-cluster/podnetwork.yaml b/test/integration/manifests/swiftv2/long-running-cluster/podnetwork.yaml new file mode 100644 index 0000000000..25a7491d90 --- /dev/null +++ b/test/integration/manifests/swiftv2/long-running-cluster/podnetwork.yaml @@ -0,0 +1,15 @@ +apiVersion: multitenancy.acn.azure.com/v1alpha1 +kind: PodNetwork +metadata: + name: {{ .PNName }} +{{- if .SubnetToken }} + labels: + kubernetes.azure.com/override-subnet-token: "{{ .SubnetToken }}" +{{- end }} +spec: + networkID: "{{ .VnetGUID }}" +{{- if not .SubnetToken }} + subnetGUID: "{{ .SubnetGUID }}" +{{- end }} + subnetResourceID: "{{ .SubnetARMID }}" + deviceType: acn.azure.com/vnet-nic diff --git a/test/integration/manifests/swiftv2/long-running-cluster/podnetworkinstance.yaml b/test/integration/manifests/swiftv2/long-running-cluster/podnetworkinstance.yaml new file mode 100644 index 0000000000..0158e955c7 --- /dev/null +++ b/test/integration/manifests/swiftv2/long-running-cluster/podnetworkinstance.yaml @@ -0,0 +1,12 @@ +apiVersion: multitenancy.acn.azure.com/v1alpha1 +kind: PodNetworkInstance +metadata: + name: {{ .PNIName }} + namespace: {{ .Namespace }} +spec: + podNetwork: {{ .PNName }} +{{- if eq .Type "explicit" }} + podIPReservationSize: {{ .Reservations }} +{{- else }} + podIPReservationSize: 1 +{{- end }} diff --git a/test/integration/swiftv2/helpers/az_helpers.go b/test/integration/swiftv2/helpers/az_helpers.go index 817b6bcd40..5c151d9182 100644 --- a/test/integration/swiftv2/helpers/az_helpers.go +++ b/test/integration/swiftv2/helpers/az_helpers.go @@ -15,7 +15,7 @@ func runAzCommand(cmd string, args ...string) string { } func GetVnetGUID(rg, vnet string) string { - return runAzCommand("az", "network", "vnet", "show", "--resource-group", rg, "--name", vnet, "--query", "id", "-o", "tsv") + return runAzCommand("az", "network", "vnet", "show", "--resource-group", rg, "--name", vnet, "--query", "resourceGuid", "-o", "tsv") } func GetSubnetARMID(rg, vnet, subnet string) string { @@ -51,3 +51,22 @@ func GetClusterNodes(kubeconfig string) []string { } return nodes } + +// EnsureNamespaceExists checks if a namespace exists and creates it if it doesn't +func EnsureNamespaceExists(kubeconfig, namespace string) error { + cmd := exec.Command("kubectl", "--kubeconfig", kubeconfig, "get", "namespace", namespace) + err := cmd.Run() + + if err == nil { + return nil // Namespace exists + } + + // Namespace doesn't exist, create it + cmd = exec.Command("kubectl", "--kubeconfig", kubeconfig, "create", "namespace", namespace) + out, err := cmd.CombinedOutput() + if err != nil { + return fmt.Errorf("failed to create namespace %s: %s\n%s", namespace, err, string(out)) + } + + return nil +} diff --git a/test/integration/swiftv2/long_running_cluster/datapath-test.go b/test/integration/swiftv2/long_running_cluster/datapath-test.go index 72f4eb878f..854e493772 100644 --- a/test/integration/swiftv2/long_running_cluster/datapath-test.go +++ b/test/integration/swiftv2/long_running_cluster/datapath-test.go @@ -48,7 +48,11 @@ var _ = ginkgo.Describe("Datapath Tests", func() { }) ginkgo.It("creates PodNetworkInstance", func() { - err := CreatePodNetworkInstance(KUBECONFIG2, PNIData{ + // Create namespace if it doesn't exist + err := helpers.EnsureNamespaceExists(KUBECONFIG2, PN_NAME) + Expect(err).To(BeNil()) + + err = CreatePodNetworkInstance(KUBECONFIG2, PNIData{ PNIName: PNI_NAME, PNName: PN_NAME, Namespace: PN_NAME, // namespace same as PN From f55e035a20a36aa42aa852afd83760a5af5ecd38 Mon Sep 17 00:00:00 2001 From: sivakami Date: Mon, 10 Nov 2025 00:05:17 -0800 Subject: [PATCH 05/19] Create and delete pod object repeatedly. --- .../scripts/create_aks.sh | 3 +- hack/aks/Makefile | 1 + .../integration/swiftv2/helpers/az_helpers.go | 40 ++++++ .../long_running_cluster/datapath-test.go | 122 ++++++++++++------ 4 files changed, 127 insertions(+), 39 deletions(-) diff --git a/.pipelines/swiftv2-long-running/scripts/create_aks.sh b/.pipelines/swiftv2-long-running/scripts/create_aks.sh index b458b3f0b9..bb3472c080 100644 --- a/.pipelines/swiftv2-long-running/scripts/create_aks.sh +++ b/.pipelines/swiftv2-long-running/scripts/create_aks.sh @@ -42,7 +42,8 @@ for i in $(seq 1 "$CLUSTER_COUNT"); do AZCLI=az REGION=$LOCATION \ SUB=$SUBSCRIPTION_ID \ GROUP=$RG \ - CLUSTER=$CLUSTER_NAME + CLUSTER=$CLUSTER_NAME \ + VM_SIZE=$VM_SKU_DEFAULT echo " - waiting for AKS provisioning state..." wait_for_provisioning "$RG" "$CLUSTER_NAME" diff --git a/hack/aks/Makefile b/hack/aks/Makefile index fbb9b1201a..82a79029fe 100644 --- a/hack/aks/Makefile +++ b/hack/aks/Makefile @@ -308,6 +308,7 @@ swiftv2-dummy-cluster-subnet-delegator-up: ipv4 ## Bring up a SWIFT AzCNI clust swiftv2-podsubnet-cluster-up: ipv4 swift-net-up ## Bring up a SWIFTv2 PodSubnet cluster $(COMMON_AKS_FIELDS) \ --network-plugin azure \ + --node-vm-size $(VM_SIZE) \ --vnet-subnet-id /subscriptions/$(SUB)/resourceGroups/$(GROUP)/providers/Microsoft.Network/virtualNetworks/$(VNET)/subnets/nodenet \ --pod-subnet-id /subscriptions/$(SUB)/resourceGroups/$(GROUP)/providers/Microsoft.Network/virtualNetworks/$(VNET)/subnets/podnet \ --nodepool-tags fastpathenabled=true aks-nic-enable-multi-tenancy=true \ diff --git a/test/integration/swiftv2/helpers/az_helpers.go b/test/integration/swiftv2/helpers/az_helpers.go index 5c151d9182..07a0b0f9db 100644 --- a/test/integration/swiftv2/helpers/az_helpers.go +++ b/test/integration/swiftv2/helpers/az_helpers.go @@ -70,3 +70,43 @@ func EnsureNamespaceExists(kubeconfig, namespace string) error { return nil } + +// DeletePod deletes a pod in the specified namespace +func DeletePod(kubeconfig, namespace, podName string) error { + cmd := exec.Command("kubectl", "--kubeconfig", kubeconfig, "delete", "pod", podName, "-n", namespace, "--ignore-not-found=true") + out, err := cmd.CombinedOutput() + if err != nil { + return fmt.Errorf("failed to delete pod %s in namespace %s: %s\n%s", podName, namespace, err, string(out)) + } + return nil +} + +// DeletePodNetworkInstance deletes a PodNetworkInstance +func DeletePodNetworkInstance(kubeconfig, namespace, pniName string) error { + cmd := exec.Command("kubectl", "--kubeconfig", kubeconfig, "delete", "podnetworkinstance", pniName, "-n", namespace, "--ignore-not-found=true") + out, err := cmd.CombinedOutput() + if err != nil { + return fmt.Errorf("failed to delete PodNetworkInstance %s: %s\n%s", pniName, err, string(out)) + } + return nil +} + +// DeletePodNetwork deletes a PodNetwork +func DeletePodNetwork(kubeconfig, pnName string) error { + cmd := exec.Command("kubectl", "--kubeconfig", kubeconfig, "delete", "podnetwork", pnName, "--ignore-not-found=true") + out, err := cmd.CombinedOutput() + if err != nil { + return fmt.Errorf("failed to delete PodNetwork %s: %s\n%s", pnName, err, string(out)) + } + return nil +} + +// DeleteNamespace deletes a namespace +func DeleteNamespace(kubeconfig, namespace string) error { + cmd := exec.Command("kubectl", "--kubeconfig", kubeconfig, "delete", "namespace", namespace, "--ignore-not-found=true") + out, err := cmd.CombinedOutput() + if err != nil { + return fmt.Errorf("failed to delete namespace %s: %s\n%s", namespace, err, string(out)) + } + return nil +} diff --git a/test/integration/swiftv2/long_running_cluster/datapath-test.go b/test/integration/swiftv2/long_running_cluster/datapath-test.go index 854e493772..61d351bf22 100644 --- a/test/integration/swiftv2/long_running_cluster/datapath-test.go +++ b/test/integration/swiftv2/long_running_cluster/datapath-test.go @@ -4,6 +4,7 @@ import ( "fmt" "os" "testing" + "time" "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -23,60 +24,105 @@ var _ = ginkgo.Describe("Datapath Tests", func() { if RG == "" || BUILD_ID == "" { ginkgo.Fail(fmt.Sprintf("Missing required environment variables: RG='%s', BUILD_ID='%s'", RG, BUILD_ID)) } + CLUSTER2 := "aks-2" KUBECONFIG2 := fmt.Sprintf("/tmp/%s.kubeconfig", CLUSTER2) PN_NAME := fmt.Sprintf("pn-%s-c2", BUILD_ID) PNI_NAME := fmt.Sprintf("pni-%s-c2", BUILD_ID) - ginkgo.It("creates PodNetwork", func() { + ginkgo.It("creates and deletes PodNetwork, PodNetworkInstance, and Pods in a loop", func() { vnetName := "cx_vnet_b1" subnetName := "s1" + // Get subnet information once (doesn't change between iterations) vnetGUID := helpers.GetVnetGUID(RG, vnetName) subnetGUID := helpers.GetSubnetGUID(RG, vnetName, subnetName) subnetARMID := helpers.GetSubnetARMID(RG, vnetName, subnetName) subnetToken := helpers.GetSubnetToken(RG, vnetName, subnetName) - err := CreatePodNetwork(KUBECONFIG2, PodNetworkData{ - PNName: PN_NAME, - VnetGUID: vnetGUID, - SubnetGUID: subnetGUID, - SubnetARMID: subnetARMID, - SubnetToken: subnetToken, - }, "../../manifests/swiftv2/long-running-cluster/podnetwork.yaml") - Expect(err).To(BeNil()) - }) + // Run indefinitely until test is cancelled + iteration := 0 + for { + iteration++ + ginkgo.By(fmt.Sprintf("Starting iteration %d at %s", iteration, time.Now().Format(time.RFC3339))) - ginkgo.It("creates PodNetworkInstance", func() { - // Create namespace if it doesn't exist - err := helpers.EnsureNamespaceExists(KUBECONFIG2, PN_NAME) - Expect(err).To(BeNil()) - - err = CreatePodNetworkInstance(KUBECONFIG2, PNIData{ - PNIName: PNI_NAME, - PNName: PN_NAME, - Namespace: PN_NAME, // namespace same as PN - Type: "explicit", - Reservations: 2, - }, "../../manifests/swiftv2/long-running-cluster/podnetworkinstance.yaml") - Expect(err).To(BeNil()) - }) + // Step 1: Create PodNetwork + ginkgo.By(fmt.Sprintf("Creating PodNetwork %s", PN_NAME)) + err := CreatePodNetwork(KUBECONFIG2, PodNetworkData{ + PNName: PN_NAME, + VnetGUID: vnetGUID, + SubnetGUID: subnetGUID, + SubnetARMID: subnetARMID, + SubnetToken: subnetToken, + }, "../../manifests/swiftv2/long-running-cluster/podnetwork.yaml") + Expect(err).To(BeNil()) + + // Step 2: Create namespace and PodNetworkInstance + ginkgo.By(fmt.Sprintf("Creating namespace %s", PN_NAME)) + err = helpers.EnsureNamespaceExists(KUBECONFIG2, PN_NAME) + Expect(err).To(BeNil()) - ginkgo.It("creates pods on each node", func() { - nodes := helpers.GetClusterNodes(KUBECONFIG2) - Expect(len(nodes)).To(BeNumerically(">", 0)) - - for i, node := range nodes[:2] { - podName := fmt.Sprintf("pod-c2-%d", i) - err := CreatePod(KUBECONFIG2, PodData{ - PodName: podName, - NodeName: node, - OS: "linux", - PNName: PN_NAME, - PNIName: PNI_NAME, - Image: "weibeld/ubuntu-networking", - }, "../../manifests/swiftv2/long-running-cluster/pod.yaml") + ginkgo.By(fmt.Sprintf("Creating PodNetworkInstance %s", PNI_NAME)) + err = CreatePodNetworkInstance(KUBECONFIG2, PNIData{ + PNIName: PNI_NAME, + PNName: PN_NAME, + Namespace: PN_NAME, + Type: "explicit", + Reservations: 2, + }, "../../manifests/swiftv2/long-running-cluster/podnetworkinstance.yaml") Expect(err).To(BeNil()) + + // Step 3: Create pods on first two nodes + ginkgo.By("Getting cluster nodes") + nodes := helpers.GetClusterNodes(KUBECONFIG2) + Expect(len(nodes)).To(BeNumerically(">=", 2), "Need at least 2 nodes") + + podNames := []string{} + for i, node := range nodes[:2] { + podName := fmt.Sprintf("pod-c2-%d", i) + podNames = append(podNames, podName) + + ginkgo.By(fmt.Sprintf("Creating pod %s on node %s", podName, node)) + err := CreatePod(KUBECONFIG2, PodData{ + PodName: podName, + NodeName: node, + OS: "linux", + PNName: PN_NAME, + PNIName: PNI_NAME, + Image: "weibeld/ubuntu-networking", + }, "../../manifests/swiftv2/long-running-cluster/pod.yaml") + Expect(err).To(BeNil()) + } + + // Step 4: Wait for 5 minutes + ginkgo.By("Waiting for 5 minutes before deletion") + time.Sleep(5 * time.Minute) + + // Step 5: Delete resources in reverse order + ginkgo.By("Deleting pods") + for _, podName := range podNames { + ginkgo.By(fmt.Sprintf("Deleting pod %s", podName)) + err := helpers.DeletePod(KUBECONFIG2, PN_NAME, podName) + Expect(err).To(BeNil()) + } + + ginkgo.By(fmt.Sprintf("Deleting PodNetworkInstance %s", PNI_NAME)) + err = helpers.DeletePodNetworkInstance(KUBECONFIG2, PN_NAME, PNI_NAME) + Expect(err).To(BeNil()) + + ginkgo.By(fmt.Sprintf("Deleting PodNetwork %s", PN_NAME)) + err = helpers.DeletePodNetwork(KUBECONFIG2, PN_NAME) + Expect(err).To(BeNil()) + + ginkgo.By(fmt.Sprintf("Deleting namespace %s", PN_NAME)) + err = helpers.DeleteNamespace(KUBECONFIG2, PN_NAME) + Expect(err).To(BeNil()) + + ginkgo.By(fmt.Sprintf("Completed iteration %d at %s", iteration, time.Now().Format(time.RFC3339))) + + // Step 6: Wait for 30 minutes before next iteration + ginkgo.By("Waiting for 30 minutes before next iteration") + time.Sleep(30 * time.Minute) } }) }) From 5b173579c4e9074bc82a1d88a793013deec98345 Mon Sep 17 00:00:00 2001 From: sivakami Date: Mon, 10 Nov 2025 00:25:10 -0800 Subject: [PATCH 06/19] set default vm sku --- .pipelines/swiftv2-long-running/pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/swiftv2-long-running/pipeline.yaml b/.pipelines/swiftv2-long-running/pipeline.yaml index b6d085901d..6b9f2f6ed9 100644 --- a/.pipelines/swiftv2-long-running/pipeline.yaml +++ b/.pipelines/swiftv2-long-running/pipeline.yaml @@ -19,7 +19,7 @@ parameters: - name: vmSkuDefault displayName: "VM SKU for Default Node Pool" type: string - default: "Standard_D2s_v3" + default: "Standard_D4s_v3" - name: vmSkuHighNIC displayName: "VM SKU for High NIC Node Pool" From d76a51011c63c0904838eecf9e6162f7b4848e20 Mon Sep 17 00:00:00 2001 From: sivakami Date: Mon, 10 Nov 2025 00:29:19 -0800 Subject: [PATCH 07/19] test change. --- .../template/long-running-pipeline-template.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml b/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml index db27ce5850..ccfb8e0422 100644 --- a/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml +++ b/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml @@ -165,6 +165,9 @@ stages: echo "==> Installing Ginkgo CLI" go install github.com/onsi/ginkgo/v2/ginkgo@latest + echo "==> Adding Go bin to PATH" + export PATH=$PATH:$(go env GOPATH)/bin + echo "==> Running datapath tests" export RG=${{ parameters.resourceGroupName }} export BUILD_ID=$(Build.BuildId) From 3e1e1a17743b0139faa98fb5298009072eb34e59 Mon Sep 17 00:00:00 2001 From: sivakami Date: Mon, 10 Nov 2025 06:30:43 -0800 Subject: [PATCH 08/19] renamed sv2 datapath test file. --- .../template/long-running-pipeline-template.yaml | 2 +- .../long_running_cluster/{datapath-test.go => datapath_test.go} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename test/integration/swiftv2/long_running_cluster/{datapath-test.go => datapath_test.go} (100%) diff --git a/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml b/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml index ccfb8e0422..6db15f3846 100644 --- a/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml +++ b/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml @@ -171,5 +171,5 @@ stages: echo "==> Running datapath tests" export RG=${{ parameters.resourceGroupName }} export BUILD_ID=$(Build.BuildId) - ginkgo -v -trace -fail-fast ./test/integration/swiftv2/long_running_cluster + ginkgo -v -trace ./test/integration/swiftv2/long_running_cluster displayName: "Run Ginkgo Datapath Suite" \ No newline at end of file diff --git a/test/integration/swiftv2/long_running_cluster/datapath-test.go b/test/integration/swiftv2/long_running_cluster/datapath_test.go similarity index 100% rename from test/integration/swiftv2/long_running_cluster/datapath-test.go rename to test/integration/swiftv2/long_running_cluster/datapath_test.go From 04d0804d42a3f39050db813b809248c7647462d0 Mon Sep 17 00:00:00 2001 From: sivakami Date: Mon, 10 Nov 2025 06:35:46 -0800 Subject: [PATCH 09/19] fixed dependencies. --- go.mod | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 4daba52873..8096f632b3 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module github.com/Azure/azure-container-networking -go 1.24.1 +go 1.24.0 + +toolchain go1.24.10 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.19.1 From ce772aa1063b4024822b12a743fb91ada34370ce Mon Sep 17 00:00:00 2001 From: sivakami Date: Mon, 10 Nov 2025 07:36:31 -0800 Subject: [PATCH 10/19] wrap test step in Azurecli task for automatic atuentication. --- .../template/long-running-pipeline-template.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml b/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml index 6db15f3846..0f2bd78bad 100644 --- a/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml +++ b/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml @@ -160,8 +160,13 @@ stages: displayName: "Use Go 1.22.5" inputs: version: "1.22.5" - - - script: | + - task: AzureCLI@2 + displayName: "Run Ginkgo Datapath Suite" + inputs: + azureSubscription: ${{ parameters.serviceConnection }} + scriptType: bash + scriptLocation: inlineScript + inlineScript: | echo "==> Installing Ginkgo CLI" go install github.com/onsi/ginkgo/v2/ginkgo@latest From a2a518205f3364431826e7d8ea4a736518498cfb Mon Sep 17 00:00:00 2001 From: sivakami Date: Mon, 10 Nov 2025 07:40:05 -0800 Subject: [PATCH 11/19] fixed yaml alignment. --- .../long-running-pipeline-template.yaml | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml b/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml index 0f2bd78bad..a2c6bd140f 100644 --- a/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml +++ b/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml @@ -161,20 +161,20 @@ stages: inputs: version: "1.22.5" - task: AzureCLI@2 - displayName: "Run Ginkgo Datapath Suite" - inputs: - azureSubscription: ${{ parameters.serviceConnection }} - scriptType: bash - scriptLocation: inlineScript - inlineScript: | - echo "==> Installing Ginkgo CLI" - go install github.com/onsi/ginkgo/v2/ginkgo@latest - - echo "==> Adding Go bin to PATH" - export PATH=$PATH:$(go env GOPATH)/bin - - echo "==> Running datapath tests" - export RG=${{ parameters.resourceGroupName }} - export BUILD_ID=$(Build.BuildId) - ginkgo -v -trace ./test/integration/swiftv2/long_running_cluster - displayName: "Run Ginkgo Datapath Suite" \ No newline at end of file + displayName: "Run Ginkgo Datapath Suite" + inputs: + azureSubscription: ${{ parameters.serviceConnection }} + scriptType: bash + scriptLocation: inlineScript + inlineScript: | + echo "==> Installing Ginkgo CLI" + go install github.com/onsi/ginkgo/v2/ginkgo@latest + + echo "==> Adding Go bin to PATH" + export PATH=$PATH:$(go env GOPATH)/bin + + echo "==> Running datapath tests" + export RG=${{ parameters.resourceGroupName }} + export BUILD_ID=$(Build.BuildId) + ginkgo -v -trace ./test/integration/swiftv2/long_running_cluster + \ No newline at end of file From 21834c7d2f60d3895ca2264014a8adf20c9754ad Mon Sep 17 00:00:00 2001 From: sivakami Date: Mon, 10 Nov 2025 08:24:32 -0800 Subject: [PATCH 12/19] rename var, fix imports. --- .../datapath.go | 2 +- .../datapath_test.go | 92 +++++++++---------- 2 files changed, 47 insertions(+), 47 deletions(-) rename test/integration/swiftv2/{long_running_cluster => longRunningCluster}/datapath.go (98%) rename test/integration/swiftv2/{long_running_cluster => longRunningCluster}/datapath_test.go (51%) diff --git a/test/integration/swiftv2/long_running_cluster/datapath.go b/test/integration/swiftv2/longRunningCluster/datapath.go similarity index 98% rename from test/integration/swiftv2/long_running_cluster/datapath.go rename to test/integration/swiftv2/longRunningCluster/datapath.go index 58359dcc4e..9c2d9d84fb 100644 --- a/test/integration/swiftv2/long_running_cluster/datapath.go +++ b/test/integration/swiftv2/longRunningCluster/datapath.go @@ -1,4 +1,4 @@ -package long_running_cluster +package longRunningCluster import ( "bytes" diff --git a/test/integration/swiftv2/long_running_cluster/datapath_test.go b/test/integration/swiftv2/longRunningCluster/datapath_test.go similarity index 51% rename from test/integration/swiftv2/long_running_cluster/datapath_test.go rename to test/integration/swiftv2/longRunningCluster/datapath_test.go index 61d351bf22..5ac3347100 100644 --- a/test/integration/swiftv2/long_running_cluster/datapath_test.go +++ b/test/integration/swiftv2/longRunningCluster/datapath_test.go @@ -1,4 +1,4 @@ -package long_running_cluster +package longRunningCluster import ( "fmt" @@ -7,38 +7,38 @@ import ( "time" "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" + "github.com/onsi/gomega" "github.com/Azure/azure-container-networking/test/integration/swiftv2/helpers" ) func TestDatapath(t *testing.T) { - RegisterFailHandler(ginkgo.Fail) + gomega.RegisterFailHandler(ginkgo.Fail) ginkgo.RunSpecs(t, "Datapath Suite") } var _ = ginkgo.Describe("Datapath Tests", func() { - RG := os.Getenv("RG") - BUILD_ID := os.Getenv("BUILD_ID") + rg := os.Getenv("RG") + buildId := os.Getenv("BUILD_ID") - if RG == "" || BUILD_ID == "" { - ginkgo.Fail(fmt.Sprintf("Missing required environment variables: RG='%s', BUILD_ID='%s'", RG, BUILD_ID)) + if rg == "" || buildId == "" { + ginkgo.Fail(fmt.Sprintf("Missing required environment variables: RG='%s', BUILD_ID='%s'", rg, buildId)) } - CLUSTER2 := "aks-2" - KUBECONFIG2 := fmt.Sprintf("/tmp/%s.kubeconfig", CLUSTER2) - PN_NAME := fmt.Sprintf("pn-%s-c2", BUILD_ID) - PNI_NAME := fmt.Sprintf("pni-%s-c2", BUILD_ID) + cluster2 := "aks-2" + kubeconfig2 := fmt.Sprintf("/tmp/%s.kubeconfig", cluster2) + pnName := fmt.Sprintf("pn-%s-c2", buildId) + pniName := fmt.Sprintf("pni-%s-c2", buildId) ginkgo.It("creates and deletes PodNetwork, PodNetworkInstance, and Pods in a loop", func() { vnetName := "cx_vnet_b1" subnetName := "s1" // Get subnet information once (doesn't change between iterations) - vnetGUID := helpers.GetVnetGUID(RG, vnetName) - subnetGUID := helpers.GetSubnetGUID(RG, vnetName, subnetName) - subnetARMID := helpers.GetSubnetARMID(RG, vnetName, subnetName) - subnetToken := helpers.GetSubnetToken(RG, vnetName, subnetName) + vnetGUID := helpers.GetVnetGUID(rg, vnetName) + subnetGUID := helpers.GetSubnetGUID(rg, vnetName, subnetName) + subnetARMID := helpers.GetSubnetARMID(rg, vnetName, subnetName) + subnetToken := helpers.GetSubnetToken(rg, vnetName, subnetName) // Run indefinitely until test is cancelled iteration := 0 @@ -47,35 +47,35 @@ var _ = ginkgo.Describe("Datapath Tests", func() { ginkgo.By(fmt.Sprintf("Starting iteration %d at %s", iteration, time.Now().Format(time.RFC3339))) // Step 1: Create PodNetwork - ginkgo.By(fmt.Sprintf("Creating PodNetwork %s", PN_NAME)) - err := CreatePodNetwork(KUBECONFIG2, PodNetworkData{ - PNName: PN_NAME, + ginkgo.By(fmt.Sprintf("Creating PodNetwork %s", pnName)) + err := CreatePodNetwork(kubeconfig2, PodNetworkData{ + PNName: pnName, VnetGUID: vnetGUID, SubnetGUID: subnetGUID, SubnetARMID: subnetARMID, SubnetToken: subnetToken, }, "../../manifests/swiftv2/long-running-cluster/podnetwork.yaml") - Expect(err).To(BeNil()) + gomega.Expect(err).To(gomega.BeNil()) // Step 2: Create namespace and PodNetworkInstance - ginkgo.By(fmt.Sprintf("Creating namespace %s", PN_NAME)) - err = helpers.EnsureNamespaceExists(KUBECONFIG2, PN_NAME) - Expect(err).To(BeNil()) - - ginkgo.By(fmt.Sprintf("Creating PodNetworkInstance %s", PNI_NAME)) - err = CreatePodNetworkInstance(KUBECONFIG2, PNIData{ - PNIName: PNI_NAME, - PNName: PN_NAME, - Namespace: PN_NAME, + ginkgo.By(fmt.Sprintf("Creating namespace %s", pnName)) + err = helpers.EnsureNamespaceExists(kubeconfig2, pnName) + gomega.Expect(err).To(gomega.BeNil()) + + ginkgo.By(fmt.Sprintf("Creating PodNetworkInstance %s", pniName)) + err = CreatePodNetworkInstance(kubeconfig2, PNIData{ + PNIName: pniName, + PNName: pnName, + Namespace: pnName, Type: "explicit", Reservations: 2, }, "../../manifests/swiftv2/long-running-cluster/podnetworkinstance.yaml") - Expect(err).To(BeNil()) + gomega.Expect(err).To(gomega.BeNil()) // Step 3: Create pods on first two nodes ginkgo.By("Getting cluster nodes") - nodes := helpers.GetClusterNodes(KUBECONFIG2) - Expect(len(nodes)).To(BeNumerically(">=", 2), "Need at least 2 nodes") + nodes := helpers.GetClusterNodes(kubeconfig2) + gomega.Expect(len(nodes)).To(gomega.BeNumerically(">=", 2), "Need at least 2 nodes") podNames := []string{} for i, node := range nodes[:2] { @@ -83,15 +83,15 @@ var _ = ginkgo.Describe("Datapath Tests", func() { podNames = append(podNames, podName) ginkgo.By(fmt.Sprintf("Creating pod %s on node %s", podName, node)) - err := CreatePod(KUBECONFIG2, PodData{ + err := CreatePod(kubeconfig2, PodData{ PodName: podName, NodeName: node, OS: "linux", - PNName: PN_NAME, - PNIName: PNI_NAME, + PNName: pnName, + PNIName: pniName, Image: "weibeld/ubuntu-networking", }, "../../manifests/swiftv2/long-running-cluster/pod.yaml") - Expect(err).To(BeNil()) + gomega.Expect(err).To(gomega.BeNil()) } // Step 4: Wait for 5 minutes @@ -102,21 +102,21 @@ var _ = ginkgo.Describe("Datapath Tests", func() { ginkgo.By("Deleting pods") for _, podName := range podNames { ginkgo.By(fmt.Sprintf("Deleting pod %s", podName)) - err := helpers.DeletePod(KUBECONFIG2, PN_NAME, podName) - Expect(err).To(BeNil()) + err := helpers.DeletePod(kubeconfig2, pnName, podName) + gomega.Expect(err).To(gomega.BeNil()) } - ginkgo.By(fmt.Sprintf("Deleting PodNetworkInstance %s", PNI_NAME)) - err = helpers.DeletePodNetworkInstance(KUBECONFIG2, PN_NAME, PNI_NAME) - Expect(err).To(BeNil()) + ginkgo.By(fmt.Sprintf("Deleting PodNetworkInstance %s", pniName)) + err = helpers.DeletePodNetworkInstance(kubeconfig2, pnName, pniName) + gomega.Expect(err).To(gomega.BeNil()) - ginkgo.By(fmt.Sprintf("Deleting PodNetwork %s", PN_NAME)) - err = helpers.DeletePodNetwork(KUBECONFIG2, PN_NAME) - Expect(err).To(BeNil()) + ginkgo.By(fmt.Sprintf("Deleting PodNetwork %s", pnName)) + err = helpers.DeletePodNetwork(kubeconfig2, pnName) + gomega.Expect(err).To(gomega.BeNil()) - ginkgo.By(fmt.Sprintf("Deleting namespace %s", PN_NAME)) - err = helpers.DeleteNamespace(KUBECONFIG2, PN_NAME) - Expect(err).To(BeNil()) + ginkgo.By(fmt.Sprintf("Deleting namespace %s", pnName)) + err = helpers.DeleteNamespace(kubeconfig2, pnName) + gomega.Expect(err).To(gomega.BeNil()) ginkgo.By(fmt.Sprintf("Completed iteration %d at %s", iteration, time.Now().Format(time.RFC3339))) From fe081e7dacc6b9ebed849a55e4e4f95329815bfa Mon Sep 17 00:00:00 2001 From: sivakami Date: Mon, 10 Nov 2025 08:47:11 -0800 Subject: [PATCH 13/19] Set kubeconfig. --- .../template/long-running-pipeline-template.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml b/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml index a2c6bd140f..cf6030a11d 100644 --- a/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml +++ b/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml @@ -172,6 +172,20 @@ stages: echo "==> Adding Go bin to PATH" export PATH=$PATH:$(go env GOPATH)/bin + + echo "==> Downloading Go dependencies" + go mod download + + echo "==> Setting up kubeconfig for cluster aks-2" + az aks get-credentials \ + --resource-group ${{ parameters.resourceGroupName }} \ + --name aks-2 \ + --file /tmp/aks-2.kubeconfig \ + --overwrite-existing \ + --admin + + echo "==> Verifying cluster connectivity" + kubectl --kubeconfig /tmp/aks-2.kubeconfig get nodes echo "==> Running datapath tests" export RG=${{ parameters.resourceGroupName }} From 8624951bb4bae320517e4263add4e14ee1c21844 Mon Sep 17 00:00:00 2001 From: sivakami Date: Mon, 10 Nov 2025 09:54:41 -0800 Subject: [PATCH 14/19] Update ginkgo directory name. --- .../template/long-running-pipeline-template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml b/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml index cf6030a11d..c380afdeb7 100644 --- a/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml +++ b/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml @@ -190,5 +190,5 @@ stages: echo "==> Running datapath tests" export RG=${{ parameters.resourceGroupName }} export BUILD_ID=$(Build.BuildId) - ginkgo -v -trace ./test/integration/swiftv2/long_running_cluster + ginkgo -v -trace ./test/integration/swiftv2/longRunningCluster \ No newline at end of file From 98d06a2f88fda39312ac41853a4070f295842b4f Mon Sep 17 00:00:00 2001 From: sivakami Date: Mon, 10 Nov 2025 10:53:17 -0800 Subject: [PATCH 15/19] update pni template. --- .../swiftv2/long-running-cluster/podnetworkinstance.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/integration/manifests/swiftv2/long-running-cluster/podnetworkinstance.yaml b/test/integration/manifests/swiftv2/long-running-cluster/podnetworkinstance.yaml index 0158e955c7..8bcdc005be 100644 --- a/test/integration/manifests/swiftv2/long-running-cluster/podnetworkinstance.yaml +++ b/test/integration/manifests/swiftv2/long-running-cluster/podnetworkinstance.yaml @@ -4,7 +4,8 @@ metadata: name: {{ .PNIName }} namespace: {{ .Namespace }} spec: - podNetwork: {{ .PNName }} + podNetworkConfigs: + - podNetwork: {{ .PNName }} {{- if eq .Type "explicit" }} podIPReservationSize: {{ .Reservations }} {{- else }} From 318f00aa97844a384688918fadc5e4a36f7034bc Mon Sep 17 00:00:00 2001 From: sivakami Date: Mon, 10 Nov 2025 11:20:51 -0800 Subject: [PATCH 16/19] update pni template. --- .../long-running-cluster/podnetworkinstance.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/integration/manifests/swiftv2/long-running-cluster/podnetworkinstance.yaml b/test/integration/manifests/swiftv2/long-running-cluster/podnetworkinstance.yaml index 8bcdc005be..4d1f8ca384 100644 --- a/test/integration/manifests/swiftv2/long-running-cluster/podnetworkinstance.yaml +++ b/test/integration/manifests/swiftv2/long-running-cluster/podnetworkinstance.yaml @@ -6,8 +6,8 @@ metadata: spec: podNetworkConfigs: - podNetwork: {{ .PNName }} -{{- if eq .Type "explicit" }} - podIPReservationSize: {{ .Reservations }} -{{- else }} - podIPReservationSize: 1 -{{- end }} + {{- if eq .Type "explicit" }} + podIPReservationSize: {{ .Reservations }} + {{- else }} + podIPReservationSize: 1 + {{- end }} From d63e6be1b99f9ce972031a790d5843f77bd33a98 Mon Sep 17 00:00:00 2001 From: sivakami Date: Mon, 10 Nov 2025 13:19:42 -0800 Subject: [PATCH 17/19] set timeout to zero to run tests indefinitely. Set namespace for pods. --- .../swiftv2/long-running-cluster/pod.yaml | 2 +- .../swiftv2/longRunningCluster/datapath.go | 13 +++++++------ .../swiftv2/longRunningCluster/datapath_test.go | 15 ++++++++------- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/test/integration/manifests/swiftv2/long-running-cluster/pod.yaml b/test/integration/manifests/swiftv2/long-running-cluster/pod.yaml index 98ef55041c..e2c33f2d8f 100644 --- a/test/integration/manifests/swiftv2/long-running-cluster/pod.yaml +++ b/test/integration/manifests/swiftv2/long-running-cluster/pod.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Pod metadata: name: {{ .PodName }} - namespace: default + namespace: {{ .Namespace }} labels: kubernetes.azure.com/pod-network-instance: {{ .PNIName }} kubernetes.azure.com/pod-network: {{ .PNName }} diff --git a/test/integration/swiftv2/longRunningCluster/datapath.go b/test/integration/swiftv2/longRunningCluster/datapath.go index 9c2d9d84fb..9682664259 100644 --- a/test/integration/swiftv2/longRunningCluster/datapath.go +++ b/test/integration/swiftv2/longRunningCluster/datapath.go @@ -63,12 +63,13 @@ func CreatePodNetworkInstance(kubeconfig string, data PNIData, templatePath stri // Pod // ------------------------- type PodData struct { - PodName string - NodeName string - OS string - PNName string - PNIName string - Image string + PodName string + NodeName string + OS string + PNName string + PNIName string + Namespace string + Image string } func CreatePod(kubeconfig string, data PodData, templatePath string) error { diff --git a/test/integration/swiftv2/longRunningCluster/datapath_test.go b/test/integration/swiftv2/longRunningCluster/datapath_test.go index 5ac3347100..509483ea54 100644 --- a/test/integration/swiftv2/longRunningCluster/datapath_test.go +++ b/test/integration/swiftv2/longRunningCluster/datapath_test.go @@ -17,7 +17,7 @@ func TestDatapath(t *testing.T) { ginkgo.RunSpecs(t, "Datapath Suite") } -var _ = ginkgo.Describe("Datapath Tests", func() { +var _ = ginkgo.Describe("Datapath Tests", ginkgo.NodeTimeout(0), func() { rg := os.Getenv("RG") buildId := os.Getenv("BUILD_ID") @@ -84,12 +84,13 @@ var _ = ginkgo.Describe("Datapath Tests", func() { ginkgo.By(fmt.Sprintf("Creating pod %s on node %s", podName, node)) err := CreatePod(kubeconfig2, PodData{ - PodName: podName, - NodeName: node, - OS: "linux", - PNName: pnName, - PNIName: pniName, - Image: "weibeld/ubuntu-networking", + PodName: podName, + NodeName: node, + OS: "linux", + PNName: pnName, + PNIName: pniName, + Namespace: pnName, + Image: "weibeld/ubuntu-networking", }, "../../manifests/swiftv2/long-running-cluster/pod.yaml") gomega.Expect(err).To(gomega.BeNil()) } From 3b2591537026f4f61f9851af336df2024c9de9b3 Mon Sep 17 00:00:00 2001 From: sivakami Date: Mon, 10 Nov 2025 14:22:12 -0800 Subject: [PATCH 18/19] set node timeout to 0 to run test indefinitely. --- test/integration/swiftv2/longRunningCluster/datapath_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/swiftv2/longRunningCluster/datapath_test.go b/test/integration/swiftv2/longRunningCluster/datapath_test.go index 509483ea54..d4e4de9f40 100644 --- a/test/integration/swiftv2/longRunningCluster/datapath_test.go +++ b/test/integration/swiftv2/longRunningCluster/datapath_test.go @@ -17,7 +17,7 @@ func TestDatapath(t *testing.T) { ginkgo.RunSpecs(t, "Datapath Suite") } -var _ = ginkgo.Describe("Datapath Tests", ginkgo.NodeTimeout(0), func() { +var _ = ginkgo.Describe("Datapath Tests", func() { rg := os.Getenv("RG") buildId := os.Getenv("BUILD_ID") @@ -30,7 +30,7 @@ var _ = ginkgo.Describe("Datapath Tests", ginkgo.NodeTimeout(0), func() { pnName := fmt.Sprintf("pn-%s-c2", buildId) pniName := fmt.Sprintf("pni-%s-c2", buildId) - ginkgo.It("creates and deletes PodNetwork, PodNetworkInstance, and Pods in a loop", func() { + ginkgo.It("creates and deletes PodNetwork, PodNetworkInstance, and Pods in a loop", ginkgo.NodeTimeout(0), func() { vnetName := "cx_vnet_b1" subnetName := "s1" From 68c98ae997bbf1313e5c4cd2e39debf0efd7fe9d Mon Sep 17 00:00:00 2001 From: sivakami Date: Wed, 12 Nov 2025 19:23:07 -0800 Subject: [PATCH 19/19] set timeout as 0. --- .../template/long-running-pipeline-template.yaml | 2 +- test/integration/swiftv2/longRunningCluster/datapath_test.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml b/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml index c380afdeb7..efc91e12c5 100644 --- a/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml +++ b/.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml @@ -190,5 +190,5 @@ stages: echo "==> Running datapath tests" export RG=${{ parameters.resourceGroupName }} export BUILD_ID=$(Build.BuildId) - ginkgo -v -trace ./test/integration/swiftv2/longRunningCluster + ginkgo -v -trace --timeout=0 ./test/integration/swiftv2/longRunningCluster \ No newline at end of file diff --git a/test/integration/swiftv2/longRunningCluster/datapath_test.go b/test/integration/swiftv2/longRunningCluster/datapath_test.go index d4e4de9f40..2a49abf709 100644 --- a/test/integration/swiftv2/longRunningCluster/datapath_test.go +++ b/test/integration/swiftv2/longRunningCluster/datapath_test.go @@ -14,7 +14,10 @@ import ( func TestDatapath(t *testing.T) { gomega.RegisterFailHandler(ginkgo.Fail) - ginkgo.RunSpecs(t, "Datapath Suite") + // Set suite timeout to 0 (unlimited) for long-running tests + suiteConfig, reporterConfig := ginkgo.GinkgoConfiguration() + suiteConfig.Timeout = 0 + ginkgo.RunSpecs(t, "Datapath Suite", suiteConfig, reporterConfig) } var _ = ginkgo.Describe("Datapath Tests", func() {