From 8c0b419a0b9ac0141d6973dcc80306dfc6a83d31 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 16 Mar 2016 10:55:48 +0000 Subject: [PATCH] ofproto/trace: Fix "unchanged" output for Final flow 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 Acked-by: Ben Pfaff --- 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 5a65020d19c..83dcc9c0b08 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -5063,6 +5063,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 689aec037ec..7cfd6bff2dc 100644 --- a/tests/ofproto-dpif.at +++ b/tests/ofproto-dpif.at @@ -7216,3 +7216,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