Skip to content

Commit

Permalink
remove TestSetKeepAlive
Browse files Browse the repository at this point in the history
  • Loading branch information
liangchuan committed Mar 12, 2024
1 parent 1c4a923 commit b73302d
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions bfe_modules/mod_tcp_keepalive/mod_tcp_keepalive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b73302d

Please sign in to comment.