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 4a80a48 commit b0907ef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/daemon/init_linux.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package daemon

import (
"syscall"

"k8s.io/klog/v2"

"github.com/Wifx/gonetworkmanager"
Expand Down Expand Up @@ -105,7 +107,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 b0907ef

Please sign in to comment.