Skip to content

Commit

Permalink
fix ic e2e (#3831)
Browse files Browse the repository at this point in the history
* fix e2e

Signed-off-by: Changlu Yi <[email protected]>

* fix

Signed-off-by: Changlu Yi <[email protected]>

---------

Signed-off-by: Changlu Yi <[email protected]>
  • Loading branch information
changluyi authored Apr 1, 2024
1 parent f8dee83 commit a48c597
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions test/e2e/ovn-ic/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,16 +347,29 @@ var _ = framework.SerialDescribe("[group:ovn-ic]", func() {
func checkECMPCount(expectCount int) {
ecmpCount := 0
maxRetryTimes := 30
for i := 0; i < maxRetryTimes; i++ {
time.Sleep(3 * time.Second)
execCmd := "kubectl ko nbctl lr-route-list ovn-cluster "
output, err := exec.Command("bash", "-c", execCmd).CombinedOutput()
framework.ExpectNoError(err)
ecmpCount = strings.Count(string(output), "ecmp")
if ecmpCount == expectCount {
break

for _, cluster := range clusters {
clusterName := "kind-" + cluster
ginkgo.By("Switching kubectl config context to " + clusterName)
switchCmd := "kubectl config use-context " + clusterName
_, err := exec.Command("bash", "-c", switchCmd).CombinedOutput()
framework.ExpectNoError(err, "failed to switch kubectl config context to %s", clusterName)

ginkgo.By("Checking logical router route count")
for i := 0; i < maxRetryTimes; i++ {
time.Sleep(3 * time.Second)
execCmd := "kubectl ko nbctl lr-route-list ovn-cluster "
output, err := exec.Command("bash", "-c", execCmd).CombinedOutput()
framework.ExpectNoError(err)
ecmpCount = strings.Count(string(output), "ecmp")
if ecmpCount == expectCount {
break
}
}
framework.ExpectEqual(ecmpCount, expectCount)
}

framework.ExpectEqual(ecmpCount, expectCount)
switchCmd := "kubectl config use-context kind-kube-ovn"
_, err := exec.Command("bash", "-c", switchCmd).CombinedOutput()
framework.ExpectNoError(err, "switch to kube-ovn cluster failed")
}

0 comments on commit a48c597

Please sign in to comment.