Skip to content

Commit

Permalink
Fix ping checking for memif
Browse files Browse the repository at this point in the history
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
  • Loading branch information
glazychev-art committed Jul 30, 2021
1 parent 69a4bb0 commit 70edc83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion internal/imports/imports_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions internal/tests/suite_memif_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"context"
"fmt"
"net"
"regexp"
"strings"
"time"

"git.fd.io/govpp.git/api"
Expand Down Expand Up @@ -172,7 +172,8 @@ func pingVpp(ctx context.Context, vppConn api.Connection, ipaddress string) erro
WithField("Reply", pingRsp.Reply).
WithField("duration", time.Since(now)).Debug("completed")

if regexp.MustCompile(" 0% packet loss").MatchString(pingRsp.Reply) {
if strings.Contains(pingRsp.Reply, " 0% packet loss") &&
!strings.Contains(pingRsp.Reply, " 0 sent, 0 received") {
return nil
}
return errors.New("Ping failed")
Expand Down

0 comments on commit 70edc83

Please sign in to comment.