make the gre test pass

This commit is contained in:
Vishvananda Ishaya
2015-12-18 12:14:58 -08:00
parent 2e77ee0835
commit bfd70f5564
2 changed files with 11 additions and 13 deletions

View File

@@ -1,5 +1,8 @@
language: go language: go
before_script: before_script:
# make sure we keep path in tact when we sudo
- sudo sed -i -e 's/^Defaults\tsecure_path.*$//' /etc/sudoers - sudo sed -i -e 's/^Defaults\tsecure_path.*$//' /etc/sudoers
# modprobe ip_gre or else the first gre device can't be deleted
- sudo modprobe ip_gre
install: install:
- go get github.com/vishvananda/netns - go get github.com/vishvananda/netns

View File

@@ -114,20 +114,15 @@ func testLinkAddDel(t *testing.T, link Link) {
t.Fatal(err) t.Fatal(err)
} }
// It appears that some links don't disappear immediately. Specifically, links, err = LinkList()
// the first GreTap device takes a moment to delete. if err != nil {
for i := 0; i < 10; i++ { t.Fatal(err)
links, err = LinkList() }
if err != nil {
t.Fatal(err) if len(links) != num {
} t.Fatal("Link not removed properly")
return
if len(links) == num {
return
}
time.Sleep(100 * time.Millisecond)
} }
t.Fatal("Link not removed properly")
} }
func compareVxlan(t *testing.T, expected, actual *Vxlan) { func compareVxlan(t *testing.T, expected, actual *Vxlan) {