Skip to content

Commit

Permalink
[ipvs] Add tests for get/set timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
lbernail committed Mar 13, 2019
1 parent 5d742b0 commit 81a2daf
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions ipvs/ipvs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"net"
"syscall"
"testing"
"time"

"github.com/docker/libnetwork/testutils"
"github.com/vishvananda/netlink"
Expand Down Expand Up @@ -342,3 +343,24 @@ func TestDestination(t *testing.T) {
}
}
}

func TestTimeouts(t *testing.T) {
if testutils.RunningOnCircleCI() {
t.Skip("Skipping as not supported on CIRCLE CI kernel")
}
defer testutils.SetupTestOSContext(t)()

i, err := New("")
assert.NilError(t, err)

_, err = i.GetConfig()
assert.NilError(t, err)

cfg := Config{66 * time.Second, 66 * time.Second, 66 * time.Second}
err = i.SetConfig(&cfg)
assert.NilError(t, err)

c2, err := i.GetConfig()
assert.NilError(t, err)
assert.DeepEqual(t, cfg, *c2)
}

0 comments on commit 81a2daf

Please sign in to comment.