Skip to content

Commit 3e62b8b

Browse files
committed
[ipvs] Add tests for get/set timeout
Signed-off-by: Laurent Bernaille <laurent.bernaille@datadoghq.com>
1 parent 6091146 commit 3e62b8b

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

ipvs/ipvs_test.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"net"
77
"syscall"
88
"testing"
9+
"time"
910

1011
"github.com/docker/libnetwork/testutils"
1112
"github.com/vishvananda/netlink"
@@ -342,3 +343,24 @@ func TestDestination(t *testing.T) {
342343
}
343344
}
344345
}
346+
347+
func TestTimeouts(t *testing.T) {
348+
if testutils.RunningOnCircleCI() {
349+
t.Skip("Skipping as not supported on CIRCLE CI kernel")
350+
}
351+
defer testutils.SetupTestOSContext(t)()
352+
353+
i, err := New("")
354+
assert.NilError(t, err)
355+
356+
_, err = i.GetConfig()
357+
assert.NilError(t, err)
358+
359+
cfg := Config{66 * time.Second, 66 * time.Second, 66 * time.Second}
360+
err = i.SetConfig(&cfg)
361+
assert.NilError(t, err)
362+
363+
c2, err := i.GetConfig()
364+
assert.NilError(t, err)
365+
assert.DeepEqual(t, cfg, *c2)
366+
}

0 commit comments

Comments
 (0)