Skip to content

Commit f6a1444

Browse files
committed
rfac: added setup_waypoint in run_test.sh
Signed-off-by: Yash Patel <yp969803@gmail.com>
1 parent e579883 commit f6a1444

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

test/e2e/run_test.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,45 @@ function setup_kmesh() {
139139
done
140140
}
141141

142+
function setup_waypoint() {
143+
cat <<EOF | kubectl apply -f -
144+
apiVersion: gateway.networking.k8s.io/v1
145+
kind: Gateway
146+
metadata:
147+
annotations:
148+
sidecar.istio.io/proxyImage: ${KMESH_WAYPOINT_IMAGE}
149+
name: waypoint
150+
namespace: default
151+
spec:
152+
gatewayClassName: istio-waypoint
153+
listeners:
154+
- name: mesh
155+
port: 15008
156+
protocol: HBONE
157+
EOF
158+
POD=$(kubectl get pods -n $NAMESPACE \
159+
--no-headers \
160+
-o custom-columns=NAME:.metadata.name \
161+
| grep '^waypoint' \
162+
| head -n1)
163+
if [[ -z $POD ]]; then
164+
echo "No pod found with prefix 'waypoint' in namespace $NAMESPACE" >&2
165+
exit 1
166+
fi
167+
echo "Watching pod $POD until it enters Ready..."
168+
while true; do
169+
ready=$(kubectl get pod $POD -n $NAMESPACE \
170+
-o jsonpath='{.status.conditions[?(@.type=="Ready")].status}')
171+
if [[ "$ready" == "True" ]]; then
172+
echo "✅ Pod $POD is Ready!"
173+
break
174+
fi
175+
echo "⏳ Pod $POD is not ready (status: $ready); sleeping 15s..."
176+
sleep 15
177+
done
178+
179+
}
180+
142181
export KIND_REGISTRY_NAME="kind-registry"
143182
export KIND_REGISTRY_PORT="5000"
144183
export KIND_REGISTRY="localhost:${KIND_REGISTRY_PORT}"
@@ -274,6 +313,7 @@ fi
274313
if [[ -z "${SKIP_BUILD:-}" ]]; then
275314
setup_kind_registry
276315
build_and_push_images
316+
setup_waypoint
277317
fi
278318

279319
kubectl config use-context "kind-$NAME"

test/e2e/tcp_long_conn_test.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//go:build integ
2+
// +build integ
3+
4+
/*
5+
* Copyright The Kmesh Authors.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at:
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
20+
// NOTE: THE CODE IN THIS FILE IS MAINLY REFERENCED FROM ISTIO INTEGRATION
21+
// FRAMEWORK(https://github.com/istio/istio/tree/master/tests/integration)
22+
// AND ADAPTED FOR KMESH.
23+
24+
package kmesh

0 commit comments

Comments
 (0)