Multiple tests were using grep such as grep 10.0.0.1, which can
hit uuid or cookies.
Using grep -F fixes those issues.
Other tests were using grep 10\.0\.0\.1, which fails for the some reason.
Using grep "10\.0\.0\.1" fixes the issue (grep -F would have been fine as well).

Signed-off-by: Xavier Simonart <[email protected]>
---
 tests/ovn-controller.at | 48 ++++++++++++++++++++---------------------
 tests/ovn.at            | 46 +++++++++++++++++++--------------------
 2 files changed, 47 insertions(+), 47 deletions(-)

diff --git a/tests/ovn-controller.at b/tests/ovn-controller.at
index fc50b6ff8..16710911b 100644
--- a/tests/ovn-controller.at
+++ b/tests/ovn-controller.at
@@ -1032,11 +1032,11 @@ reprocess_count_old=$(read_counter 
consider_logical_flow)
 check ovn-nbctl add address_set as1 addresses 10.0.0.21,10.0.0.22 -- \
                 remove address_set as1 addresses 10.0.0.10
 check ovn-nbctl --wait=hv sync
-AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep -c 10\.0\.0\.21], 
[0], [1
+AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep -c 
"10\.0\.0\.21"], [0], [1
 ])
-AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep -c 10\.0\.0\.22], 
[0], [1
+AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep -c 
"10\.0\.0\.22"], [0], [1
 ])
-AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep 10\.0\.0\.10], 
[1], [ignore])
+AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep "10\.0\.0\.10"], 
[1], [ignore])
 
 reprocess_count_new=$(read_counter consider_logical_flow)
 AT_CHECK([echo $(($reprocess_count_new - $reprocess_count_old))], [0], [0
@@ -1048,9 +1048,9 @@ reprocess_count_old=$(read_counter consider_logical_flow)
 check ovn-nbctl remove address_set as1 addresses 10.0.0.21,10.0.0.22 -- \
                 add address_set as1 addresses 10.0.0.10
 check ovn-nbctl --wait=hv sync
-AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep 10\.0\.0\.21], 
[1], [ignore])
-AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep 10\.0\.0\.22], 
[1], [ignore])
-AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep -c 10\.0\.0\.10], 
[0], [1
+AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep "10\.0\.0\.21"], 
[1], [ignore])
+AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep "10\.0\.0\.22"], 
[1], [ignore])
+AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep -c 
"10\.0\.0\.10"], [0], [1
 ])
 
 reprocess_count_new=$(read_counter consider_logical_flow)
@@ -1063,9 +1063,9 @@ reprocess_count_old=$(read_counter consider_logical_flow)
 check ovn-nbctl add address_set as1 addresses 10.0.0.21 -- \
                 remove address_set as1 addresses 10.0.0.10
 check ovn-nbctl --wait=hv sync
-AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep -c 10\.0\.0\.21], 
[0], [1
+AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep -c 
"10\.0\.0\.21"], [0], [1
 ])
-AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep 10\.0\.0\.10], 
[1], [ignore])
+AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep "10\.0\.0\.10"], 
[1], [ignore])
 
 reprocess_count_new=$(read_counter consider_logical_flow)
 AT_CHECK([echo $(($reprocess_count_new - $reprocess_count_old))], [0], [0
@@ -1077,12 +1077,12 @@ reprocess_count_old=$(read_counter 
consider_logical_flow)
 check ovn-nbctl add address_set as1 addresses 10.0.0.22,10.0.0.23 -- \
                 remove address_set as1 addresses 10.0.0.9,10.0.0.8
 check ovn-nbctl --wait=hv sync
-AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep -c 10\.0\.0\.22], 
[0], [1
+AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep -c 
"10\.0\.0\.22"], [0], [1
 ])
-AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep -c 10\.0\.0\.23], 
[0], [1
+AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep -c 
"10\.0\.0\.23"], [0], [1
 ])
-AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep 10\.0\.0\.8], 
[1], [ignore])
-AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep 10\.0\.0\.9], 
[1], [ignore])
+AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep "10\.0\.0\.8"], 
[1], [ignore])
+AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep "10\.0\.0\.9"], 
[1], [ignore])
 
 reprocess_count_new=$(read_counter consider_logical_flow)
 AT_CHECK([echo $(($reprocess_count_new - $reprocess_count_old))], [0], [0
@@ -1231,11 +1231,11 @@ reprocess_count_old=$(read_counter 
consider_logical_flow)
 check ovn-nbctl add address_set as1 addresses 10.0.0.21,10.0.0.22 -- \
                 remove address_set as1 addresses 10.0.0.10
 check ovn-nbctl --wait=hv sync
-AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep -c 10\.0\.0\.21], 
[0], [1
+AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep -c 
"10\.0\.0\.21"], [0], [1
 ])
-AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep -c 10\.0\.0\.22], 
[0], [1
+AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep -c 
"10\.0\.0\.22"], [0], [1
 ])
-AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep 10\.0\.0\.10], 
[1], [ignore])
+AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep "10\.0\.0\.10"], 
[1], [ignore])
 
 reprocess_count_new=$(read_counter consider_logical_flow)
 AT_CHECK([echo $(($reprocess_count_new - $reprocess_count_old))], [0], [0
@@ -1247,9 +1247,9 @@ reprocess_count_old=$(read_counter consider_logical_flow)
 check ovn-nbctl remove address_set as1 addresses 10.0.0.21,10.0.0.22 -- \
                 add address_set as1 addresses 10.0.0.10
 check ovn-nbctl --wait=hv sync
-AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep 10\.0\.0\.21], 
[1], [ignore])
-AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep 10\.0\.0\.22], 
[1], [ignore])
-AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep -c 10\.0\.0\.10], 
[0], [1
+AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep "10\.0\.0\.21"], 
[1], [ignore])
+AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep "10\.0\.0\.22"], 
[1], [ignore])
+AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep -c 
"10\.0\.0\.10"], [0], [1
 ])
 
 reprocess_count_new=$(read_counter consider_logical_flow)
@@ -1262,9 +1262,9 @@ reprocess_count_old=$(read_counter consider_logical_flow)
 check ovn-nbctl add address_set as1 addresses 10.0.0.21 -- \
                 remove address_set as1 addresses 10.0.0.10
 check ovn-nbctl --wait=hv sync
-AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep -c 10\.0\.0\.21], 
[0], [1
+AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep -c 
"10\.0\.0\.21"], [0], [1
 ])
-AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep 10\.0\.0\.10], 
[1], [ignore])
+AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep "10\.0\.0\.10"], 
[1], [ignore])
 
 reprocess_count_new=$(read_counter consider_logical_flow)
 AT_CHECK([echo $(($reprocess_count_new - $reprocess_count_old))], [0], [0
@@ -1276,12 +1276,12 @@ reprocess_count_old=$(read_counter 
consider_logical_flow)
 check ovn-nbctl add address_set as1 addresses 10.0.0.22,10.0.0.23 -- \
                 remove address_set as1 addresses 10.0.0.9,10.0.0.8
 check ovn-nbctl --wait=hv sync
-AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep -c 10\.0\.0\.22], 
[0], [1
+AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep -c 
"10\.0\.0\.22"], [0], [1
 ])
-AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep -c 10\.0\.0\.23], 
[0], [1
+AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep -c 
"10\.0\.0\.23"], [0], [1
 ])
-AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep 10\.0\.0\.8], 
[1], [ignore])
-AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep 10\.0\.0\.9], 
[1], [ignore])
+AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep "10\.0\.0\.8"], 
[1], [ignore])
+AT_CHECK([ovs-ofctl dump-flows br-int table=$acl_eval | grep "10\.0\.0\.9"], 
[1], [ignore])
 
 reprocess_count_new=$(read_counter consider_logical_flow)
 AT_CHECK([echo $(($reprocess_count_new - $reprocess_count_old))], [0], [0
diff --git a/tests/ovn.at b/tests/ovn.at
index 311393bd8..2dd0dfd2e 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -8358,7 +8358,7 @@ AT_FAIL_IF([test -s vif2.packets])
 check ovn-nbctl --wait=sb lr-policy-add R1 20 "ip6.src==2001::/64 && 
ip6.dst==2002::/64" allow
 
 # Check logical flow
-AT_CHECK([ovn-sbctl dump-flows | grep lr_in_policy | grep "2001" -c], [0], [dnl
+AT_CHECK([ovn-sbctl dump-flows | grep lr_in_policy | grep -F "2001" -c], [0], 
[dnl
 2
 ])
 
@@ -8386,7 +8386,7 @@ check ovn-nbctl --wait=sb lr-policy-add R1 30 
"ip6.src==2001::/64 && ip6.dst==20
 
 # Check logical flow
 AT_CHECK([ovn-sbctl dump-flows | grep lr_in_policy | \
-    grep "2001" | \
+    grep -F "2001" | \
     grep "priority=30" -c], [0], [dnl
 1
 ])
@@ -20477,21 +20477,21 @@ for i in 1 2 3; do
     ovn-nbctl --wait=hv acl-add ls1 to-lport 200 \
             'outport=="lp1" && ip4 && ip4.src == {$as1, $as2}' allow-related
     ovn-nbctl --wait=hv set addr as1 addresses="10.1.2.10"
-    AT_CHECK([ovs-ofctl dump-flows br-int | grep "10.1.2.10"], [0], [ignore])
+    AT_CHECK([ovs-ofctl dump-flows br-int | grep -F "10.1.2.10"], [0], 
[ignore])
 
     # Update address set as1
     ovn-nbctl --wait=hv set addr as1 addresses="10.1.2.10 10.1.2.11"
-    AT_CHECK([ovs-ofctl dump-flows br-int | grep "10.1.2.11"], [0], [ignore])
+    AT_CHECK([ovs-ofctl dump-flows br-int | grep -F "10.1.2.11"], [0], 
[ignore])
 
     # Update address set as2
     ovn-nbctl --wait=hv set addr as2 addresses="10.1.2.12 10.1.2.13"
-    AT_CHECK([ovs-ofctl dump-flows br-int | grep "10.1.2.12"], [0], [ignore])
+    AT_CHECK([ovs-ofctl dump-flows br-int | grep -F "10.1.2.12"], [0], 
[ignore])
 
     # Add another ACL referencing as1
-    n_flows_before=`ovs-ofctl dump-flows br-int | grep "10.1.2.10" | wc -l`
+    n_flows_before=`ovs-ofctl dump-flows br-int | grep -F "10.1.2.10" | wc -l`
     ovn-nbctl --wait=hv acl-add ls1 to-lport 200 \
             'outport=="lp2" && ip4 && ip4.src == $as1' allow-related
-    n_flows_after=`ovs-ofctl dump-flows br-int | grep "10.1.2.10" | wc -l`
+    n_flows_after=`ovs-ofctl dump-flows br-int | grep -F "10.1.2.10" | wc -l`
     AT_CHECK([test $(expr $n_flows_before \* 2) = $n_flows_after], [0], 
[ignore])
 
     # Trigger full recompute. Creating a chassis would trigger full recompute.
@@ -20501,7 +20501,7 @@ for i in 1 2 3; do
     # Remove an ACL
     ovn-nbctl --wait=hv acl-del ls1 to-lport 200 \
             'outport=="lp2" && ip4 && ip4.src == $as1'
-    n_flows_after=`ovs-ofctl dump-flows br-int | grep "10.1.2.10" | wc -l`
+    n_flows_after=`ovs-ofctl dump-flows br-int | grep -F "10.1.2.10" | wc -l`
     AT_CHECK([test $n_flows_before = $n_flows_after], [0], [ignore])
 
     # Remove as1 while it is still used by an ACL, the lflows should be 
reparsed and
@@ -20511,16 +20511,16 @@ for i in 1 2 3; do
     ovn-nbctl --wait=hv destroy addr $as1_uuid
     echo "after del as1"
     ovn-nbctl list addr | grep as1
-    AT_CHECK([ovs-ofctl dump-flows br-int | grep "10.1.2.10"], [1], [ignore])
-    AT_CHECK([ovs-ofctl dump-flows br-int | grep "10.1.2.12"], [1], [ignore])
+    AT_CHECK([ovs-ofctl dump-flows br-int | grep -F "10.1.2.10"], [1], 
[ignore])
+    AT_CHECK([ovs-ofctl dump-flows br-int | grep -F "10.1.2.12"], [1], 
[ignore])
 
     # Recreate as1
     as1_uuid=`ovn-nbctl --wait=hv create addr name=as1`
-    AT_CHECK([ovs-ofctl dump-flows br-int | grep "10.1.2.12"], [0], [ignore])
+    AT_CHECK([ovs-ofctl dump-flows br-int | grep -F "10.1.2.12"], [0], 
[ignore])
 
     # Remove ACLs and address sets
     ovn-nbctl --wait=hv destroy addr $as1_uuid -- destroy addr $as2_uuid
-    AT_CHECK([ovs-ofctl dump-flows br-int | grep "10.1.2.12"], [1], [ignore])
+    AT_CHECK([ovs-ofctl dump-flows br-int | grep -F "10.1.2.12"], [1], 
[ignore])
 
     ovn-nbctl --wait=hv acl-del ls1
 done
@@ -28800,8 +28800,8 @@ OVN_POPULATE_ARP
 wait_for_ports_up
 ovn-nbctl --wait=hv sync
 
-AT_CHECK([ovn-sbctl lflow-list | grep lr_in_arp_resolve | grep 10.0.0.1], [1], 
[])
-AT_CHECK([ovn-sbctl lflow-list | grep lr_in_arp_resolve | grep 10.0.0.2], [1], 
[])
+AT_CHECK([ovn-sbctl lflow-list | grep lr_in_arp_resolve | grep -F 10.0.0.1], 
[1], [])
+AT_CHECK([ovn-sbctl lflow-list | grep lr_in_arp_resolve | grep -F 10.0.0.2], 
[1], [])
 
 # Send ip packets from p1 to p2
 src_mac="f00000000102"
@@ -29158,7 +29158,7 @@ arp_resolve=$(ovn-debug lflow-stage-to-oftable 
lr_in_arp_resolve)
 sw_key=$(ovn-sbctl --bare --columns tunnel_key list datapath_binding r1)
 
 echo sw_key: $sw_key
-AT_CHECK([ovn-sbctl lflow-list | grep lr_in_arp_resolve | grep 10.0.1.1], [1], 
[])
+AT_CHECK([ovn-sbctl lflow-list | grep lr_in_arp_resolve | grep -F 10.0.1.1], 
[1], [])
 
 # Send ip packets from p1 to lrp-r1-ext
 src_mac="f00000000102"
@@ -32490,7 +32490,7 @@ ovn-nbctl lr-route-add lr1 20.0.0.0/24 discard
 ovn-nbctl --wait=hv sync
 
 # Check logical flows for drop rule
-AT_CHECK([ovn-sbctl dump-flows | grep lr_in_ip_routing | grep "20.0.0.0/24" | \
+AT_CHECK([ovn-sbctl dump-flows | grep lr_in_ip_routing | grep -F "20.0.0.0/24" 
| \
     grep drop | wc -l], [0], [dnl
 1
 ])
@@ -33201,15 +33201,15 @@ check ovn-nbctl --wait=hv sync
 arp_rsp=$(ovn-debug lflow-stage-to-oftable ls_in_arp_rsp)
 
 # hv0 should see flows for lsp1 but not lsp2
-AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=$arp_rsp | grep 10.0.1.2], 
[0], [ignore])
-AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=$arp_rsp | grep 10.0.2.2], 
[1])
+AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=$arp_rsp | grep -F 
10.0.1.2], [0], [ignore])
+AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=$arp_rsp | grep -F 
10.0.2.2], [1])
 # hv2 should see flows for lsp2 but not lsp1
-AT_CHECK([as hv2 ovs-ofctl dump-flows br-int table=$arp_rsp | grep 10.0.2.2], 
[0], [ignore])
-AT_CHECK([as hv2 ovs-ofctl dump-flows br-int table=$arp_rsp | grep 10.0.1.2], 
[1])
+AT_CHECK([as hv2 ovs-ofctl dump-flows br-int table=$arp_rsp | grep -F 
10.0.2.2], [0], [ignore])
+AT_CHECK([as hv2 ovs-ofctl dump-flows br-int table=$arp_rsp | grep -F 
10.0.1.2], [1])
 
 # Change lrp_lr_ls1 to a regular lrp, hv2 should see flows for lsp1
 check ovn-nbctl --wait=hv lrp-del-gateway-chassis lrp_lr_ls1 hv1
-AT_CHECK([as hv2 ovs-ofctl dump-flows br-int table=$arp_rsp | grep 10.0.1.2], 
[0], [ignore])
+AT_CHECK([as hv2 ovs-ofctl dump-flows br-int table=$arp_rsp | grep -F 
10.0.1.2], [0], [ignore])
 
 # Change it back, and trigger recompute to make sure extra flows are removed
 # from hv2 (recompute is needed because currently I-P adds local datapaths but
@@ -33217,11 +33217,11 @@ AT_CHECK([as hv2 ovs-ofctl dump-flows br-int 
table=$arp_rsp | grep 10.0.1.2], [0
 check ovn-nbctl --wait=hv lrp-set-gateway-chassis lrp_lr_ls1 hv1 1
 as hv2 check ovn-appctl -t ovn-controller recompute
 ovn-nbctl --wait=hv sync
-AT_CHECK([as hv2 ovs-ofctl dump-flows br-int table=$arp_rsp | grep 10.0.1.2], 
[1])
+AT_CHECK([as hv2 ovs-ofctl dump-flows br-int table=$arp_rsp | grep -F 
10.0.1.2], [1])
 
 # Enable dnat_and_snat on lr, and now hv2 should see flows for lsp1.
 AT_CHECK([ovn-nbctl --wait=hv --gateway-port=lrp_lr_ls1 lr-nat-add lr 
dnat_and_snat 192.168.0.1 10.0.1.3 lsp1 f0:00:00:00:00:03])
-AT_CHECK([as hv2 ovs-ofctl dump-flows br-int table=$arp_rsp | grep 10.0.1.2], 
[0], [ignore])
+AT_CHECK([as hv2 ovs-ofctl dump-flows br-int table=$arp_rsp | grep -F 
10.0.1.2], [0], [ignore])
 
 OVN_CLEANUP([hv1],[hv2])
 AT_CLEANUP
-- 
2.31.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to