[ipvs] Add SetConfig test with timeout=0

Signed-off-by: Laurent Bernaille <laurent.bernaille@datadoghq.com>
This commit is contained in:
Laurent Bernaille 2019-03-13 21:43:01 +01:00
parent 8e650a9685
commit efeae5e7ee
1 changed files with 9 additions and 0 deletions

View File

@ -363,4 +363,13 @@ func TestTimeouts(t *testing.T) {
c2, err := i.GetConfig()
assert.NilError(t, err)
assert.DeepEqual(t, cfg, *c2)
// A timeout value 0 means that the current timeout value of the corresponding entry is preserved
cfg = Config{77 * time.Second, 0 * time.Second, 77 * time.Second}
err = i.SetConfig(&cfg)
assert.NilError(t, err)
c3, err := i.GetConfig()
assert.NilError(t, err)
assert.DeepEqual(t, *c3, Config{77 * time.Second, 66 * time.Second, 77 * time.Second})
}