[ovs-dev] [PATCH 4/4] ofproto/trace: Fix "unchanged" output for Final flow

YAMAMOTO Takashi yamamoto at midokura.com
Wed Mar 16 12:39:34 UTC 2016


Clear actset_output so that it can be compared via flow_equal.
Note: trace->key has actset_output == 0.

Found by OVS flow tests under development for Neutron. [1]

[1] https://review.openstack.org/#/c/235155/10/neutron/tests/functional/agent/test_ovs_flows.py@399

Signed-off-by: YAMAMOTO Takashi <yamamoto at midokura.com>
---
 ofproto/ofproto-dpif.c |  1 +
 tests/ofproto-dpif.at  | 11 +++++++++++
 2 files changed, 12 insertions(+)

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index b963ff2..6bc8a7d 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -5108,6 +5108,7 @@ ofproto_trace(struct ofproto_dpif *ofproto, struct flow *flow,
 
     error = xlate_actions(&trace.xin, &trace.xout);
     ds_put_char(ds, '\n');
+    trace.xin.flow.actset_output = 0;
     trace_format_flow(ds, 0, "Final flow", &trace);
     trace_format_megaflow(ds, 0, "Megaflow", &trace);
 
diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index bf6661d..34297f5 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -7403,3 +7403,14 @@ dpif_netdev|DBG|flow_add: recirc_id=0,in_port=1,vlan_tci=0xf063/0x1000,dl_type=0
 ])
 OVS_VSWITCHD_STOP
 AT_CLEANUP
+
+AT_SETUP([ofproto-dpif - trace (unchanged)])
+OVS_VSWITCHD_START
+AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1'], [0], [stdout])
+AT_CHECK([grep "Final flow:" stdout], [0], [Final flow: unchanged
+])
+AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(100)'], [0], [stdout])
+AT_CHECK([grep "Final flow:" stdout], [0], [Final flow: unchanged
+])
+OVS_VSWITCHD_STOP
+AT_CLEANUP
-- 
2.5.4 (Apple Git-61)




More information about the dev mailing list