From 3d53f8ad39a44e163e22734ad2b684b8dab8f16a Mon Sep 17 00:00:00 2001 From: liangchuan Date: Tue, 12 Mar 2024 23:16:02 +0800 Subject: [PATCH 1/4] remove TestSetKeepAlive Signed-off-by: liangchuan --- .../mod_tcp_keepalive_test.go | 34 ------------------- 1 file changed, 34 deletions(-) diff --git a/bfe_modules/mod_tcp_keepalive/mod_tcp_keepalive_test.go b/bfe_modules/mod_tcp_keepalive/mod_tcp_keepalive_test.go index d443173d3..a23ebee71 100644 --- a/bfe_modules/mod_tcp_keepalive/mod_tcp_keepalive_test.go +++ b/bfe_modules/mod_tcp_keepalive/mod_tcp_keepalive_test.go @@ -38,40 +38,6 @@ func prepareRequest() *bfe_basic.Request { return request } -func TestSetKeepAlive(t *testing.T) { - m, err := prepareModule() - if err != nil { - t.Errorf("prepareModule() error: %v", err) - return - } - s := new(bfe_basic.Session) - ip := "180.97.93.196" - address := "180.97.93.196:80" - - s.Product = "product1" - s.Vip = net.ParseIP(ip) - if s.Vip == nil { - t.Errorf("net.ParseIP(%s) == nil", ip) - } - - conn, err := net.Dial("tcp", address) - if err != nil { - t.Errorf("net.Dial(tcp, %s) error: %v", address, err) - return - } - s.Connection = conn - - m.HandleAccept(s) - metrics := m.metrics.GetAll() - if metrics.CounterData["CONN_TO_SET"] != 1 || - metrics.CounterData["CONN_SET_KEEP_IDLE"] != 1 || - metrics.CounterData["CONN_SET_KEEP_INTVL"] != 1 { - - t.Errorf("CONN_TO_SET and CONN_SET_KEEP_IDLE and CONN_SET_KEEP_INTVL should be 1") - return - } -} - func TestModuleMisc(t *testing.T) { m, err := prepareModule() if err != nil { From 9472545ac8232e47a4d49b46f7f667905373e523 Mon Sep 17 00:00:00 2001 From: liangchuan Date: Wed, 13 Mar 2024 10:13:12 +0800 Subject: [PATCH 2/4] remove TestSetKeepAlive Signed-off-by: liangchuan --- bfe_modules/mod_tcp_keepalive/mod_tcp_keepalive_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/bfe_modules/mod_tcp_keepalive/mod_tcp_keepalive_test.go b/bfe_modules/mod_tcp_keepalive/mod_tcp_keepalive_test.go index a23ebee71..3de3321a1 100644 --- a/bfe_modules/mod_tcp_keepalive/mod_tcp_keepalive_test.go +++ b/bfe_modules/mod_tcp_keepalive/mod_tcp_keepalive_test.go @@ -15,7 +15,6 @@ package mod_tcp_keepalive import ( - "net" "testing" "github.com/baidu/go-lib/web-monitor/web_monitor" From f14932ce6cf8d71f099eca35c86d266f756f550a Mon Sep 17 00:00:00 2001 From: liangchuan Date: Wed, 13 Mar 2024 10:25:20 +0800 Subject: [PATCH 3/4] Resubmit with Signed-off-by line Signed-off-by: liangchuan --- bfe_modules/mod_tcp_keepalive/mod_tcp_keepalive_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/bfe_modules/mod_tcp_keepalive/mod_tcp_keepalive_test.go b/bfe_modules/mod_tcp_keepalive/mod_tcp_keepalive_test.go index 3de3321a1..facfc1306 100644 --- a/bfe_modules/mod_tcp_keepalive/mod_tcp_keepalive_test.go +++ b/bfe_modules/mod_tcp_keepalive/mod_tcp_keepalive_test.go @@ -18,6 +18,7 @@ import ( "testing" "github.com/baidu/go-lib/web-monitor/web_monitor" + "github.com/bfenetworks/bfe/bfe_basic" "github.com/bfenetworks/bfe/bfe_http" "github.com/bfenetworks/bfe/bfe_module" From a6b02d1ee2a73894fc229b8d76d2a5f2b2e11273 Mon Sep 17 00:00:00 2001 From: liangchuan Date: Wed, 13 Mar 2024 10:29:13 +0800 Subject: [PATCH 4/4] Resubmit with Signed-off-by line Signed-off-by: liangchuan --- bfe_modules/mod_tcp_keepalive/mod_tcp_keepalive_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/bfe_modules/mod_tcp_keepalive/mod_tcp_keepalive_test.go b/bfe_modules/mod_tcp_keepalive/mod_tcp_keepalive_test.go index facfc1306..3de3321a1 100644 --- a/bfe_modules/mod_tcp_keepalive/mod_tcp_keepalive_test.go +++ b/bfe_modules/mod_tcp_keepalive/mod_tcp_keepalive_test.go @@ -18,7 +18,6 @@ import ( "testing" "github.com/baidu/go-lib/web-monitor/web_monitor" - "github.com/bfenetworks/bfe/bfe_basic" "github.com/bfenetworks/bfe/bfe_http" "github.com/bfenetworks/bfe/bfe_module"