Message ID | 20210916000624.1609-3-odivlad@gmail.com |
---|---|
State | Accepted |
Headers | show |
Series | controller-vtep: stateful datapath bugfix & add new test | expand |
Context | Check | Description |
---|---|---|
ovsrobot/apply-robot | success | apply and check: success |
ovsrobot/github-robot-_Build_and_Test | success | github build: passed |
ovsrobot/github-robot-_ovn-kubernetes | fail | github build: failed |
On Wed, Sep 15, 2021 at 8:07 PM Vladislav Odintsov <odivlad@gmail.com> wrote: > > Signed-off-by: Vladislav Odintsov <odivlad@gmail.com> Thanks. I applied the first 2 patches of this series to the main branch. Patch 3 needs a rebase. Numan > --- > tests/ovn-controller-vtep.at | 64 ++++++++++++++++++++++++++++++++++++ > 1 file changed, 64 insertions(+) > > diff --git a/tests/ovn-controller-vtep.at b/tests/ovn-controller-vtep.at > index 21d79c66b..2d1ebad56 100644 > --- a/tests/ovn-controller-vtep.at > +++ b/tests/ovn-controller-vtep.at > @@ -558,3 +558,67 @@ done | sort], [0], [dnl > > OVN_CONTROLLER_VTEP_STOP > AT_CLEANUP > + > + > +# Tests OF to vtep device on ovn-controller node. > +OVN_FOR_EACH_NORTHD([ > +AT_SETUP([ovn-controller-vtep - hv flows]) > +ovn_start > +OVN_CONTROLLER_VTEP_START(vtep1) > +net_add n1 > + > +# Start hv chassis and create lswitch with normal vif attached to hv chassis > +sim_add hv1 > +as hv1 > +ovs-vsctl -- add-br br-phys > +ovn_attach n1 br-phys 192.168.0.1 > +ovn-nbctl ls-add lsw0 > +ovn-nbctl lsp-add lsw0 lsp0 > +ovn-nbctl lsp-set-addresses lsp0 f0:00:00:00:00:01 > +ovs-vsctl add-port br-int vif0 -- set Interface vif0 external-ids:iface-id=lsp0 > + > + > +# 1st testcase: create vtep logical switch port and then bind vlan on vtep > +OVN_NB_ADD_VTEP_PORT([lsw0], [lsp-vtep], [vtep1], [lswitch0]) > + > +# ensure there is a port_binding without chassis set > +wait_row_count Port_Binding 1 logical_port=lsp-vtep chassis='[[]]' > + > +# add vlan binding, ensure port_binding has chassis and OF on hv is installed > +OVS_WAIT_WHILE([ovs-ofctl dump-flows br-int table=0 | grep 'priority=110']) > +check as vtep1 vtep-ctl add-ls lswitch0 -- bind-ls vtep1 p0 100 lswitch0 > +wait_row_count Port_Binding 1 logical_port=lsp-vtep chassis!='[[]]' > +OVS_WAIT_UNTIL([ovs-ofctl dump-flows br-int table=0 | grep 'priority=110']) > +AT_CHECK([ovs-ofctl dump-flows br-int table=0 | grep 'priority=110' | \ > + awk '{print $(NF-1), $NF}' | sed -e 's/in_port=[[0-9]]\+/in_port=<>/g' | \ > + sed -e 's/0x[[0-9a-f]]\+/0x<>/g'], [0], [dnl > +priority=110,tun_id=0x<>,in_port=<> actions=move:NXM_NX_TUN_ID[[0..23]]->OXM_OF_METADATA[[0..23]],load:0x<>->NXM_NX_REG14[[0..14]],load:0x<>->NXM_NX_REG10[[1]],resubmit(,8) > +]) > + > +# cleanup > +check ovn-nbctl lsp-del lsp-vtep > +check as vtep1 vtep-ctl unbind-ls vtep1 p0 100 -- clear-local-macs lswitch0 \ > + -- clear-remote-macs lswitch0 -- del-ls lswitch0 > + > + > +# 2nd testcase: create vlan binding on vtep and then create logical switch port for it. > +# ensure there's no port_binding > +wait_row_count Port_Binding 0 logical_port=lsp-vtep > + > +check as vtep1 vtep-ctl add-ls lswitch0 -- bind-ls vtep1 p0 100 lswitch0 > +OVN_NB_ADD_VTEP_PORT([lsw0], [lsp-vtep], [vtep1], [lswitch0]) > +wait_row_count Port_Binding 1 logical_port=lsp-vtep chassis!='[[]]' > + > +# TODO (Numan): Remove this recompute to reproduce the issue > +check as hv1 ovn-appctl -t ovn-controller recompute > + > +OVS_WAIT_UNTIL([ovs-ofctl dump-flows br-int table=0 | grep 'priority=110']) > +AT_CHECK([ovs-ofctl dump-flows br-int table=0 | grep 'priority=110' | \ > + awk '{print $(NF-1), $NF}' | sed -e 's/in_port=[[0-9]]\+/in_port=<>/g' | \ > + sed -e 's/0x[[0-9a-f]]\+/0x<>/g'], [0], [dnl > +priority=110,tun_id=0x<>,in_port=<> actions=move:NXM_NX_TUN_ID[[0..23]]->OXM_OF_METADATA[[0..23]],load:0x<>->NXM_NX_REG14[[0..14]],load:0x<>->NXM_NX_REG10[[1]],resubmit(,8) > +]) > + > +OVN_CLEANUP([hv1]) > +AT_CLEANUP > +]) > -- > 2.30.0 > > _______________________________________________ > dev mailing list > dev@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev >
diff --git a/tests/ovn-controller-vtep.at b/tests/ovn-controller-vtep.at index 21d79c66b..2d1ebad56 100644 --- a/tests/ovn-controller-vtep.at +++ b/tests/ovn-controller-vtep.at @@ -558,3 +558,67 @@ done | sort], [0], [dnl OVN_CONTROLLER_VTEP_STOP AT_CLEANUP + + +# Tests OF to vtep device on ovn-controller node. +OVN_FOR_EACH_NORTHD([ +AT_SETUP([ovn-controller-vtep - hv flows]) +ovn_start +OVN_CONTROLLER_VTEP_START(vtep1) +net_add n1 + +# Start hv chassis and create lswitch with normal vif attached to hv chassis +sim_add hv1 +as hv1 +ovs-vsctl -- add-br br-phys +ovn_attach n1 br-phys 192.168.0.1 +ovn-nbctl ls-add lsw0 +ovn-nbctl lsp-add lsw0 lsp0 +ovn-nbctl lsp-set-addresses lsp0 f0:00:00:00:00:01 +ovs-vsctl add-port br-int vif0 -- set Interface vif0 external-ids:iface-id=lsp0 + + +# 1st testcase: create vtep logical switch port and then bind vlan on vtep +OVN_NB_ADD_VTEP_PORT([lsw0], [lsp-vtep], [vtep1], [lswitch0]) + +# ensure there is a port_binding without chassis set +wait_row_count Port_Binding 1 logical_port=lsp-vtep chassis='[[]]' + +# add vlan binding, ensure port_binding has chassis and OF on hv is installed +OVS_WAIT_WHILE([ovs-ofctl dump-flows br-int table=0 | grep 'priority=110']) +check as vtep1 vtep-ctl add-ls lswitch0 -- bind-ls vtep1 p0 100 lswitch0 +wait_row_count Port_Binding 1 logical_port=lsp-vtep chassis!='[[]]' +OVS_WAIT_UNTIL([ovs-ofctl dump-flows br-int table=0 | grep 'priority=110']) +AT_CHECK([ovs-ofctl dump-flows br-int table=0 | grep 'priority=110' | \ + awk '{print $(NF-1), $NF}' | sed -e 's/in_port=[[0-9]]\+/in_port=<>/g' | \ + sed -e 's/0x[[0-9a-f]]\+/0x<>/g'], [0], [dnl +priority=110,tun_id=0x<>,in_port=<> actions=move:NXM_NX_TUN_ID[[0..23]]->OXM_OF_METADATA[[0..23]],load:0x<>->NXM_NX_REG14[[0..14]],load:0x<>->NXM_NX_REG10[[1]],resubmit(,8) +]) + +# cleanup +check ovn-nbctl lsp-del lsp-vtep +check as vtep1 vtep-ctl unbind-ls vtep1 p0 100 -- clear-local-macs lswitch0 \ + -- clear-remote-macs lswitch0 -- del-ls lswitch0 + + +# 2nd testcase: create vlan binding on vtep and then create logical switch port for it. +# ensure there's no port_binding +wait_row_count Port_Binding 0 logical_port=lsp-vtep + +check as vtep1 vtep-ctl add-ls lswitch0 -- bind-ls vtep1 p0 100 lswitch0 +OVN_NB_ADD_VTEP_PORT([lsw0], [lsp-vtep], [vtep1], [lswitch0]) +wait_row_count Port_Binding 1 logical_port=lsp-vtep chassis!='[[]]' + +# TODO (Numan): Remove this recompute to reproduce the issue +check as hv1 ovn-appctl -t ovn-controller recompute + +OVS_WAIT_UNTIL([ovs-ofctl dump-flows br-int table=0 | grep 'priority=110']) +AT_CHECK([ovs-ofctl dump-flows br-int table=0 | grep 'priority=110' | \ + awk '{print $(NF-1), $NF}' | sed -e 's/in_port=[[0-9]]\+/in_port=<>/g' | \ + sed -e 's/0x[[0-9a-f]]\+/0x<>/g'], [0], [dnl +priority=110,tun_id=0x<>,in_port=<> actions=move:NXM_NX_TUN_ID[[0..23]]->OXM_OF_METADATA[[0..23]],load:0x<>->NXM_NX_REG14[[0..14]],load:0x<>->NXM_NX_REG10[[1]],resubmit(,8) +]) + +OVN_CLEANUP([hv1]) +AT_CLEANUP +])
Signed-off-by: Vladislav Odintsov <odivlad@gmail.com> --- tests/ovn-controller-vtep.at | 64 ++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+)