From cc75d962f9f8bef685f60fe9867fec6bbe70cc4e Mon Sep 17 00:00:00 2001 From: Wenqi Qiu Date: Mon, 15 Jan 2024 17:08:40 +0800 Subject: [PATCH] Update script Signed-off-by: Wenqi Qiu --- ci/jenkins/test-scale.sh | 23 ++++++++++++------- .../framework/networkpolicy/scale_up.go | 3 ++- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/ci/jenkins/test-scale.sh b/ci/jenkins/test-scale.sh index fe4a177bf39..b2072fa35e5 100755 --- a/ci/jenkins/test-scale.sh +++ b/ci/jenkins/test-scale.sh @@ -275,8 +275,15 @@ function generate_ssh_config { } function prepare_scale_simulator { + ## Try best to clean up old config. + kubectl delete -f "${WORKSPACE}/build/yamls/antrea-agent-simulator.yml" || true + kubectl delete secret kubeconfig || true + + # Create simulators. kubectl taint -l 'antrea/instance=simulator' node mocknode=true:NoExecute - kubectl create secret generic kubeconfig --type=Opaque --namespace=kube-system --from-file=${WORKDIR}/.kube + kubectl create secret generic kubeconfig --type=Opaque --namespace=kube-system --from-file=admin.conf=${WORKDIR}/.kube + + kubectl apply -f "${WORKSPACE}/build/yamls/antrea-agent-simulator.yml" } function run_scale_test { @@ -314,13 +321,13 @@ function clean_tmp() { export KUBECONFIG=${KUBECONFIG_PATH} -source $WORKSPACE/ci/jenkins/utils.sh -check_and_upgrade_golang -clean_tmp - -trap clean_antrea EXIT -deliver_antrea_scale -prepare_scale_simulator +#source $WORKSPACE/ci/jenkins/utils.sh +#check_and_upgrade_golang +#clean_tmp +# +#trap clean_antrea EXIT +#deliver_antrea_scale +#prepare_scale_simulator run_scale_test if [[ ${TEST_FAILURE} == true ]]; then diff --git a/test/performance/framework/networkpolicy/scale_up.go b/test/performance/framework/networkpolicy/scale_up.go index 2f35a2c6136..0e0bd6664c4 100644 --- a/test/performance/framework/networkpolicy/scale_up.go +++ b/test/performance/framework/networkpolicy/scale_up.go @@ -88,6 +88,8 @@ type NetworkPolicyInfo struct { Name string Namespace string Spec netv1.NetworkPolicySpec + fromPod string + toIP string } func ScaleUp(ctx context.Context, cs kubernetes.Interface, nss []string, numPerNs int, ipv6 bool) (nps []NetworkPolicyInfo, err error) { @@ -125,7 +127,6 @@ func SelectConnectPod(ctx context.Context, cs kubernetes.Interface, ns string, n if _, ok := np.Spec.PodSelector.MatchLabels[utils.PodOnRealNodeLabelKey]; !ok { np.Spec.PodSelector.MatchLabels[utils.PodOnRealNodeLabelKey] = "" } - klog.InfoS("Podselect", "PodSelector", np.Spec.PodSelector) podList, err := cs.CoreV1().Pods(ns).List(ctx, metav1.ListOptions{LabelSelector: metav1.FormatLabelSelector(&np.Spec.PodSelector)}) if err != nil { return nil, "", fmt.Errorf("error when selecting networkpolicy applied to pods: %w", err)