@@ -35517,6 +35517,22 @@ m4_define([MULTIPLE_OVS_INT],
35517
35517
sed -e 's/n_bytes=[[0-9]]*, //g'
35518
35518
}
35519
35519
35520
+ WAIT_UNTIL_FLOWS()
35521
+ {
35522
+ cookie=${1}
35523
+ interface=${2}
35524
+ OVS_WAIT_UNTIL([
35525
+ ofport=$(ovs-vsctl --bare --columns ofport find Interface name=$interface)
35526
+ ovs-ofctl dump-flows br-int | grep "cookie=$cookie" | grep "actions=output:$ofport"
35527
+ ])
35528
+ }
35529
+
35530
+ get_nb_flows()
35531
+ {
35532
+ cookie=${1}
35533
+ ovs-ofctl dump-flows br-int | grep -c "cookie=$cookie"
35534
+ }
35535
+
35520
35536
check ovn-nbctl ls-add ls
35521
35537
check ovn-nbctl lsp-add ls lp
35522
35538
if test X$1 != X; then
@@ -35540,13 +35556,11 @@ m4_define([MULTIPLE_OVS_INT],
35540
35556
echo ======================================================
35541
35557
echo === Flows after iface-id set for the old interface ===
35542
35558
echo ======================================================
35543
- COOKIE=$(ovn-sbctl find port_binding logical_port=lp|grep uuid|cut -d: -f2| cut -c1-8 | sed 's/^\s*0\{0,8\}//' )
35559
+ COOKIE=$(ovn-debug uuid-to-cookie $(fetch_column port_binding _uuid logical_port=lp) )
35544
35560
35545
- OVS_WAIT_UNTIL([
35546
- ofport=$(ovs-vsctl --bare --columns ofport find Interface name=lpold)
35547
- ovs-ofctl dump-flows br-int | grep $COOKIE | grep "actions=output:$ofport"
35548
- ])
35549
- nb_flows=`ovs-ofctl dump-flows br-int | grep $COOKIE | wc -l`
35561
+ WAIT_UNTIL_FLOWS $COOKIE lpold
35562
+
35563
+ nb_flows=$(get_nb_flows $COOKIE )
35550
35564
echo $nb_flows "flows after iface-id set for old interface"
35551
35565
35552
35566
echo ======================================================
@@ -35555,11 +35569,8 @@ m4_define([MULTIPLE_OVS_INT],
35555
35569
# Set external_ids:iface-id within same transaction as adding the port.
35556
35570
# This will generally cause ovn-controller to get initially notified of ovs interface changes with ofport == 0.
35557
35571
check ovs-vsctl add-port br-int lpnew -- set interface lpnew type=internal -- set interface lpnew external_ids:iface-id=lp
35558
- OVS_WAIT_UNTIL([
35559
- ofport=$(ovs-vsctl --bare --columns ofport find Interface name=lpnew)
35560
- ovs-ofctl dump-flows br-int | grep $COOKIE | grep "actions=output:$ofport"
35561
- ])
35562
- check test "$nb_flows" = $(ovs-ofctl dump-flows br-int | grep $COOKIE | wc -l)
35572
+ WAIT_UNTIL_FLOWS $COOKIE lpnew
35573
+ check test "$nb_flows" = $(get_nb_flows $COOKIE)
35563
35574
flows_lpnew=$(get_flows $COOKIE)
35564
35575
35565
35576
echo ======================================================
@@ -35568,7 +35579,7 @@ m4_define([MULTIPLE_OVS_INT],
35568
35579
check ovs-vsctl del-port br-int lpold
35569
35580
# We do not expect changes, so let's wait for controller to get time to process any update
35570
35581
check ovn-nbctl --wait=hv sync
35571
- check test "$nb_flows" = $(ovs-ofctl dump-flows br-int | grep $COOKIE | wc -l )
35582
+ check test "$nb_flows" = $(get_nb_flows $COOKIE)
35572
35583
flows_after_deletion=$(get_flows $COOKIE)
35573
35584
check test "$flows_lpnew" = "$flows_after_deletion"
35574
35585
@@ -35579,23 +35590,15 @@ m4_define([MULTIPLE_OVS_INT],
35579
35590
# This will generally cause ovn-controller to get notified of ovs interface changes with a proper ofport.
35580
35591
check ovs-vsctl add-port br-int lptemp -- set Interface lptemp type=internal
35581
35592
check ovs-vsctl set Interface lptemp external_ids:iface-id=lp
35582
- OVS_WAIT_UNTIL([
35583
- ofport=$(ovs-vsctl --bare --columns ofport find Interface name=lptemp)
35584
- ovs-ofctl dump-flows br-int | grep $COOKIE | grep "actions=output:$ofport"
35585
- ])
35586
- check test "$nb_flows" = $(ovs-ofctl dump-flows br-int | grep $COOKIE | wc -l)
35593
+ WAIT_UNTIL_FLOWS $COOKIE lptemp
35594
+ check test "$nb_flows" = $(get_nb_flows $COOKIE)
35587
35595
35588
35596
echo ======================================================
35589
35597
echo ======= Flows after lptemp interface is deleted ======
35590
35598
echo ======================================================
35591
35599
check ovs-vsctl del-port br-int lptemp
35592
- OVS_WAIT_UNTIL([
35593
- ofport=$(ovs-vsctl --bare --columns ofport find Interface name=lpnew)
35594
- echo $ofport
35595
- ovs-ofctl dump-flows br-int | grep $COOKIE
35596
- ovs-ofctl dump-flows br-int | grep $COOKIE | grep "actions=output:$ofport"
35597
- ])
35598
- check test "$nb_flows" = $(ovs-ofctl dump-flows br-int | grep $COOKIE | wc -l)
35600
+ WAIT_UNTIL_FLOWS $COOKIE lpnew
35601
+ check test "$nb_flows" = $(get_nb_flows $COOKIE)
35599
35602
flows_after_deletion=$(get_flows $COOKIE)
35600
35603
check test "$flows_lpnew" = "$flows_after_deletion"
35601
35604
@@ -35604,7 +35607,7 @@ m4_define([MULTIPLE_OVS_INT],
35604
35607
echo ======================================================
35605
35608
check ovs-vsctl del-port br-int lpnew
35606
35609
OVS_WAIT_UNTIL([
35607
- nb_flows=`ovs-ofctl dump-flows br-int | grep $COOKIE | wc -l `
35610
+ nb_flows=`get_nb_flows $COOKIE`
35608
35611
test "${nb_flows}" = $nb_flows_ref
35609
35612
])
35610
35613
@@ -35617,21 +35620,15 @@ m4_define([MULTIPLE_OVS_INT],
35617
35620
check ovs-vsctl set interface lpnew external_ids:iface-id=lp
35618
35621
35619
35622
# Wait for lpnew flows to be installed
35620
- OVS_WAIT_UNTIL([
35621
- ofport=$(ovs-vsctl --bare --columns ofport find Interface name=lpnew)
35622
- ovs-ofctl dump-flows br-int | grep $COOKIE | grep "actions=output:$ofport"
35623
- ])
35623
+ WAIT_UNTIL_FLOWS $COOKIE lpnew
35624
35624
flows_lpnew=$(get_flows $COOKIE)
35625
- nb_flows=`ovs-ofctl dump-flows br-int | grep $COOKIE | wc -l `
35625
+ nb_flows=`get_nb_flows $COOKIE`
35626
35626
35627
35627
check ovs-vsctl add-port br-int lptemp -- set Interface lptemp type=internal
35628
35628
check ovs-vsctl set Interface lptemp external_ids:iface-id=lp
35629
35629
35630
35630
# Wait for lptemp flows to be installed
35631
- OVS_WAIT_UNTIL([
35632
- ofport=$(ovs-vsctl --bare --columns ofport find Interface name=lptemp)
35633
- ovs-ofctl dump-flows br-int | grep $COOKIE | grep "actions=output:$ofport"
35634
- ])
35631
+ WAIT_UNTIL_FLOWS $COOKIE lptemp
35635
35632
35636
35633
# Delete both lpold and lptemp to go to a stable situation
35637
35634
check ovs-vsctl del-port br-int lptemp
@@ -35642,21 +35639,15 @@ m4_define([MULTIPLE_OVS_INT],
35642
35639
])
35643
35640
35644
35641
# Wait for correct/lpnew flows to be installed
35645
- OVS_WAIT_UNTIL([
35646
- ofport=$(ovs-vsctl --bare --columns ofport find Interface name=lpnew)
35647
- ovs-ofctl dump-flows br-int | grep $COOKIE | grep "actions=output:$ofport"
35648
- ])
35649
- check test "$nb_flows" = $(ovs-ofctl dump-flows br-int | grep $COOKIE | wc -l)
35642
+ WAIT_UNTIL_FLOWS $COOKIE lpnew
35643
+ check test "$nb_flows" = $(get_nb_flows $COOKIE)
35650
35644
flows_after_deletion=$(get_flows $COOKIE)
35651
35645
check test "$flows_lpnew" = "$flows_after_deletion"
35652
35646
35653
35647
# Check that recompute still works
35654
35648
check ovn-appctl -t ovn-controller recompute
35655
- OVS_WAIT_UNTIL([
35656
- ofport=$(ovs-vsctl --bare --columns ofport find Interface name=lpnew)
35657
- ovs-ofctl dump-flows br-int | grep $COOKIE | grep "actions=output:$ofport"
35658
- ])
35659
- check test "$nb_flows" = $(ovs-ofctl dump-flows br-int | grep $COOKIE | wc -l)
35649
+ WAIT_UNTIL_FLOWS $COOKIE lpnew
35650
+ check test "$nb_flows" = $(get_nb_flows $COOKIE)
35660
35651
flows_after_deletion=$(get_flows $COOKIE)
35661
35652
check test "$flows_lpnew" = "$flows_after_deletion"
35662
35653
0 commit comments