Retry of Pring changed to Count
This commit is contained in:
parent
b6d1f49145
commit
e9c4b79b35
|
@ -29,7 +29,7 @@ func TestPing(t *testing.T) {
|
||||||
"00:11:32:7f:20:61",
|
"00:11:32:7f:20:61",
|
||||||
),
|
),
|
||||||
pingOption: &ounp.PingOption{
|
pingOption: &ounp.PingOption{
|
||||||
Retry: 3,
|
Count: 3,
|
||||||
Interval: 1,
|
Interval: 1,
|
||||||
Deadline: 1,
|
Deadline: 1,
|
||||||
},
|
},
|
||||||
|
|
|
@ -18,7 +18,7 @@ func Ping(service *omd.Service, pingOption ounp.Option) (ounp.Result, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
LOOP:
|
LOOP:
|
||||||
for indexR := 0; indexR < pingOption.GetRetry(); indexR++ {
|
for indexR := 0; indexR < pingOption.GetCount(); indexR++ {
|
||||||
conn, err := getConnection(service, pingOption)
|
conn, err := getConnection(service, pingOption)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
pingResult.Responses[indexR] = &ounp.PingResponse{
|
pingResult.Responses[indexR] = &ounp.PingResponse{
|
||||||
|
|
|
@ -42,7 +42,7 @@ func TestPing(t *testing.T) {
|
||||||
"",
|
"",
|
||||||
),
|
),
|
||||||
pingOption: &ounp.PingOption{
|
pingOption: &ounp.PingOption{
|
||||||
Retry: 3,
|
Count: 3,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -37,7 +37,7 @@ func processPrepacket(service *omd.Service, pingOption ounp.Option, matchCtx *os
|
||||||
buf := make([]byte, 1024)
|
buf := make([]byte, 1024)
|
||||||
|
|
||||||
LOOP:
|
LOOP:
|
||||||
for indexR := 0; indexR < pingOption.GetRetry(); indexR++ {
|
for indexR := 0; indexR < pingOption.GetCount(); indexR++ {
|
||||||
startTime := time.Now()
|
startTime := time.Now()
|
||||||
matchCtx.InitAttribute()
|
matchCtx.InitAttribute()
|
||||||
conn, err := getConnection(service, pingOption)
|
conn, err := getConnection(service, pingOption)
|
||||||
|
@ -148,7 +148,7 @@ func processPostpacket(service *omd.Service, pingOption ounp.Option, matchCtx *o
|
||||||
buf := make([]byte, 1024)
|
buf := make([]byte, 1024)
|
||||||
|
|
||||||
LOOP:
|
LOOP:
|
||||||
for indexR := 0; indexR < pingOption.GetRetry(); indexR++ {
|
for indexR := 0; indexR < pingOption.GetCount(); indexR++ {
|
||||||
startTime := time.Now()
|
startTime := time.Now()
|
||||||
matchCtx.InitAttribute()
|
matchCtx.InitAttribute()
|
||||||
packetCount := _matcher.PacketCount(matchCtx)
|
packetCount := _matcher.PacketCount(matchCtx)
|
||||||
|
|
|
@ -43,7 +43,7 @@ func TestPing(t *testing.T) {
|
||||||
"HTTP",
|
"HTTP",
|
||||||
),
|
),
|
||||||
pingOption: &ounp.PingOption{
|
pingOption: &ounp.PingOption{
|
||||||
Retry: 3,
|
Count: 3,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -74,7 +74,7 @@ func Test_processPrepacket(t *testing.T) {
|
||||||
args args
|
args args
|
||||||
want ounp.Result
|
want ounp.Result
|
||||||
}{
|
}{
|
||||||
// TODO: Add test cases.
|
// TODO: Add test cases.
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
@ -97,7 +97,7 @@ func Test_processPostpacket(t *testing.T) {
|
||||||
args args
|
args args
|
||||||
want ounp.Result
|
want ounp.Result
|
||||||
}{
|
}{
|
||||||
// TODO: Add test cases.
|
// TODO: Add test cases.
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
@ -119,7 +119,7 @@ func Test_getConnection(t *testing.T) {
|
||||||
want net.Conn
|
want net.Conn
|
||||||
wantErr bool
|
wantErr bool
|
||||||
}{
|
}{
|
||||||
// TODO: Add test cases.
|
// TODO: Add test cases.
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user