Skip to content

Commit df3b60d

Browse files
committed
fix e2e not stable
Signed-off-by: DangPeng Liu <[email protected]>
1 parent 74b418c commit df3b60d

File tree

3 files changed

+39
-8
lines changed

3 files changed

+39
-8
lines changed

test/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ e2e-cleanup:
1616

1717
e2e-test-all: tidy vendor
1818
sh ./test/script/e2e_run.sh -f "e2e-test-localpolicy,e2e-test-placement,e2e-test-app,e2e-test-policy,e2e-tests-backup,e2e-test-grafana,e2e-test-agent" -v $(VERBOSE)
19-
sh ./test/script/e2e_run_qe.sh
2019
sh ./test/script/e2e_run.sh -f "e2e-test-prune" -v $(VERBOSE)
2120
sh ./test/script/e2e_clean_globalhub.sh
21+
sh ./test/script/e2e_run_qe.sh
22+
sh ./test/script/e2e_clean_globalhub.sh
2223
sh ./test/script/e2e_run_byo.sh -v $(VERBOSE)
2324

2425
e2e-test-cluster e2e-test-placement e2e-test-app e2e-test-policy e2e-test-localpolicy e2e-test-grafana e2e-test-agent: tidy vendor

test/script/e2e_clean_globalhub.sh

+3-7
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,6 @@ echo "Delete mgh"
3535
wait_cmd "kubectl delete multiclusterglobalhubs --all -n $GH_NAMESPACE --ignore-not-found=true"
3636

3737
export TARGET_NAMESPACE=$GH_NAMESPACE
38-
cd operator
39-
make undeploy
40-
41-
cd $CURRENT_DIR
42-
43-
kubectl delete clusterrolebinding multicluster-global-hub-operator-rolebinding --ignore-not-found=true
44-
kubectl delete clusterrolebinding multicluster-global-hub-operator-aggregated-clusterrolebinding --ignore-not-found=true
4538

4639
## wait kafka/kafkatopic/kafka user be deleted
4740
echo "Check kafkatopics deleted"
@@ -62,6 +55,9 @@ if [[ ! -z $(kubectl get kafka -n "$GH_NAMESPACE" --ignore-not-found=true) ]]; t
6255
exit 1
6356
fi
6457

58+
cd operator
59+
make undeploy
60+
6561
## clean
6662
wait_cmd "kubectl delete crd kafkas.kafka.strimzi.io --ignore-not-found=true"
6763
wait_cmd "kubectl delete crd kafkanodepools.kafka.strimzi.io --ignore-not-found=true"

test/script/e2e_run_qe.sh

+34
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,41 @@ source "$CURRENT_DIR/util.sh"
1111
CONFIG_DIR=$CURRENT_DIR/config
1212
GH_KUBECONFIG="${CONFIG_DIR}/global-hub"
1313
MH1_KUBECONFIG="${CONFIG_DIR}/hub1"
14+
export KUBECONFIG=$GH_KUBECONFIG
15+
export GH_NAME="global-hub" # the KinD name
1416

17+
18+
##Install globalhub
19+
cd $CURRENT_DIR/../../operator
20+
make deploy
21+
cat <<EOF | kubectl apply --kubeconfig $GH_KUBECONFIG -f -
22+
apiVersion: operator.open-cluster-management.io/v1alpha4
23+
kind: MulticlusterGlobalHub
24+
metadata:
25+
name: multiclusterglobalhub
26+
namespace: multicluster-global-hub
27+
annotations:
28+
mgh-skip-auth: "true"
29+
mgh-scheduler-interval: "minute"
30+
global-hub.open-cluster-management.io/catalog-source-name: "operatorhubio-catalog"
31+
global-hub.open-cluster-management.io/catalog-source-namespace: "olm"
32+
global-hub.open-cluster-management.io/kafka-use-nodeport: ""
33+
spec:
34+
availabilityConfig: Basic
35+
enableMetrics: false
36+
dataLayer:
37+
postgres:
38+
retention: 18m
39+
EOF
40+
41+
global_hub_node_ip=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${GH_NAME}-control-plane)
42+
export GLOBAL_HUB_NODE_IP=${global_hub_node_ip}
43+
44+
kubectl annotate mgh multiclusterglobalhub global-hub.open-cluster-management.io/kind-cluster-ip=$GLOBAL_HUB_NODE_IP --kubeconfig $GH_KUBECONFIG -n multicluster-global-hub
45+
46+
wait_cmd "kubectl get mgh --kubeconfig $GH_KUBECONFIG -n multicluster-global-hub | grep Running"
47+
48+
cd $CONFIG_DIR
1549
docker pull quay.io/hchenxa/acmqe-hoh-e2e
1650
docker run --name qe-test -d quay.io/hchenxa/acmqe-hoh-e2e tail -f /dev/null
1751
docker cp qe-test:/e2e.test ./

0 commit comments

Comments
 (0)