On 08/07/2015 03:46 AM, Alex Wang wrote:
> Signed-off-by: Alex Wang <al...@nicira.com>

Nice catch, thanks!

It's not needed now, but at some point we might want to move this test
into a new file that tests the things ovn-northd is supposed to do.
Just a thought.  Thanks for adding tests.  It's helping me see how I
could add some other test cases!

Acked-by: Russell Bryant <rbry...@redhat.com>

> ---
> V5:
> - new patch.
> ---
>  ovn/northd/ovn-northd.c |    2 ++
>  tests/ovn-sbctl.at      |   13 +++++++++++++
>  2 files changed, 15 insertions(+)
> 
> diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c
> index cf8e222..796070f 100644
> --- a/ovn/northd/ovn-northd.c
> +++ b/ovn/northd/ovn-northd.c
> @@ -397,6 +397,8 @@ join_logical_ports(struct northd_context *ctx,
>  static void
>  ovn_port_update_sbrec(const struct ovn_port *op)
>  {
> +    sbrec_port_binding_set_type(op->sb, op->nb->type);
> +    sbrec_port_binding_set_options(op->sb, &op->nb->options);
>      sbrec_port_binding_set_datapath(op->sb, op->od->sb);
>      sbrec_port_binding_set_parent_port(op->sb, op->nb->parent_name);
>      sbrec_port_binding_set_tag(op->sb, op->nb->tag, op->nb->n_tag);
> diff --git a/tests/ovn-sbctl.at b/tests/ovn-sbctl.at
> index a8d0fe8..6bda181 100644
> --- a/tests/ovn-sbctl.at
> +++ b/tests/ovn-sbctl.at
> @@ -57,5 +57,18 @@ mac                 : [["f0:ab:cd:ef:01:02"]]
>  chassis             : ${uuid}
>  ])
>  
> +# test the passing down of logical port type and options.
> +AT_CHECK([ovn-nbctl lport-add br-test vtep0])
> +AT_CHECK([ovn-nbctl lport-set-type vtep0 vtep])
> +AT_CHECK([ovn-nbctl lport-set-options vtep0 vtep_physical_switch=p0 
> vtep_logical_switch=l0])
> +
> +OVS_WAIT_UNTIL([test -n "`ovn-sbctl --columns=logical_port list Port_Binding 
> | grep vtep0`" ])
> +AT_CHECK_UNQUOTED([ovn-sbctl --columns=logical_port,mac,type,options list 
> Port_Binding vtep0], [0], [dnl
> +logical_port        : "vtep0"
> +mac                 : [[]]
> +type                : vtep
> +options             : {vtep_logical_switch="l0", vtep_physical_switch="p0"}
> +])
> +
>  OVN_SBCTL_TEST_STOP
>  AT_CLEANUP
> 


-- 
Russell Bryant
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to