Skip to content

Commit

Permalink
Merge pull request #1149 from cc14514/1104
Browse files Browse the repository at this point in the history
remove TestSetKeepAlive
  • Loading branch information
mileszhang2016 authored Mar 13, 2024
2 parents 1c4a923 + a6b02d1 commit 28d6f4a
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions bfe_modules/mod_tcp_keepalive/mod_tcp_keepalive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package mod_tcp_keepalive

import (
"net"
"testing"

"github.com/baidu/go-lib/web-monitor/web_monitor"
Expand All @@ -38,40 +37,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 28d6f4a

Please sign in to comment.