Browse Source

[ipvs] Add SetConfig test with timeout=0

Signed-off-by: Laurent Bernaille <laurent.bernaille@datadoghq.com>
Laurent Bernaille 6 năm trước cách đây
mục cha
commit
efeae5e7ee
1 tập tin đã thay đổi với 9 bổ sung0 xóa
  1. 9 0
      libnetwork/ipvs/ipvs_test.go

+ 9 - 0
libnetwork/ipvs/ipvs_test.go

@@ -363,4 +363,13 @@ func TestTimeouts(t *testing.T) {
 	c2, err := i.GetConfig()
 	c2, err := i.GetConfig()
 	assert.NilError(t, err)
 	assert.NilError(t, err)
 	assert.DeepEqual(t, cfg, *c2)
 	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})
 }
 }