[ovs-dev] [PATCH v3 2/2] ovn: Test for full logical flow processing in ovn-controller
Jakub Sitnicki
jkbs at redhat.com
Thu Jun 7 09:47:00 UTC 2018
On Wed, 6 Jun 2018 10:27:23 -0700
Han Zhou <zhouhan at gmail.com> wrote:
> On Wed, Jun 6, 2018 at 7:19 AM, Jakub Sitnicki <jkbs at redhat.com> wrote:
> >
> > Add a test that performs typical operations of creating & destroying
> > logical routers, switches, ports, address sets and ACLs while checking
> > if they trigger full logical flow processing in the ovn-controller.
> > This way confirm that incremental processing is taking effect when we
> > expect it to.
> >
> > Place the new test in a separate module - tests/ovn-performance.at,
> > instead of the usual tests/ovn.at as it doesn't test OVN's functionality
> > but rather a performance aspect of ovn-controller.
> >
> > Signed-off-by: Jakub Sitnicki <jkbs at redhat.com>
> > ---
(...)
> > +AT_SETUP([ovn -- ovn-controller incremental processing])
> > +# Check which operations the trigger full logical flow processing.
> > +#
> > +# Create and destroy logical routers, switches, ports, address sets and
> ACLs
> > +# while counting calls to lflow_run() in ovn-controller.
> > +
> > +ovn_start
> > +net_add n1
> > +for i in 1 2; do
> > + sim_add hv$i
> > + as hv$i
> > + ovs-vsctl add-br br-phys
> > + ovn_attach n1 br-phys 192.168.0.$i
> > +done
> > +
> > +# Add router lr1
> > +OVN_CONTROLLER_EXPECT_HIT(
> > + [hv1 hv2], [lflow_run],
> > + [ovn-nbctl --wait=hv lr-add lr1]
> > +)
> > +
> > +for i in 1 2; do
> > + ls=ls$i
> > + lsp=$ls-lr1
> > + lrp=lr1-$ls
> > +
> > + # Add switch $ls
> > + OVN_CONTROLLER_EXPECT_HIT(
> > + [hv1 hv2], [lflow_run],
> > + [ovn-nbctl --wait=hv ls-add $ls]
> > + )
> > + OVN_CONTROLLER_EXPECT_NO_HIT(
> > + [hv1 hv2], [lflow_run],
> > + [ovn-nbctl --wait=hv add Logical_Switch $ls other_config
> subnet=10.0.$i.0/24]
> > + )
> > +
> > + # Add router port to $ls
> > + OVN_CONTROLLER_EXPECT_HIT(
> > + [hv1 hv2], [lflow_run],
> > + [ovn-nbctl --wait=hv lrp-add lr1 $lrp 02:00:00:00:0$i:01
> 10.0.$i.1/24]
> > + )
> > + OVN_CONTROLLER_EXPECT_NO_HIT(
> > + [hv1 hv2], [lflow_run],
> > + [ovn-nbctl --wait=hv lsp-add $ls $lsp]
> > + )
> > + OVN_CONTROLLER_EXPECT_HIT(
> > + [hv1 hv2], [lflow_run],
> > + [ovn-nbctl --wait=hv lsp-set-type $lsp router]
> > + )
> > + OVN_CONTROLLER_EXPECT_HIT(
> > + [hv1 hv2], [lflow_run],
> > + [ovn-nbctl --wait=hv lsp-set-addresses $lsp router]
> > + )
> > +done
> > +
> > +for i in 1 2; do
> > + j=$((i%2 + 1))
> > + as=as$i
> > + ls=ls$i
> > + lp=lp$i
> > + vif=vif$i
> > +
> > + # Add port $lp
> > + OVN_CONTROLLER_EXPECT_NO_HIT(
> > + [hv1 hv2], [lflow_run],
> > + [ovn-nbctl --wait=hv lsp-add $ls $lp]
> > + )
> > + OVN_CONTROLLER_EXPECT_NO_HIT(
> > + [hv1 hv2], [lflow_run],
> > + [ovn-nbctl --wait=hv lsp-set-addresses $lp "dynamic"]
> > + )
> > + OVN_CONTROLLER_EXPECT_NO_HIT(
> > + [hv1 hv2], [lflow_run],
> > + [ovn-nbctl --wait=hv wait-until Logical_Switch_Port $lp
> dynamic_addresses!=[[]]]
>
> Option --wait doesn't take effect when the operation is read-only, so it
> doesn't work for "wait-until". To make it work as expected, you need a
> separate sync command:
>
> ovn-nbctl wait-until ...
> ovn-nbctl --wait=hv sync
You are right - I can see that NB_global.hv_cfg does not get bumped.
Thanks for pointing it out, it didn't occur to me.
I will add a 'sync' after 'wait-until' and 'get' in v4.
Also, I've noticed I forgot to add '--wait=hv' to 'ls-del' and 'lr-del'
commands. Will do that too.
Thanks,
Jakub
More information about the dev
mailing list