Skip to content

Commit 2aa8b21

Browse files
committed
[ipvs] Add SetConfig test with timeout=0
Signed-off-by: Laurent Bernaille <laurent.bernaille@datadoghq.com>
1 parent 3e62b8b commit 2aa8b21

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

ipvs/ipvs_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,4 +363,13 @@ func TestTimeouts(t *testing.T) {
363363
c2, err := i.GetConfig()
364364
assert.NilError(t, err)
365365
assert.DeepEqual(t, cfg, *c2)
366+
367+
// A timeout value 0 means that the current timeout value of the corresponding entry is preserved
368+
cfg = Config{77 * time.Second, 0 * time.Second, 77 * time.Second}
369+
err = i.SetConfig(&cfg)
370+
assert.NilError(t, err)
371+
372+
c3, err := i.GetConfig()
373+
assert.NilError(t, err)
374+
assert.DeepEqual(t, *c3, Config{77 * time.Second, 66 * time.Second, 77 * time.Second})
366375
}

0 commit comments

Comments
 (0)