From bf4afb5a1582076bc822b8260213291c9ea39e94 Mon Sep 17 00:00:00 2001 From: Alex Wang Date: Tue, 4 Aug 2015 13:41:28 -0700 Subject: [PATCH] ovn-northd: Pass logical port type and options to ovn-sb database. Signed-off-by: Alex Wang Acked-by: Russell Bryant --- 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 cf8e222fb..796070f8e 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 a8d0fe88b..6bda181eb 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 -- 2.20.1