On Thu, May 18, 2023 at 3:09 PM Mark Michelson <mmich...@redhat.com> wrote: > > Thanks Ales, > > This looks good to me. > > Acked-by: Mark Michelson <mmich...@redhat.com>
Thanks. I applied the patch to branch-21.12. Numan > > On 5/18/23 09:26, Ales Musil wrote: > > Bump submodule to v2.17.6 specifically for: > > 1989caf9ea5e ("ovsdb-idl: Preserve references for rows deleted in same IDL > > run as their insertion.") > > > > with additional test from: > > c18415d5ae72 ("ovs: Bump submodule to tip of branch-3.0 and add related > > test") > > > > This commit is combination of multiple cherry-picks > > because they woldn't pass CI standalone. > > The parts of following commits are included in this one: > > ebd6bdd3e343 ("tests: Fix tests/check_acl_log.py outputs.") > > e06c34255662 ("tests: Avoid matching on the OVS flow key contents.") > > > > Reported-at: https://bugzilla.redhat.com/2163559 > > Signed-off-by: Ales Musil <amu...@redhat.com> > > --- > > ovs | 2 +- > > tests/check_acl_log.py | 16 +++++---- > > tests/ofproto-macros.at | 8 +++++ > > tests/ovn-macros.at | 16 +++++++++ > > tests/ovn-northd.at | 73 ++++++++++++++--------------------------- > > tests/ovn.at | 64 ++++++++++++------------------------ > > 6 files changed, 80 insertions(+), 99 deletions(-) > > > > diff --git a/ovs b/ovs > > index 45ecaa9e5..a08bb41e3 160000 > > --- a/ovs > > +++ b/ovs > > @@ -1 +1 @@ > > -Subproject commit 45ecaa9e574d63496e54a4093128302e2c2e10d0 > > +Subproject commit a08bb41e3c381f695b5ab62b0ab49b39c2b98727 > > diff --git a/tests/check_acl_log.py b/tests/check_acl_log.py > > index 1dd9630c0..0c1968b2e 100644 > > --- a/tests/check_acl_log.py > > +++ b/tests/check_acl_log.py > > @@ -37,13 +37,14 @@ def parse_acl_log(line): > > > > def get_acl_log(entry_num=1): > > with open("ovn-controller.log", "r") as controller_log: > > - acl_logs = [line for line in controller_log if "acl_log" in line] > > + acl_logs = [line.rstrip() for line in controller_log > > + if "acl_log" in line] > > try: > > return acl_logs[entry_num - 1] > > except IndexError: > > print( > > - f"There were not {entry_num} acl_log entries, \ > > - only {len(acl_logs)}" > > + f"There were not {entry_num} acl_log entries, " > > + f"only {len(acl_logs)}" > > ) > > exit(1) > > > > @@ -91,14 +92,15 @@ def main(): > > try: > > if parsed_log[key] != val: > > print( > > - f"Expected log {key}={val} but got > > {key}={parsed_log[key]} \ > > - in:\n\t'{acl_log}" > > + f"Expected log {key}={val} but got " > > + f"{key}={parsed_log[key]} " > > + f"in:\n\t'{acl_log}'" > > ) > > exit(1) > > except KeyError: > > print( > > - f"Expected log {key}={val} but {key} does not exist \ > > - in:\n\t'{acl_log}'" > > + f"Expected log {key}={val} but {key} does not exist in:\n" > > + f"\t'{acl_log}'" > > ) > > exit(1) > > > > diff --git a/tests/ofproto-macros.at b/tests/ofproto-macros.at > > index 23d793a95..2e0bbd20b 100644 > > --- a/tests/ofproto-macros.at > > +++ b/tests/ofproto-macros.at > > @@ -18,6 +18,14 @@ s/cookie=0x[0-9a-fA-F]*,// > > ' > > } > > > > +# Strips 'nw_frag=yes|no' from ovs-ofctl (or similar) output. > > +strip_nw_frag () { > > + sed ' > > +s/nw_frag=yes,// > > +s/nw_frag=no,// > > +' > > +} > > + > > # Strips out uninteresting parts of ovs-ofctl output, as well as parts > > # that vary from one run to another. > > ofctl_strip () { > > diff --git a/tests/ovn-macros.at b/tests/ovn-macros.at > > index 96d3ca0e7..9537ac6ed 100644 > > --- a/tests/ovn-macros.at > > +++ b/tests/ovn-macros.at > > @@ -557,6 +557,22 @@ netdev_dummy_receive() { > > fi > > } > > > > +# Wrapper on top of ovn-trace, stripping some things and storing the trace > > +# output to a file called 'trace'. For now it strips the rows starting > > +# with a '#'. This should correspond to the flow key and might be > > displayed > > +# differently by different OVS library versions. > > +ovn_trace() { > > + AT_CAPTURE_FILE([trace]) > > + ovn-trace "$@" | tee trace | sed '/^# /d' > > +} > > + > > +# Same as ovn_trace() except that it connects to an ovn-trace daemon. > > +ovn_trace_client() { > > + target=$1; shift > > + AT_CAPTURE_FILE([trace]) > > + ovs-appctl -t $target trace "$@" | tee trace | sed '/^# /d' > > +} > > + > > OVS_END_SHELL_HELPERS > > > > m4_define([OVN_POPULATE_ARP], [AT_CHECK(ovn_populate_arp__, [0], > > [ignore])]) > > diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at > > index 7bf34c49b..ed60a2eaf 100644 > > --- a/tests/ovn-northd.at > > +++ b/tests/ovn-northd.at > > @@ -2865,8 +2865,7 @@ lsp1_inport=$(fetch_column Port_Binding tunnel_key > > logical_port=lsp1) > > > > # TCP packets should go to conntrack. > > flow="inport == \"lsp1\" && ${flow_eth} && ${flow_ip} && ${flow_tcp}" > > -AT_CHECK_UNQUOTED([ovn-trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > -# > > tcp,reg14=0x${lsp1_inport},vlan_tci=0x0000,dl_src=00:00:00:00:00:01,dl_dst=00:00:00:00:00:02,nw_src=42.42.42.1,nw_dst=66.66.66.66,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=80,tcp_flags=0 > > +AT_CHECK_UNQUOTED([ovn_trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > ct_next(ct_state=new|trk) { > > ct_next(ct_state=new|trk) { > > output("lsp2"); > > @@ -2876,8 +2875,7 @@ ct_next(ct_state=new|trk) { > > > > # UDP packets should go to conntrack. > > flow="inport == \"lsp1\" && ${flow_eth} && ${flow_ip} && ${flow_udp}" > > -AT_CHECK_UNQUOTED([ovn-trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > -# > > udp,reg14=0x${lsp1_inport},vlan_tci=0x0000,dl_src=00:00:00:00:00:01,dl_dst=00:00:00:00:00:02,nw_src=42.42.42.1,nw_dst=66.66.66.66,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=80 > > +AT_CHECK_UNQUOTED([ovn_trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > ct_next(ct_state=new|trk) { > > ct_next(ct_state=new|trk) { > > output("lsp2"); > > @@ -2893,15 +2891,13 @@ ovn-nbctl --wait=sb sync > > > > # TCP packets should not go to conntrack anymore. > > flow="inport == \"lsp1\" && ${flow_eth} && ${flow_ip} && ${flow_tcp}" > > -AT_CHECK_UNQUOTED([ovn-trace --minimal ls "${flow}"], [0], [dnl > > -# > > tcp,reg14=0x${lsp1_inport},vlan_tci=0x0000,dl_src=00:00:00:00:00:01,dl_dst=00:00:00:00:00:02,nw_src=42.42.42.1,nw_dst=66.66.66.66,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=80,tcp_flags=0 > > +AT_CHECK_UNQUOTED([ovn_trace --minimal ls "${flow}"], [0], [dnl > > output("lsp2"); > > ]) > > > > # UDP packets still go to conntrack. > > flow="inport == \"lsp1\" && ${flow_eth} && ${flow_ip} && ${flow_udp}" > > -AT_CHECK_UNQUOTED([ovn-trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > -# > > udp,reg14=0x${lsp1_inport},vlan_tci=0x0000,dl_src=00:00:00:00:00:01,dl_dst=00:00:00:00:00:02,nw_src=42.42.42.1,nw_dst=66.66.66.66,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=80 > > +AT_CHECK_UNQUOTED([ovn_trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > ct_next(ct_state=new|trk) { > > ct_next(ct_state=new|trk) { > > output("lsp2"); > > @@ -2921,8 +2917,7 @@ ovn-nbctl --wait=sb sync > > > > # TCP packets should go to conntrack. > > flow="inport == \"lsp1\" && ${flow_eth} && ${flow_ip} && ${flow_tcp}" > > -AT_CHECK_UNQUOTED([ovn-trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > -# > > tcp,reg14=0x${lsp1_inport},vlan_tci=0x0000,dl_src=00:00:00:00:00:01,dl_dst=00:00:00:00:00:02,nw_src=42.42.42.1,nw_dst=66.66.66.66,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=80,tcp_flags=0 > > +AT_CHECK_UNQUOTED([ovn_trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > ct_lb_mark { > > ct_lb_mark { > > reg0[[6]] = 0; > > @@ -2937,8 +2932,7 @@ ct_lb_mark { > > > > # UDP packets should go to conntrack. > > flow="inport == \"lsp1\" && ${flow_eth} && ${flow_ip} && ${flow_udp}" > > -AT_CHECK_UNQUOTED([ovn-trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > -# > > udp,reg14=0x${lsp1_inport},vlan_tci=0x0000,dl_src=00:00:00:00:00:01,dl_dst=00:00:00:00:00:02,nw_src=42.42.42.1,nw_dst=66.66.66.66,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=80 > > +AT_CHECK_UNQUOTED([ovn_trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > ct_lb_mark { > > ct_lb_mark { > > reg0[[6]] = 0; > > @@ -2959,8 +2953,7 @@ ovn-nbctl --wait=sb sync > > > > # TCP packets should go to conntrack for load balancing. > > flow="inport == \"lsp1\" && ${flow_eth} && ${flow_ip} && ${flow_tcp}" > > -AT_CHECK_UNQUOTED([ovn-trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > -# > > tcp,reg14=0x${lsp1_inport},vlan_tci=0x0000,dl_src=00:00:00:00:00:01,dl_dst=00:00:00:00:00:02,nw_src=42.42.42.1,nw_dst=66.66.66.66,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=80,tcp_flags=0 > > +AT_CHECK_UNQUOTED([ovn_trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > ct_lb_mark { > > ct_lb_mark { > > reg0[[6]] = 0; > > @@ -2975,8 +2968,7 @@ ct_lb_mark { > > > > # UDP packets still go to conntrack. > > flow="inport == \"lsp1\" && ${flow_eth} && ${flow_ip} && ${flow_udp}" > > -AT_CHECK_UNQUOTED([ovn-trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > -# > > udp,reg14=0x${lsp1_inport},vlan_tci=0x0000,dl_src=00:00:00:00:00:01,dl_dst=00:00:00:00:00:02,nw_src=42.42.42.1,nw_dst=66.66.66.66,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=80 > > +AT_CHECK_UNQUOTED([ovn_trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > ct_lb_mark { > > ct_lb_mark { > > reg0[[6]] = 0; > > @@ -3021,8 +3013,7 @@ flow_udp='udp && udp.dst == 80' > > > > # TCP packets should go to conntrack. > > flow="inport == \"lsp1\" && ${flow_eth} && ${flow_ip} && ${flow_tcp}" > > -AT_CHECK_UNQUOTED([ovn-trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > -# > > tcp,reg14=0x${lsp1_inport},vlan_tci=0x0000,dl_src=00:00:00:00:00:01,dl_dst=00:00:00:00:00:02,nw_src=42.42.42.1,nw_dst=66.66.66.66,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=80,tcp_flags=0 > > +AT_CHECK_UNQUOTED([ovn_trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > ct_next(ct_state=new|trk) { > > ct_next(ct_state=new|trk) { > > output("lsp2"); > > @@ -3032,8 +3023,7 @@ ct_next(ct_state=new|trk) { > > > > # UDP packets should go to conntrack. > > flow="inport == \"lsp1\" && ${flow_eth} && ${flow_ip} && ${flow_udp}" > > -AT_CHECK_UNQUOTED([ovn-trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > -# > > udp,reg14=0x${lsp1_inport},vlan_tci=0x0000,dl_src=00:00:00:00:00:01,dl_dst=00:00:00:00:00:02,nw_src=42.42.42.1,nw_dst=66.66.66.66,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=80 > > +AT_CHECK_UNQUOTED([ovn_trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > ct_next(ct_state=new|trk) { > > ct_next(ct_state=new|trk) { > > output("lsp2"); > > @@ -3049,15 +3039,13 @@ ovn-nbctl --wait=sb sync > > > > # TCP packets should not go to conntrack anymore. > > flow="inport == \"lsp1\" && ${flow_eth} && ${flow_ip} && ${flow_tcp}" > > -AT_CHECK_UNQUOTED([ovn-trace --minimal ls "${flow}"], [0], [dnl > > -# > > tcp,reg14=0x${lsp1_inport},vlan_tci=0x0000,dl_src=00:00:00:00:00:01,dl_dst=00:00:00:00:00:02,nw_src=42.42.42.1,nw_dst=66.66.66.66,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=80,tcp_flags=0 > > +AT_CHECK_UNQUOTED([ovn_trace --minimal ls "${flow}"], [0], [dnl > > output("lsp2"); > > ]) > > > > # UDP packets still go to conntrack. > > flow="inport == \"lsp1\" && ${flow_eth} && ${flow_ip} && ${flow_udp}" > > -AT_CHECK_UNQUOTED([ovn-trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > -# > > udp,reg14=0x${lsp1_inport},vlan_tci=0x0000,dl_src=00:00:00:00:00:01,dl_dst=00:00:00:00:00:02,nw_src=42.42.42.1,nw_dst=66.66.66.66,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=80 > > +AT_CHECK_UNQUOTED([ovn_trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > ct_next(ct_state=new|trk) { > > ct_next(ct_state=new|trk) { > > output("lsp2"); > > @@ -3077,8 +3065,7 @@ ovn-nbctl --wait=sb sync > > > > # TCP packets should go to conntrack. > > flow="inport == \"lsp1\" && ${flow_eth} && ${flow_ip} && ${flow_tcp}" > > -AT_CHECK_UNQUOTED([ovn-trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > -# > > tcp,reg14=0x${lsp1_inport},vlan_tci=0x0000,dl_src=00:00:00:00:00:01,dl_dst=00:00:00:00:00:02,nw_src=42.42.42.1,nw_dst=66.66.66.66,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=80,tcp_flags=0 > > +AT_CHECK_UNQUOTED([ovn_trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > ct_lb_mark { > > ct_lb_mark { > > reg0[[6]] = 0; > > @@ -3093,8 +3080,7 @@ ct_lb_mark { > > > > # UDP packets should go to conntrack. > > flow="inport == \"lsp1\" && ${flow_eth} && ${flow_ip} && ${flow_udp}" > > -AT_CHECK_UNQUOTED([ovn-trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > -# > > udp,reg14=0x${lsp1_inport},vlan_tci=0x0000,dl_src=00:00:00:00:00:01,dl_dst=00:00:00:00:00:02,nw_src=42.42.42.1,nw_dst=66.66.66.66,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=80 > > +AT_CHECK_UNQUOTED([ovn_trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > ct_lb_mark { > > ct_lb_mark { > > reg0[[6]] = 0; > > @@ -3115,8 +3101,7 @@ ovn-nbctl --wait=sb sync > > > > # TCP packets should go to conntrack for load balancing. > > flow="inport == \"lsp1\" && ${flow_eth} && ${flow_ip} && ${flow_tcp}" > > -AT_CHECK_UNQUOTED([ovn-trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > -# > > tcp,reg14=0x${lsp1_inport},vlan_tci=0x0000,dl_src=00:00:00:00:00:01,dl_dst=00:00:00:00:00:02,nw_src=42.42.42.1,nw_dst=66.66.66.66,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=80,tcp_flags=0 > > +AT_CHECK_UNQUOTED([ovn_trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > ct_lb_mark { > > ct_lb_mark { > > reg0[[6]] = 0; > > @@ -3131,8 +3116,7 @@ ct_lb_mark { > > > > # UDP packets still go to conntrack. > > flow="inport == \"lsp1\" && ${flow_eth} && ${flow_ip} && ${flow_udp}" > > -AT_CHECK_UNQUOTED([ovn-trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > -# > > udp,reg14=0x${lsp1_inport},vlan_tci=0x0000,dl_src=00:00:00:00:00:01,dl_dst=00:00:00:00:00:02,nw_src=42.42.42.1,nw_dst=66.66.66.66,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=80 > > +AT_CHECK_UNQUOTED([ovn_trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > ct_lb_mark { > > ct_lb_mark { > > reg0[[6]] = 0; > > @@ -3173,8 +3157,7 @@ lsp1_inport=$(fetch_column Port_Binding tunnel_key > > logical_port=lsp1) > > > > # TCP packets should go to conntrack. > > flow="inport == \"lsp1\" && ${flow_eth} && ${flow_ip} && ${flow_tcp}" > > -AT_CHECK_UNQUOTED([ovn-trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > -# > > tcp,reg14=0x${lsp1_inport},vlan_tci=0x0000,dl_src=00:00:00:00:00:01,dl_dst=00:00:00:00:00:02,nw_src=42.42.42.1,nw_dst=66.66.66.66,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=80,tcp_flags=0 > > +AT_CHECK_UNQUOTED([ovn_trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > ct_next(ct_state=new|trk) { > > ct_next(ct_state=new|trk) { > > output("lsp2"); > > @@ -3191,15 +3174,13 @@ ovn-nbctl --wait=sb sync > > > > # TCP packets should not go to conntrack anymore. > > flow="inport == \"lsp1\" && ${flow_eth} && ${flow_ip} && ${flow_tcp}" > > -AT_CHECK_UNQUOTED([ovn-trace --minimal ls "${flow}"], [0], [dnl > > -# > > tcp,reg14=0x${lsp1_inport},vlan_tci=0x0000,dl_src=00:00:00:00:00:01,dl_dst=00:00:00:00:00:02,nw_src=42.42.42.1,nw_dst=66.66.66.66,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=80,tcp_flags=0 > > +AT_CHECK_UNQUOTED([ovn_trace --minimal ls "${flow}"], [0], [dnl > > output("lsp2"); > > ]) > > > > # UDP packets should not go to conntrack anymore. > > flow="inport == \"lsp1\" && ${flow_eth} && ${flow_ip} && ${flow_udp}" > > -AT_CHECK_UNQUOTED([ovn-trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > -# > > udp,reg14=0x${lsp1_inport},vlan_tci=0x0000,dl_src=00:00:00:00:00:01,dl_dst=00:00:00:00:00:02,nw_src=42.42.42.1,nw_dst=66.66.66.66,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=80 > > +AT_CHECK_UNQUOTED([ovn_trace --ct new --ct new --minimal ls "${flow}"], > > [0], [dnl > > output("lsp2"); > > ]) > > > > @@ -4281,15 +4262,13 @@ check ovn-nbctl lsp-set-options lrp1-attachment > > router-port=lrp1 > > check ovn-nbctl lr-nat-add lr0 dnat 42.42.42.42 192.168.0.2 > > check ovn-nbctl --wait=sb sync > > > > -ovn-trace --minimal 'inport == "sw1-port1" && eth.src == 50:54:00:00:00:03 > > && eth.dst == 00:00:00:00:ff:02 && ip4.dst == 42.42.42.42 && ip4.src == > > 11.0.0.2 && ip.ttl == 64' > > - > > -AT_CHECK([ovn-trace --minimal 'inport == "sw1-port1" && eth.src == > > 50:54:00:00:00:03 && eth.dst == 00:00:00:00:ff:02 && ip4.dst == 42.42.42.42 > > && ip4.src == 11.0.0.2 && ip.ttl == 64' | grep "output(\"sw0-port1\")"], > > [0], [ignore]) > > +AT_CHECK([ovn_trace --minimal 'inport == "sw1-port1" && eth.src == > > 50:54:00:00:00:03 && eth.dst == 00:00:00:00:ff:02 && ip4.dst == 42.42.42.42 > > && ip4.src == 11.0.0.2 && ip.ttl == 64' | grep "output(\"sw0-port1\")"], > > [0], [ignore]) > > > > dnl If we remove the DNAT entry we will be unable to trace to the DNAT > > address > > check ovn-nbctl lr-nat-del lr0 dnat 42.42.42.42 > > check ovn-nbctl --wait=sb sync > > > > -AT_CHECK([ovn-trace --minimal 'inport == "sw1-port1" && eth.src == > > 50:54:00:00:00:03 && eth.dst == 00:00:00:00:ff:02 && ip4.dst == 42.42.42.42 > > && ip4.src == 11.0.0.2 && ip.ttl == 64' | grep "output(\"sw0-port1\")"], > > [1], [ignore]) > > +AT_CHECK([ovn_trace --minimal 'inport == "sw1-port1" && eth.src == > > 50:54:00:00:00:03 && eth.dst == 00:00:00:00:ff:02 && ip4.dst == 42.42.42.42 > > && ip4.src == 11.0.0.2 && ip.ttl == 64' | grep "output(\"sw0-port1\")"], > > [1], [ignore]) > > > > AT_CLEANUP > > ]) > > @@ -4322,13 +4301,13 @@ check ovn-nbctl lsp-set-options lrp1-attachment > > router-port=lrp1 > > check ovn-nbctl lr-nat-add lr0 dnat fd42::42 fd68::2 > > check ovn-nbctl --wait=sb sync > > > > -AT_CHECK([ovn-trace --minimal 'inport == "sw1-port1" && eth.src == > > 50:54:00:00:00:03 && eth.dst == 00:00:00:00:ff:02 && ip6.dst == fd42::42 && > > ip6.src == fd11::2 && ip.ttl == 64' | grep "output(\"sw0-port1\")"], [0], > > [ignore]) > > +AT_CHECK([ovn_trace --minimal 'inport == "sw1-port1" && eth.src == > > 50:54:00:00:00:03 && eth.dst == 00:00:00:00:ff:02 && ip6.dst == fd42::42 && > > ip6.src == fd11::2 && ip.ttl == 64' | grep "output(\"sw0-port1\")"], [0], > > [ignore]) > > > > dnl If we remove the DNAT entry we will be unable to trace to the DNAT > > address > > check ovn-nbctl lr-nat-del lr0 dnat fd42::42 > > check ovn-nbctl --wait=sb sync > > > > -AT_CHECK([ovn-trace --minimal 'inport == "sw1-port1" && eth.src == > > 50:54:00:00:00:03 && eth.dst == 00:00:00:00:ff:02 && ip6.dst == fd42::42 && > > ip6.src == fd11::2 && ip.ttl == 64' | grep "output(\"sw0-port1\")"], [1], > > [ignore]) > > +AT_CHECK([ovn_trace --minimal 'inport == "sw1-port1" && eth.src == > > 50:54:00:00:00:03 && eth.dst == 00:00:00:00:ff:02 && ip6.dst == fd42::42 && > > ip6.src == fd11::2 && ip.ttl == 64' | grep "output(\"sw0-port1\")"], [1], > > [ignore]) > > > > AT_CLEANUP > > ]) > > @@ -5964,8 +5943,7 @@ check ovn-nbctl --wait=sb sync > > > > flow="eth.dst == 00:00:00:00:01:00 && inport == \"rtr-ls\" && ip4.src == > > 42.42.42.42 && ip4.dst == 43.43.43.43 && ip.ttl == 64 && tcp && tcp.dst == > > 4343" > > > > -AT_CHECK_UNQUOTED([ovn-trace --ct new --minimal "${flow}" --lb-dst > > 42.42.42.42:4242], [0], [dnl > > -# > > tcp,reg14=0x1,vlan_tci=0x0000,dl_src=00:00:00:00:00:00,dl_dst=00:00:00:00:01:00,nw_src=42.42.42.42,nw_dst=43.43.43.43,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=4343,tcp_flags=0 > > +AT_CHECK_UNQUOTED([ovn_trace --ct new --minimal "${flow}" --lb-dst > > 42.42.42.42:4242], [0], [dnl > > ct_dnat /* assuming no un-dnat entry, so no change */ { > > ct_lb_mark /* default (use --ct to customize) */ { > > ip.ttl--; > > @@ -5982,8 +5960,7 @@ ct_dnat /* assuming no un-dnat entry, so no change */ > > { > > }; > > ]) > > > > -AT_CHECK_UNQUOTED([ovn-trace --minimal "${flow}" --lb-dst > > 42.42.42.42:4242], [0], [dnl > > -# > > tcp,reg14=0x1,vlan_tci=0x0000,dl_src=00:00:00:00:00:00,dl_dst=00:00:00:00:01:00,nw_src=42.42.42.42,nw_dst=43.43.43.43,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=4343,tcp_flags=0 > > +AT_CHECK_UNQUOTED([ovn_trace --minimal "${flow}" --lb-dst > > 42.42.42.42:4242], [0], [dnl > > ct_dnat /* assuming no un-dnat entry, so no change */ /* default (use > > --ct to customize) */; > > ]) > > > > diff --git a/tests/ovn.at b/tests/ovn.at > > index 993303036..2591763cb 100644 > > --- a/tests/ovn.at > > +++ b/tests/ovn.at > > @@ -2627,8 +2627,7 @@ test_packet() { > > echo "output(\"lp$outport\");" > > done > expout > > > > - AT_CAPTURE_FILE([trace]) > > - AT_CHECK([ovs-appctl -t ovn-trace trace --all lsw0 "$uflow" | tee > > trace | sed '1,/Minimal trace/d'], [0], [expout]) > > + AT_CHECK([ovn_trace_client ovn-trace --minimal lsw0 "$uflow"], [0], > > [expout]) > > } > > > > # test_arp INPORT SHA SPA TPA [REPLY_HA] > > @@ -2671,8 +2670,7 @@ output(\"lp$inport\"); > > " > > fi > > > > - AT_CAPTURE_FILE([trace]) > > - AT_CHECK_UNQUOTED([ovs-appctl -t ovn-trace trace --all lsw0 "$request" > > | tee trace | sed '1,/Minimal trace/d'], [0], [$reply]) > > + AT_CHECK_UNQUOTED([ovn_trace_client ovn-trace --minimal lsw0 > > "$request"], [0], [$reply]) > > } > > > > # Send packets between all pairs of source and destination ports: > > @@ -2921,8 +2919,7 @@ test_packet() { > > if test $lout != drop; then > > echo "output(\"$lout\");" > > fi > expout > > - AT_CAPTURE_FILE([trace]) > > - AT_CHECK([ovn-trace --all $(lsp_to_ls lp$inport) "$uflow" | tee trace > > | sed '1,/Minimal trace/d'], [0], [expout]) > > + AT_CHECK([ovn_trace --minimal $(lsp_to_ls lp$inport) "$uflow"], [0], > > [expout]) > > > > # Then actually send a packet, for an end-to-end test. > > local packet=$(echo $dst$src | sed 's/://g')${eth} > > @@ -3092,8 +3089,7 @@ test_packet() { > > > > # First try tracing the packet. > > uflow="inport==\"lp-$inport\" && eth.dst==$dst && eth.src==$src && > > eth.type==0x$eth" > > - AT_CAPTURE_FILE([trace]) > > - AT_CHECK([ovn-trace --all ls-${hv}0 "$uflow" | tee trace | sed > > '1,/Minimal trace/d'], [0], [expout]) > > + AT_CHECK([ovn_trace --minimal ls-${hv}0 "$uflow"], [0], [expout]) > > > > # Then actually send a packet, for an end-to-end test. > > local packet=$(echo $dst$src | sed 's/://g')${eth} > > @@ -3225,8 +3221,7 @@ test_packet() { > > > > # First try tracing the packet. > > uflow="inport==\"lp-$inport\" && eth.dst==$dst && eth.src==$src && > > eth.type==0x$eth" > > - AT_CAPTURE_FILE([trace]) > > - AT_CHECK([ovn-trace --all ls-${hv}0 "$uflow" | tee trace | sed > > '1,/Minimal trace/d' | sort], [0], [expout]) > > + AT_CHECK([ovn_trace --minimal ls-${hv}0 "$uflow" | sort], [0], > > [expout]) > > > > # Then actually send a packet, for an end-to-end test. > > local packet=$(echo $dst$src | sed 's/://g')${eth} > > @@ -3354,8 +3349,7 @@ test_packet() { > > > > # First try tracing the packet. > > uflow="inport==\"lp-$inport\" && eth.dst==$dst && eth.src==$src && > > eth.type==0x$eth" > > - AT_CAPTURE_FILE([trace]) > > - AT_CHECK([ovn-trace --all ls-$inport "$uflow" | tee trace | sed > > '1,/Minimal trace/d'], [0], [expout]) > > + AT_CHECK([ovn_trace --minimal ls-$inport "$uflow"], [0], [expout]) > > > > # Then actually send a packet, for an end-to-end test. > > local packet=$(echo $dst$src | sed 's/://g')${eth} > > @@ -3569,8 +3563,7 @@ test_packet() { > > # First try tracing the packet. > > uflow="inport==\"lsp$inport\" && eth.dst==$dst && eth.src==$src && > > eth.type==0x$eth && vlan.present==1" > > echo "output(\"$lout\");" > expout > > - AT_CAPTURE_FILE([trace]) > > - AT_CHECK([ovn-trace --all ls "$uflow" | tee trace | sed '1,/Minimal > > trace/d'], [0], [expout]) > > + AT_CHECK([ovn_trace --minimal ls "$uflow"], [0], [expout]) > > > > # Then actually send a packet, for an end-to-end test. > > local packet=$(echo $dst$src | sed 's/://g')${eth}fefefefe > > @@ -3647,8 +3640,7 @@ test_packet() { > > # First try tracing the packet. > > uflow="inport==\"lsp$inport\" && eth.dst==$dst && eth.src==$src && > > eth.type==0x$eth && vlan.present==1" > > echo "output(\"$lout\");" > expout > > - AT_CAPTURE_FILE([trace]) > > - AT_CHECK([ovn-trace --all ls "$uflow" | tee trace | sed '1,/Minimal > > trace/d'], [0], [expout]) > > + AT_CHECK([ovn_trace --minimal ls "$uflow"], [0], [expout]) > > > > # Then actually send a packet, for an end-to-end test. > > payload=fefefefe > > @@ -3721,8 +3713,7 @@ test_packet() { > > # First try tracing the packet. > > uflow="inport==\"lsp$inport\" && eth.dst==$dst && eth.src==$src && > > eth.type==0x$eth && vlan.present==1" > > echo "output(\"$lout\");" > expout > > - AT_CAPTURE_FILE([trace]) > > - AT_CHECK([ovn-trace --all ls "$uflow" | tee trace | sed '1,/Minimal > > trace/d'], [0], [expout]) > > + AT_CHECK([ovn_trace --minimal ls "$uflow"], [0], [expout]) > > > > # Then actually send a packet, for an end-to-end test. > > local packet=$(echo $dst$src | sed 's/://g')${eth}fefefefe > > @@ -3772,8 +3763,7 @@ test_packet() { > > # First try tracing the packet. > > uflow="inport==\"lsp$inport\" && eth.dst==$dst && eth.src==$src && > > eth.type==0x$eth && vlan.present==1" > > echo "output(\"$lout\");" > expout > > - AT_CAPTURE_FILE([trace]) > > - AT_CHECK([ovn-trace --all ls "$uflow" | tee trace | sed '1,/Minimal > > trace/d'], [0], [expout]) > > + AT_CHECK([ovn_trace --minimal ls "$uflow"], [0], [expout]) > > > > # Then actually send a packet, for an end-to-end test. > > local packet=$(echo $dst$src | sed 's/://g')${eth}fefefefe > > @@ -3822,7 +3812,7 @@ test_packet() { > > > > # First try tracing the packet. > > uflow="inport==\"lsp$inport\" && eth.dst==$dst && eth.src==$src && > > eth.type==0x$eth && vlan.present==1" > > - AT_CHECK([ovn-trace --all ls "$uflow" | grep drop], [0], [ignore]) > > + AT_CHECK([ovn_trace ls "$uflow" | grep -q drop], [0]) > > > > # Then actually send a packet, for an end-to-end test. > > local packet=$(echo $dst$src | sed 's/://g')${eth}fefefefe > > @@ -3955,8 +3945,7 @@ test_packet() { > > # First try tracing the packet. > > uflow="inport==\"lp-$inport\" && eth.dst==$dst && eth.src==$src && > > eth.type==0x$eth" > > echo "output(\"$lout\");" > expout > > - AT_CAPTURE_FILE([trace]) > > - AT_CHECK([ovn-trace --all ls1 "$uflow" | tee trace | sed '1,/Minimal > > trace/d'], [0], [expout]) > > + AT_CHECK([ovn_trace --minimal ls1 "$uflow"], [0], [expout]) > > > > # Then actually send a packet, for an end-to-end test. > > local packet=$(echo $dst$src | sed 's/://g')${eth} > > @@ -9240,7 +9229,7 @@ as hv ovs-appctl -t ovn-controller inject-pkt > > "$packet" > > > > OVS_WAIT_UNTIL([ test 8 = $(grep -c 'acl_log' hv/ovn-controller.log) ]) > > > > -AT_CHECK([grep 'acl_log' hv/ovn-controller.log | sed 's/.*name=/name=/'], > > [0], [dnl > > +AT_CHECK([grep 'acl_log' hv/ovn-controller.log | sed 's/.*name=/name=/' | > > strip_nw_frag], [0], [dnl > > name="drop-flow", verdict=drop, severity=alert, direction=from-lport: > > tcp,vlan_tci=0x0000,dl_src=f0:00:00:00:00:01,dl_dst=f0:00:00:00:00:02,nw_src=192.168.1.2,nw_dst=192.168.1.3,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=4361,tp_dst=81,tcp_flags=syn > > name="drop-flow", verdict=drop, severity=alert, direction=to-lport: > > tcp,vlan_tci=0x0000,dl_src=f0:00:00:00:00:01,dl_dst=f0:00:00:00:00:02,nw_src=192.168.1.2,nw_dst=192.168.1.3,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=4361,tp_dst=181,tcp_flags=syn > > name="allow-flow", verdict=allow, severity=info, direction=from-lport: > > tcp,vlan_tci=0x0000,dl_src=f0:00:00:00:00:01,dl_dst=f0:00:00:00:00:02,nw_src=192.168.1.2,nw_dst=192.168.1.3,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=4363,tp_dst=83,tcp_flags=syn > > @@ -9428,11 +9417,6 @@ check ovs-vsctl add-port br-int vif1 -- set > > Interface vif1 external-ids:iface-id > > check ovs-vsctl add-port br-int vif2 -- set Interface vif2 > > external-ids:iface-id=lp2 options:tx_pcap=vif2-tx.pcap > > options:rxq_pcap=vif2-rx.pcap ofport-request=2 > > wait_for_ports_up lp1 lp2 > > > > -AT_CAPTURE_FILE([trace]) > > -ovn_trace () { > > - ovn-trace --all "$@" | tee trace | sed '1,/Minimal trace/d' > > -} > > - > > # Extracts nw_tos from the final flow from ofproto/trace output and prints > > # it on stdout. Prints "none" if no nw_tos was included. > > get_final_nw_tos() { > > @@ -9456,7 +9440,7 @@ check_tos() { > > echo "checking for tos $1" > > (if test $1 != 0; then echo "ip.dscp = $1;"; fi; > > echo 'output("lp2");') > expout > > - AT_CHECK_UNQUOTED([ovn_trace lsw0 'inport == "lp1" && eth.src == > > f0:00:00:00:00:01 && eth.dst == f0:00:00:00:00:02 && ip4.src == 1.1.1.1 && > > ip4.dst == 1.1.1.2'], [0], [expout]) > > + AT_CHECK_UNQUOTED([ovn_trace --minimal lsw0 'inport == "lp1" && > > eth.src == f0:00:00:00:00:01 && eth.dst == f0:00:00:00:00:02 && ip4.src == > > 1.1.1.1 && ip4.dst == 1.1.1.2'], [0], [expout]) > > > > # Then re-check with ofproto/trace for a physical packet. > > AT_CHECK([ovs-appctl ofproto/trace br-int > > 'in_port=1,dl_src=f0:00:00:00:00:01,dl_dst=f0:00:00:00:00:02,dl_type=0x800,nw_src=1.1.1.1,nw_dst=1.1.1.2'], > > [0], [stdout-nolog]) > > @@ -9465,7 +9449,7 @@ check_tos() { > > } > > > > # check at L2 > > -AT_CHECK([ovn_trace lsw0 'inport == "lp1" && eth.src == f0:00:00:00:00:01 > > && eth.dst == f0:00:00:00:00:02'], [0], [output("lp2"); > > +AT_CHECK([ovn_trace --minimal lsw0 'inport == "lp1" && eth.src == > > f0:00:00:00:00:01 && eth.dst == f0:00:00:00:00:02'], [0], [output("lp2"); > > ]) > > AT_CHECK([ovs-appctl ofproto/trace br-int > > 'in_port=1,dl_src=f0:00:00:00:00:01,dl_dst=f0:00:00:00:00:02'], [0], > > [stdout-nolog]) > > AT_CHECK([get_final_nw_tos], [0], [none > > @@ -11509,16 +11493,11 @@ echo $expected >> hv3-vif1.expected > > OVN_CHECK_PACKETS([hv3/vif1-tx.pcap], [hv3-vif1.expected]) > > > > #Check ovn-trace over "chassisredirect" port > > -AT_CAPTURE_FILE([trace]) > > -ovn_trace () { > > - ovn-trace --all "$@" | tee trace | sed '1,/Minimal trace/d' > > -} > > - > > echo 'ip.ttl--;' > expout > > echo 'eth.src = 00:00:02:01:02:03;' >> expout > > echo 'eth.dst = f0:00:00:01:02:04;' >> expout > > echo 'output("ln-alice");' >> expout > > -AT_CHECK_UNQUOTED([ovn_trace foo 'inport == "foo1" && eth.src == > > f0:00:00:01:02:03 && eth.dst == 00:00:01:01:02:03 && ip4.src == 192.168.1.2 > > && ip4.dst == 172.16.1.3 && ip.ttl == 0xff'], [0], [expout]) > > +AT_CHECK_UNQUOTED([ovn_trace --minimal foo 'inport == "foo1" && eth.src == > > f0:00:00:01:02:03 && eth.dst == 00:00:01:01:02:03 && ip4.src == 192.168.1.2 > > && ip4.dst == 172.16.1.3 && ip.ttl == 0xff'], [0], [expout]) > > > > # Create logical port alice1 in alice on hv1 > > as hv1 ovs-vsctl -- add-port br-int hv1-vif2 -- \ > > @@ -12492,8 +12471,7 @@ test_packet() { > > if test $lout != drop; then > > echo "output(\"$lout\");" > > fi > expout > > - AT_CAPTURE_FILE([trace]) > > - AT_CHECK([ovn-trace --all ls1 "$uflow" | tee trace | sed '1,/Minimal > > trace/d'], [0], [expout]) > > + AT_CHECK([ovn_trace --minimal ls1 "$uflow"], [0], [expout]) > > > > # Then actually send a packet, for an end-to-end test. > > local packet=$(echo $dst$src | sed 's/://g')${eth} > > @@ -19332,7 +19310,7 @@ AT_CHECK_UNQUOTED([ovn-sbctl get controller_event > > $uuid event_info:load_balancer > > "$uuid_lb2" > > ]) > > > > -AT_CHECK_UNQUOTED([ovn-trace sw0 'inport == "sw0-p11" && eth.src == > > 00:00:00:00:00:11 && ip4.dst == 192.168.1.100 && tcp && tcp.dst == 80' | > > grep -q 'event = "empty_lb_backends"'], [0]) > > +AT_CHECK_UNQUOTED([ovn_trace sw0 'inport == "sw0-p11" && eth.src == > > 00:00:00:00:00:11 && ip4.dst == 192.168.1.100 && tcp && tcp.dst == 80' | > > grep -q 'event = "empty_lb_backends"'], [0]) > > > > OVN_CLEANUP([hv1], [hv2]) > > AT_CLEANUP > > @@ -22994,7 +22972,7 @@ wait_for_ports_up > > check ovn-nbctl --wait=hv sync > > > > # Trace with --ovs should see ovs flow related to the ACL > > -AT_CHECK([ovn-trace --ovs lsw0 'inport == "lp1" && eth.type == 0x1234' | > > grep "dl_type=0x1234" | grep "cookie"], [0], [ignore]) > > +AT_CHECK([ovn_trace --ovs lsw0 'inport == "lp1" && eth.type == 0x1234' | > > grep "dl_type=0x1234" | grep "cookie"], [0], [ignore]) > > > > # Replace the ACL with same match but different action. > > ovn-nbctl acl-del lsw0 -- \ > > @@ -23004,7 +22982,7 @@ check ovn-nbctl --wait=hv sync > > > > # Trace with --ovs should still see the ovs flow related to the ACL, which > > # means the OVS flow is updated with new cookie corresponding to the new > > lflow. > > -AT_CHECK([ovn-trace --ovs lsw0 'inport == "lp1" && eth.type == 0x1234' | > > grep "dl_type=0x1234 actions="], [0], [ignore]) > > +AT_CHECK([ovn_trace --ovs lsw0 'inport == "lp1" && eth.type == 0x1234' | > > grep "dl_type=0x1234 actions="], [0], [ignore]) > > > > OVN_CLEANUP([hv1]) > > AT_CLEANUP > > @@ -23170,7 +23148,7 @@ for s_az in $(seq 1 $n_az); do > > ip4 && ip.ttl==64 && ip4.src==$lsp_sip && > > ip4.dst==$lsp_dip && > > udp && udp.src==53 && udp.dst==4369" > > echo "sending: $packet" > > - AT_CHECK([ovn-trace --ovs "$packet" > > > ${s_az}-${d_az}-$i.ovn-trace]) > > + AT_CHECK([ovn_trace --ovs "$packet" > > > ${s_az}-${d_az}-$i.ovn-trace]) > > AT_CHECK([ovs-appctl -t ovn-controller inject-pkt "$packet"]) > > ovs_inport=$(ovs-vsctl --bare --columns=ofport find Interface > > external-ids:iface-id="$ovn_inport") > > > > _______________________________________________ > dev mailing list > d...@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev > _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev