Skip to content

Commit

Permalink
fix(e2e): dump flows with prefix "cookie="
Browse files Browse the repository at this point in the history
Signed-off-by: zwtop <[email protected]>
  • Loading branch information
zwtop committed Jun 29, 2022
1 parent b46c3bc commit 08b5ff1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/e2e/framework/node/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (n *Agent) Healthz() (bool, error) {
return n.checkProcess(agentBinaryName)
}

// dump the flows and parse the Output
// DumpFlow dumps the flows and parse the Output
func (n *Agent) DumpFlow() ([]string, error) {
flowDump, err := n.runOpenflowCmd("dump-flows")
if err != nil {
Expand All @@ -57,8 +57,11 @@ func (n *Agent) DumpFlow() ([]string, error) {

var flowList []string
for _, flow := range flowDB {
if !strings.HasPrefix(flow, " cookie=") {
continue
}
felem := strings.Fields(flow)
if len(felem) > 2 {
if len(felem) >= 5 {
felem = append([]string{felem[2]}, felem[5:]...)
fstr := strings.Join(felem, " ")
flowList = append(flowList, fstr)
Expand Down

0 comments on commit 08b5ff1

Please sign in to comment.