[ovs-dev] [PATCH v3 ovn 3/5] controller: bfd: introduce BFD state machine

Lorenzo Bianconi lorenzo.bianconi at redhat.com
Fri Dec 18 18:53:38 UTC 2020


> On Wed, Dec 16, 2020 at 8:12 PM Lorenzo Bianconi
> <lorenzo.bianconi at redhat.com> wrote:
> >

[...]

> > +ovn-nbctl lr-add r0
> > +ovn-nbctl lrp-add r0 r0-sw0 00:00:00:00:00:01 192.168.0.1/24
> > +ovn-nbctl ls-add sw0
> > +ovn-nbctl lsp-add sw0 sw0-r0
> > +ovn-nbctl lsp-set-type sw0-r0 router
> > +ovn-nbctl lsp-set-options sw0-r0 router-port=r0-sw0
> > +ovn-nbctl lsp-set-addresses sw0-r0 00:00:00:00:00:01
> > +ovn-nbctl create bfd logical_port=r0-sw0 dst_ip=192.168.1.2 status=down min_tx=250 min_rx=250 detect_mult=10
> 
> Can you please add "check" to all the above ovn-nbctl commands ?

ack, I will fix it in v4

> 
> > +
> > +uuid=$(ovn-sbctl --columns=_uuid --bare find bfd logical_port=r0-sw0)
> > +AT_CHECK([ovn-sbctl get bfd ${uuid} detect_mult],
> > +[0], [10
> > +])
> > +AT_CHECK([ovn-sbctl get bfd ${uuid} dst_ip],
> > +[0], ["192.168.1.2"
> > +])
> > +AT_CHECK([ovn-sbctl get bfd ${uuid} min_rx],
> > +[0], [250
> > +])
> > +AT_CHECK([ovn-sbctl get bfd ${uuid} min_tx],
> > +[0], [250
> > +])
> > +AT_CHECK([ovn-sbctl get bfd ${uuid} status],
> > +[0], [down
> > +])
> 
> For all these above checks, can you please make use of the helper
> function - check_column  ?

ack, I will fix it in v4

> 
> 
> > +
> > +AT_CLEANUP
> > diff --git a/tests/system-ovn.at b/tests/system-ovn.at
> > index 1e73001ab..d8c21404b 100644
> > --- a/tests/system-ovn.at
> > +++ b/tests/system-ovn.at
> > @@ -5531,3 +5531,108 @@ as
> >  OVS_TRAFFIC_VSWITCHD_STOP(["/.*error receiving.*/d
> >  /.*terminating with signal 15.*/d"])
> >  AT_CLEANUP
> > +
> > +AT_SETUP([ovn -- BFD])
> > +AT_SKIP_IF([test $HAVE_BFDD_BEACON = no])
> > +AT_KEYWORDS([ovn-bfd])
> > +
> > +ovn_start
> > +OVS_TRAFFIC_VSWITCHD_START()
> > +
> > +ADD_BR([br-int])
> > +ADD_BR([br-ext])
> > +
> > +ovs-ofctl add-flow br-ext action=normal
> > +# Set external-ids in br-int needed for ovn-controller
> > +ovs-vsctl \
> > +        -- set Open_vSwitch . external-ids:system-id=hv1 \
> > +        -- set Open_vSwitch . external-ids:ovn-remote=unix:$ovs_base/ovn-sb/ovn-sb.sock \
> > +        -- set Open_vSwitch . external-ids:ovn-encap-type=geneve \
> > +        -- set Open_vSwitch . external-ids:ovn-encap-ip=169.0.0.1 \
> > +        -- set bridge br-int fail-mode=secure other-config:disable-in-band=true
> > +
> > +# Start ovn-controller
> > +start_daemon ovn-controller
> > +
> > +ovn-nbctl lr-add R1
> > +
> > +ovn-nbctl ls-add sw0
> > +ovn-nbctl ls-add sw1
> > +ovn-nbctl ls-add public
> > +
> > +ovn-nbctl lrp-add R1 rp-sw0 00:00:01:01:02:03 192.168.1.1/24
> > +ovn-nbctl lrp-add R1 rp-sw1 00:00:03:01:02:03 192.168.2.1/24
> > +ovn-nbctl lrp-add R1 rp-public 00:00:02:01:02:03 172.16.1.1/24 \
> > +    -- lrp-set-gateway-chassis rp-public hv1
> > +
> > +ovn-nbctl lsp-add sw0 sw0-rp -- set Logical_Switch_Port sw0-rp \
> > +    type=router options:router-port=rp-sw0 \
> > +    -- lsp-set-addresses sw0-rp router
> > +ovn-nbctl lsp-add sw1 sw1-rp -- set Logical_Switch_Port sw1-rp \
> > +    type=router options:router-port=rp-sw1 \
> > +    -- lsp-set-addresses sw1-rp router
> > +
> > +ovn-nbctl lsp-add public public-rp -- set Logical_Switch_Port public-rp \
> > +    type=router options:router-port=rp-public \
> > +    -- lsp-set-addresses public-rp router
> > +
> 
> Here too, can you please make use of "check" function for the above
> ovn-nbctl commands ?

ack, I will fix it in v4

> 
> 
> > +ADD_NAMESPACES(sw01)
> > +ADD_VETH(sw01, sw01, br-int, "192.168.1.2/24", "f0:00:00:01:02:03", \
> > +         "192.168.1.1")
> > +ovn-nbctl lsp-add sw0 sw01 \
> > +    -- lsp-set-addresses sw01 "f0:00:00:01:02:03 192.168.1.2"
> > +
> > +ADD_NAMESPACES(sw11)
> > +ADD_VETH(sw11, sw11, br-int, "192.168.2.2/24", "f0:00:00:02:02:03", \
> > +         "192.168.2.1")
> > +ovn-nbctl lsp-add sw1 sw11 \
> > +    -- lsp-set-addresses sw11 "f0:00:00:02:02:03 192.168.2.2"
> > +
> > +ADD_NAMESPACES(server)
> > +NS_CHECK_EXEC([server], [ip link set dev lo up])
> > +ADD_VETH(s1, server, br-ext, "172.16.1.50/24", "f0:00:00:01:02:05", \
> > +         "172.16.1.1")
> > +
> > +AT_CHECK([ovs-vsctl set Open_vSwitch . external-ids:ovn-bridge-mappings=phynet:br-ext])
> > +ovn-nbctl lsp-add public public1 \
> > +        -- lsp-set-addresses public1 unknown \
> > +        -- lsp-set-type public1 localnet \
> > +        -- lsp-set-options public1 network_name=phynet
> > +
> > +NS_CHECK_EXEC([server], [bfdd-beacon --listen=172.16.1.50], [0])
> > +NS_CHECK_EXEC([server], [bfdd-control allow 172.16.1.1], [0], [dnl
> > +Allowing connections from 172.16.1.1
> > +])
> > +
> > +ovn-nbctl create bfd logical_port=rp-public dst_ip=172.16.1.50 status=down min_tx=250 min_rx=250 detect_mult=10
> > +ovn-nbctl --wait=hv sync
> > +
> > +OVS_WAIT_UNTIL([test "$(ovn-nbctl list bfd | awk -F: '/status/{print substr($2,2)}')" = "up"])
> 
> Same here, I think you can use fetch_column/check_column

ack, I will fix it in v4

Regards,
Lorenzo

> 
> Thanks
> Numan
> 
> > +AT_CHECK([ovn-nbctl list bfd | awk -F: '/status/{print substr($2,2)}'], [0], [dnl
> > +up
> > +])
> > +
> > +NS_CHECK_EXEC([server], [bfdd-control stop], [0], [dnl
> > +stopping
> > +])
> > +
> > +OVS_WAIT_UNTIL([test "$(ovn-nbctl list bfd | awk -F: '/status/{print substr($2,2)}')" = "down"])
> > +AT_CHECK([ovn-nbctl list bfd | awk -F: '/status/{print substr($2,2)}'], [0], [dnl
> > +down
> > +])
> > +
> > +kill $(pidof ovn-controller)
> > +
> > +as ovn-sb
> > +OVS_APP_EXIT_AND_WAIT([ovsdb-server])
> > +
> > +as ovn-nb
> > +OVS_APP_EXIT_AND_WAIT([ovsdb-server])
> > +
> > +as northd
> > +OVS_APP_EXIT_AND_WAIT([ovn-northd])
> > +
> > +as
> > +OVS_TRAFFIC_VSWITCHD_STOP(["/.*error receiving.*/d
> > +/.*terminating with signal 15.*/d"])
> > +AT_CLEANUP
> > --
> > 2.29.2
> >
> > _______________________________________________
> > dev mailing list
> > dev at openvswitch.org
> > https://mail.openvswitch.org/mailman/listinfo/ovs-dev
> >
> 


More information about the dev mailing list