Skip to content

Commit 902e737

Browse files
delete update e2e case
Signed-off-by: LiZhenCheng9527 <lizhencheng6@huawei.com>
1 parent a3d2f92 commit 902e737

File tree

3 files changed

+10
-234
lines changed

3 files changed

+10
-234
lines changed

test/e2e/baseline_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -754,21 +754,21 @@ func TestBookinfo(t *testing.T) {
754754
framework.NewTest(t).Run(func(t framework.TestContext) {
755755
namespace := apps.Namespace.Name()
756756
// Install bookinfo.
757-
if _, err := shell.Execute(true, fmt.Sprintf("kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.24/samples/bookinfo/platform/kube/bookinfo.yaml -n %s", namespace)); err != nil {
757+
if _, err := shell.Execute(true, fmt.Sprintf("kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.22/samples/bookinfo/platform/kube/bookinfo.yaml -n %s", namespace)); err != nil {
758758
t.Fatalf("failed to install bookinfo: %v", err)
759759
}
760760
t.Cleanup(func() {
761-
if _, err := shell.Execute(true, fmt.Sprintf("kubectl delete -f https://raw.githubusercontent.com/istio/istio/release-1.24/samples/bookinfo/platform/kube/bookinfo.yaml -n %s", namespace)); err != nil {
761+
if _, err := shell.Execute(true, fmt.Sprintf("kubectl delete -f https://raw.githubusercontent.com/istio/istio/release-1.22/samples/bookinfo/platform/kube/bookinfo.yaml -n %s", namespace)); err != nil {
762762
t.Fatalf("failed to delete bookinfo: %v", err)
763763
}
764764
})
765765

766766
// Install sleep as client.
767-
if _, err := shell.Execute(true, fmt.Sprintf("kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.24/samples/sleep/sleep.yaml -n %s", namespace)); err != nil {
767+
if _, err := shell.Execute(true, fmt.Sprintf("kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.22/samples/sleep/sleep.yaml -n %s", namespace)); err != nil {
768768
t.Fatalf("failed to install sleep as client of bookinfo: %v", err)
769769
}
770770
t.Cleanup(func() {
771-
if _, err := shell.Execute(true, fmt.Sprintf("kubectl delete -f https://raw.githubusercontent.com/istio/istio/release-1.24/samples/sleep/sleep.yaml -n %s", namespace)); err != nil {
771+
if _, err := shell.Execute(true, fmt.Sprintf("kubectl delete -f https://raw.githubusercontent.com/istio/istio/release-1.22/samples/sleep/sleep.yaml -n %s", namespace)); err != nil {
772772
t.Fatalf("failed to delete sleep as client of bookinfo: %v", err)
773773
}
774774
})
@@ -797,7 +797,7 @@ func TestBookinfo(t *testing.T) {
797797
return true
798798
}
799799

800-
if err := retry.Until(checkBookinfo, retry.Timeout(900*time.Second), retry.BackoffDelay(3*time.Second)); err != nil {
800+
if err := retry.Until(checkBookinfo, retry.Timeout(900*time.Second), retry.Delay(3*time.Second)); err != nil {
801801
t.Fatal("failed to access bookinfo correctly: %v", err)
802802
}
803803

@@ -815,7 +815,7 @@ func TestBookinfo(t *testing.T) {
815815
UnsetWaypoint(t, namespace, "", Namespace)
816816
})
817817

818-
if err := retry.Until(checkBookinfo, retry.Timeout(900*time.Second), retry.BackoffDelay(3*time.Second)); err != nil {
818+
if err := retry.Until(checkBookinfo, retry.Timeout(900*time.Second), retry.Delay(3*time.Second)); err != nil {
819819
t.Fatal("failed to access bookinfo correctly when there is a namespace waypoint: %v", err)
820820
}
821821
})

test/e2e/run_test.sh

Lines changed: 4 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -105,25 +105,18 @@ data:
105105
EOF
106106
}
107107

108-
# function setup_istio() {
109-
# echo "install istio $ISTIO_VERSION"
110-
# kubectl get crd gateways.gateway.networking.k8s.io &>/dev/null ||
111-
# { kubectl kustomize "github.com/kubernetes-sigs/gateway-api/config/crd/experimental?ref=v1.1.0" | kubectl apply -f -; }
112-
113-
# istioctl install --set profile=ambient --set meshConfig.accessLogFile="/dev/stdout" --set components.ingressGateways[0].enabled=true --set components.ingressGateways[0].name=istio-ingressgateway --skip-confirmation
114-
# }
115-
116108
function setup_istio() {
117109
echo "install istio $ISTIO_VERSION"
118110
kubectl get crd gateways.gateway.networking.k8s.io &>/dev/null ||
119111
{ kubectl kustomize "github.com/kubernetes-sigs/gateway-api/config/crd/experimental?ref=v1.1.0" | kubectl apply -f -; }
120112
# install istio CRD
121113
helm repo add istio https://istio-release.storage.googleapis.com/charts
122114
helm repo update
123-
kubectl create namespace istio-system
124-
helm install istio-base istio/base -n istio-system
115+
helm install istio-base istio/base -n istio-system --create-namespace
116+
117+
helm install istiod istio/istiod --namespace istio-system --version $ISTIO_VERSION --set pilot.env.PILOT_ENABLE_AMBIENT=true --create-namespace
125118

126-
helm install istiod istio/istiod --namespace istio-system --version $ISTIO_VERSION --set pilot.env.PILOT_ENABLE_AMBIENT=true
119+
helm install istio-ingressgateway istio/gateway -n istio-system --create-namespace
127120

128121
while true; do
129122
pod_info=$(kubectl get pods -n istio-system -l app=istiod -o jsonpath='{range .items[*]}{.metadata.name}{" "}{.status.phase}{"\n"}{end}')
@@ -208,55 +201,6 @@ function setup_kmesh() {
208201
done
209202
}
210203

211-
function set_daemonupgarde_testcase_image() {
212-
local TMP_BUILD
213-
TMP_BUILD="$(mktemp -d)"
214-
echo "Building in temp dir: $TMP_BUILD"
215-
216-
git clone --depth 1 . "$TMP_BUILD" || {
217-
echo "git clone failed"
218-
rm -rf "$TMP_BUILD"
219-
return 1
220-
}
221-
222-
pushd "$TMP_BUILD" >/dev/null
223-
224-
BPF_HEADER_FILE="./bpf/include/bpf_common.h"
225-
echo "Modifying BPF header file: ${BPF_HEADER_FILE}"
226-
227-
sed -i \
228-
'/} kmesh_map64 SEC(".maps");/a\
229-
\
230-
struct {\
231-
__uint(type, BPF_MAP_TYPE_HASH);\
232-
__uint(key_size, sizeof(__u32));\
233-
__uint(value_size, MAP_VAL_SIZE_64);\
234-
__uint(max_entries, MAP_MAX_ENTRIES);\
235-
__uint(map_flags, BPF_F_NO_PREALLOC);\
236-
} kmesh_map64_bak_for_test SEC(".maps");' \
237-
"${BPF_HEADER_FILE}"
238-
239-
local HUB="localhost:5000"
240-
local TARGET="kmesh"
241-
local TAG="test-upgrade-map-change"
242-
local IMAGE="${HUB}/${TARGET}:${TAG}"
243-
244-
echo "Running 'make docker.push' with custom HUB and TAG in $TMP_BUILD"
245-
if ! HUB=${HUB} TARGET=${TARGET} TAG=${TAG} make docker.push; then
246-
echo "make docker.push failed"
247-
popd >/dev/null
248-
rm -rf "$TMP_BUILD"
249-
return 1
250-
fi
251-
252-
export KMESH_UPGRADE_IMAGE="${IMAGE}"
253-
echo "Built and pushed image: ${IMAGE}"
254-
255-
popd >/dev/null
256-
# rm -rf "$TMP_BUILD"
257-
return 0
258-
}
259-
260204
function setup_kmesh_log() {
261205
# Set log of each Kmesh pods.
262206
PODS=$(kubectl get pods -n kmesh-system -l app=kmesh -o jsonpath='{.items[*].metadata.name}')
@@ -318,26 +262,6 @@ function build_and_push_images() {
318262
HUB="${KIND_REGISTRY}" TAG="latest" make docker.push
319263
}
320264

321-
function load_prometheus_image_to_kind() {
322-
local NAME="${1:-kmesh-testing}"
323-
local PROMETHEUS_IMAGE="${2:-prom/prometheus:v2.54.1}"
324-
325-
echo "Pulling Prometheus image: $PROMETHEUS_IMAGE"
326-
if ! docker pull "$PROMETHEUS_IMAGE"; then
327-
echo "Failed to pull Prometheus image: $PROMETHEUS_IMAGE"
328-
return 1
329-
fi
330-
331-
echo "Loading Prometheus image to kind cluster: $NAME"
332-
if ! kind load docker-image "$PROMETHEUS_IMAGE" --name "$NAME"; then
333-
echo "Failed to load Prometheus image to kind cluster: $NAME"
334-
return 1
335-
fi
336-
337-
echo "Successfully loaded Prometheus image ($PROMETHEUS_IMAGE) to kind cluster ($NAME)"
338-
return 0
339-
}
340-
341265
function install_dependencies() {
342266
# 1. Install kind.
343267
if ! which kind &>/dev/null; then
@@ -447,10 +371,6 @@ while (("$#")); do
447371
PARAMS+=("-istio.test.nocleanup")
448372
shift
449373
;;
450-
--skip-build-daemonupgarde-image)
451-
SKIP_BUILD_UPGARDE=true
452-
shift
453-
;;
454374
*)
455375
PARAMS+=("$1")
456376
shift
@@ -472,9 +392,6 @@ if [[ -z ${SKIP_BUILD:-} ]]; then
472392
setup_kind_registry
473393
build_and_push_images
474394
install_kmeshctl
475-
if [[ -z ${SKIP_BUILD_UPGARDE:-} ]]; then
476-
set_daemonupgarde_testcase_image
477-
fi
478395
fi
479396

480397
kubectl config use-context "kind-$NAME"
@@ -488,8 +405,6 @@ fi
488405

489406
setup_kmesh_log
490407

491-
load_prometheus_image_to_kind
492-
493408
capture_pod_logs &
494409

495410
cmd="go test -v -tags=integ $ROOT_DIR/test/e2e/... -istio.test.kube.loadbalancer=false ${PARAMS[*]}"
@@ -513,6 +428,4 @@ if [[ -n ${CLEANUP_REGISTRY} ]]; then
513428
cleanup_docker_registry
514429
fi
515430

516-
#rm -rf "${TMP}"
517-
518431
exit $EXIT_CODE

test/e2e/upgarde_test.go

Lines changed: 0 additions & 137 deletions
This file was deleted.

0 commit comments

Comments
 (0)