Skip to content

Commit

Permalink
fix underlay e2e testing (#1929)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzujian committed Sep 28, 2022
1 parent 6c710ac commit 04338c8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/daemon/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"net"
"strings"
"syscall"
"time"

"github.com/Wifx/gonetworkmanager"
Expand Down Expand Up @@ -199,7 +200,7 @@ func changeProvideNicName(current, target string) (bool, error) {
continue
}
if route.Scope == scope {
if err = netlink.RouteReplace(&route); err != nil {
if err = netlink.RouteReplace(&route); err != nil && err != syscall.EEXIST {
klog.Errorf("failed to replace route %s: %v", route.String(), err)
return false, err
}
Expand Down
8 changes: 8 additions & 0 deletions test/e2e/underlay/underlay.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,10 @@ var _ = Describe("[Underlay]", func() {
Expect(err).NotTo(HaveOccurred())
}

By("wait provider network to be ready")
time.Sleep(3 * time.Second)
err = f.WaitProviderNetworkReady(ProviderNetwork)
Expect(err).NotTo(HaveOccurred())

By("validate provider network")
pn, err := f.OvnClientSet.KubeovnV1().ProviderNetworks().Get(context.Background(), ProviderNetwork, metav1.GetOptions{})
Expand All @@ -222,6 +225,11 @@ var _ = Describe("[Underlay]", func() {
newPn.Spec.ExcludeNodes = nil
_, err = f.OvnClientSet.KubeovnV1().ProviderNetworks().Update(context.Background(), newPn, metav1.UpdateOptions{})
Expect(err).NotTo(HaveOccurred())

By("wait provider network to be ready")
time.Sleep(3 * time.Second)
err = f.WaitProviderNetworkReady(ProviderNetwork)
Expect(err).NotTo(HaveOccurred())
})
})

Expand Down

0 comments on commit 04338c8

Please sign in to comment.