Revert "API: Cleanup APIs interface.api"
[vpp.git] / test / ext / vom_test.cpp
index dad6835..569bd8c 100644 (file)
@@ -25,6 +25,7 @@
 #include "vom/bond_group_binding_cmds.hpp"
 #include "vom/l2_binding.hpp"
 #include "vom/l2_binding_cmds.hpp"
+#include "vom/l2_vtr_cmds.hpp"
 #include "vom/l2_xconnect.hpp"
 #include "vom/l2_xconnect_cmds.hpp"
 #include "vom/l3_binding.hpp"
@@ -38,6 +39,7 @@
 #include "vom/prefix.hpp"
 #include "vom/route.hpp"
 #include "vom/route_cmds.hpp"
+#include "vom/mroute_cmds.hpp"
 #include "vom/route_domain.hpp"
 #include "vom/route_domain_cmds.hpp"
 #include "vom/vxlan_tunnel.hpp"
@@ -46,7 +48,8 @@
 #include "vom/sub_interface_cmds.hpp"
 #include "vom/acl_ethertype.hpp"
 #include "vom/acl_ethertype_cmds.hpp"
-#include "vom/acl_list.hpp"
+#include "vom/acl_l2_list.hpp"
+#include "vom/acl_l3_list.hpp"
 #include "vom/acl_binding.hpp"
 #include "vom/acl_list_cmds.hpp"
 #include "vom/acl_binding_cmds.hpp"
 #include "vom/arp_proxy_binding.hpp"
 #include "vom/arp_proxy_config_cmds.hpp"
 #include "vom/arp_proxy_binding_cmds.hpp"
+#include "vom/igmp_binding.hpp"
+#include "vom/igmp_binding_cmds.hpp"
+#include "vom/igmp_listen.hpp"
+#include "vom/igmp_listen_cmds.hpp"
 #include "vom/ip_punt_redirect.hpp"
 #include "vom/ip_punt_redirect_cmds.hpp"
 #include "vom/ip_unnumbered.hpp"
@@ -91,10 +98,10 @@ public:
 class MockListener : public interface::event_listener,
                      public interface::stat_listener
 {
-    void handle_interface_stat(interface_cmds::stats_enable_cmd *cmd)
+    void handle_interface_stat(const interface& itf)
     {
     }
-    void handle_interface_event(interface_cmds::events_cmd *cmd)
+    void handle_interface_event(std::vector<VOM::interface::event> events)
     {
     }
 };
@@ -247,6 +254,14 @@ public:
                     {
                         rc = handle_derived<route::ip_route_cmds::delete_cmd>(f_exp, f_act);
                     }
+                    else if (typeid(*f_exp) == typeid(route::ip_mroute_cmds::update_cmd))
+                    {
+                       rc = handle_derived<route::ip_mroute_cmds::update_cmd>(f_exp, f_act);
+                    }
+                    else if (typeid(*f_exp) == typeid(route::ip_mroute_cmds::delete_cmd))
+                    {
+                        rc = handle_derived<route::ip_mroute_cmds::delete_cmd>(f_exp, f_act);
+                    }
                     else if (typeid(*f_exp) == typeid(neighbour_cmds::create_cmd))
                     {
                        rc = handle_derived<neighbour_cmds::create_cmd>(f_exp, f_act);
@@ -295,9 +310,9 @@ public:
                     {
                         rc = handle_derived<l2_binding_cmds::unbind_cmd>(f_exp, f_act);
                     }
-                    else if (typeid(*f_exp) == typeid(l2_binding_cmds::set_vtr_op_cmd))
+                    else if (typeid(*f_exp) == typeid(l2_vtr_cmds::set_cmd))
                     {
-                        rc = handle_derived<l2_binding_cmds::set_vtr_op_cmd>(f_exp, f_act);
+                        rc = handle_derived<l2_vtr_cmds::set_cmd>(f_exp, f_act);
                     }
                     else if (typeid(*f_exp) == typeid(l2_xconnect_cmds::bind_cmd))
                     {
@@ -379,6 +394,22 @@ public:
                     {
                         rc = handle_derived<arp_proxy_config_cmds::unconfig_cmd>(f_exp, f_act);
                     }
+                    else if (typeid(*f_exp) == typeid(igmp_binding_cmds::bind_cmd))
+                    {
+                        rc = handle_derived<igmp_binding_cmds::bind_cmd>(f_exp, f_act);
+                    }
+                    else if (typeid(*f_exp) == typeid(igmp_binding_cmds::unbind_cmd))
+                    {
+                        rc = handle_derived<igmp_binding_cmds::unbind_cmd>(f_exp, f_act);
+                    }
+                    else if (typeid(*f_exp) == typeid(igmp_listen_cmds::listen_cmd))
+                    {
+                        rc = handle_derived<igmp_listen_cmds::listen_cmd>(f_exp, f_act);
+                    }
+                    else if (typeid(*f_exp) == typeid(igmp_listen_cmds::unlisten_cmd))
+                    {
+                        rc = handle_derived<igmp_listen_cmds::unlisten_cmd>(f_exp, f_act);
+                    }
                     else if (typeid(*f_exp) == typeid(ip_punt_redirect_cmds::config_cmd))
                     {
                         rc = handle_derived<ip_punt_redirect_cmds::config_cmd>(f_exp, f_act);
@@ -936,7 +967,10 @@ BOOST_AUTO_TEST_CASE(test_bridge) {
     l2_binding *l2itf = new l2_binding(itf1, bd1);
     HW::item<bool> hw_l2_bind(true, rc_t::OK);
 
-    ADD_EXPECT(l2_binding_cmds::bind_cmd(hw_l2_bind, hw_ifh.data(), hw_bd.data(), false));
+    ADD_EXPECT(l2_binding_cmds::bind_cmd(hw_l2_bind,
+                                         hw_ifh.data(),
+                                         hw_bd.data(),
+                                         l2_binding::l2_port_type_t::L2_PORT_TYPE_NORMAL));
     TRY_CHECK_RC(OM::write(franz, *l2itf));
 
     /*
@@ -956,11 +990,14 @@ BOOST_AUTO_TEST_CASE(test_bridge) {
     TRY_CHECK_RC(OM::write(dante, bd1));
 
     l2_binding *l2itf2 = new l2_binding(itf2, bd1);
-    HW::item<l2_binding::l2_vtr_op_t> hw_set_vtr(l2_binding::l2_vtr_op_t::L2_VTR_POP_1, rc_t::OK);
-    l2itf2->set(l2_binding::l2_vtr_op_t::L2_VTR_POP_1, 68);
-
-    ADD_EXPECT(l2_binding_cmds::bind_cmd(hw_l2_bind, hw_ifh2.data(), hw_bd.data(), false));
-    ADD_EXPECT(l2_binding_cmds::set_vtr_op_cmd(hw_set_vtr, hw_ifh2.data(), 68));
+    HW::item<l2_vtr::option_t> hw_set_vtr(l2_vtr::option_t::POP_1, rc_t::OK);
+    l2itf2->set(l2_vtr::option_t::POP_1, 68);
+
+    ADD_EXPECT(l2_binding_cmds::bind_cmd(hw_l2_bind,
+                                         hw_ifh2.data(),
+                                         hw_bd.data(),
+                                         l2_binding::l2_port_type_t::L2_PORT_TYPE_NORMAL));
+    ADD_EXPECT(l2_vtr_cmds::set_cmd(hw_set_vtr, hw_ifh2.data(), 68));
     TRY_CHECK_RC(OM::write(dante, *l2itf2));
 
     // Add some static entries to the bridge-domain
@@ -983,7 +1020,10 @@ BOOST_AUTO_TEST_CASE(test_bridge) {
     delete l2itf;
     HW::item<interface::admin_state_t> hw_as_down(interface::admin_state_t::DOWN,
                                                   rc_t::OK);
-    ADD_EXPECT(l2_binding_cmds::unbind_cmd(hw_l2_bind, hw_ifh.data(), hw_bd.data(), false));
+    ADD_EXPECT(l2_binding_cmds::unbind_cmd(hw_l2_bind,
+                                           hw_ifh.data(),
+                                           hw_bd.data(),
+                                           l2_binding::l2_port_type_t::L2_PORT_TYPE_NORMAL));
     ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh));
     ADD_EXPECT(interface_cmds::af_packet_delete_cmd(hw_ifh, itf1_name));
     TRY_CHECK(OM::remove(franz));
@@ -996,7 +1036,10 @@ BOOST_AUTO_TEST_CASE(test_bridge) {
     STRICT_ORDER_OFF();
     ADD_EXPECT(bridge_domain_arp_entry_cmds::delete_cmd(hw_be1, bd1.id(), mac1, ip1));
     ADD_EXPECT(bridge_domain_entry_cmds::delete_cmd(hw_be1, mac1, bd1.id(), false));
-    ADD_EXPECT(l2_binding_cmds::unbind_cmd(hw_l2_bind, hw_ifh2.data(), hw_bd.data(), false));
+    ADD_EXPECT(l2_binding_cmds::unbind_cmd(hw_l2_bind,
+                                           hw_ifh2.data(),
+                                           hw_bd.data(),
+                                           l2_binding::l2_port_type_t::L2_PORT_TYPE_NORMAL));
 
     ADD_EXPECT(bridge_domain_cmds::delete_cmd(hw_bd));
     ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh2));
@@ -1027,7 +1070,10 @@ BOOST_AUTO_TEST_CASE(test_bridge) {
     TRY_CHECK_RC(OM::write(jkr, itf3));
 
     l2_binding *l2itf3 = new l2_binding(itf3, bd2);
-    ADD_EXPECT(l2_binding_cmds::bind_cmd(hw_l2_bind, hw_ifh3.data(), hw_bd2.data(), true));
+    ADD_EXPECT(l2_binding_cmds::bind_cmd(hw_l2_bind,
+                                         hw_ifh3.data(),
+                                         hw_bd2.data(),
+                                         l2_binding::l2_port_type_t::L2_PORT_TYPE_BVI));
     TRY_CHECK_RC(OM::write(jkr, *l2itf3));
 
     HW::item<bool> hw_be2(true, rc_t::OK);
@@ -1039,7 +1085,10 @@ BOOST_AUTO_TEST_CASE(test_bridge) {
     delete l2itf3;
     delete be2;
     STRICT_ORDER_OFF();
-    ADD_EXPECT(l2_binding_cmds::unbind_cmd(hw_l2_bind, hw_ifh3.data(), hw_bd2.data(), true));
+    ADD_EXPECT(l2_binding_cmds::unbind_cmd(hw_l2_bind,
+                                           hw_ifh3.data(),
+                                           hw_bd2.data(),
+                                           l2_binding::l2_port_type_t::L2_PORT_TYPE_BVI));
     ADD_EXPECT(bridge_domain_entry_cmds::delete_cmd(hw_be2, mac2, bd2.id(), true));
     ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh3));
     ADD_EXPECT(interface_cmds::loopback_delete_cmd(hw_ifh3));
@@ -1118,7 +1167,8 @@ BOOST_AUTO_TEST_CASE(test_vxlan) {
     vxlan_tunnel vxt(ep.src, ep.dst, ep.vni);
 
     HW::item<handle_t> hw_vxt(3, rc_t::OK);
-    ADD_EXPECT(vxlan_tunnel_cmds::create_cmd(hw_vxt, "don't-care", ep));
+    ADD_EXPECT(vxlan_tunnel_cmds::create_cmd(hw_vxt, "don't-care", ep,
+                                             handle_t::INVALID));
 
     TRY_CHECK_RC(OM::write(franz, vxt));
 
@@ -1143,14 +1193,20 @@ BOOST_AUTO_TEST_CASE(test_vxlan) {
     l2_binding *l2itf = new l2_binding(vxt, bd1);
     HW::item<bool> hw_l2_bind(true, rc_t::OK);
 
-    ADD_EXPECT(l2_binding_cmds::bind_cmd(hw_l2_bind, hw_vxt.data(), hw_bd.data(), false));
+    ADD_EXPECT(l2_binding_cmds::bind_cmd(hw_l2_bind,
+                                         hw_vxt.data(),
+                                         hw_bd.data(),
+                                         l2_binding::l2_port_type_t::L2_PORT_TYPE_NORMAL));
     TRY_CHECK_RC(OM::write(franz, *l2itf));
 
     // flush Franz's state
     delete l2itf;
     HW::item<handle_t> hw_vxtdel(3, rc_t::NOOP);
     STRICT_ORDER_OFF();
-    ADD_EXPECT(l2_binding_cmds::unbind_cmd(hw_l2_bind, hw_vxt.data(), hw_bd.data(), false));
+    ADD_EXPECT(l2_binding_cmds::unbind_cmd(hw_l2_bind,
+                                           hw_vxt.data(),
+                                           hw_bd.data(),
+                                           l2_binding::l2_port_type_t::L2_PORT_TYPE_NORMAL));
     ADD_EXPECT(bridge_domain_cmds::delete_cmd(hw_bd));
     ADD_EXPECT(vxlan_tunnel_cmds::delete_cmd(hw_vxtdel, ep));
     TRY_CHECK(OM::remove(franz));
@@ -1298,6 +1354,51 @@ BOOST_AUTO_TEST_CASE(test_acl) {
     TRY_CHECK(OM::remove(fyodor));
 }
 
+BOOST_AUTO_TEST_CASE(test_igmp) {
+    VppInit vi;
+    const std::string Isaiah = "IsaiahBerlin";
+    rc_t rc = rc_t::OK;
+
+    boost::asio::ip::address_v4 gaddr = boost::asio::ip::address_v4::from_string("232.0.0.1");
+    boost::asio::ip::address_v4 saddr1 = boost::asio::ip::address_v4::from_string("192.168.0.20");
+    boost::asio::ip::address_v4 saddr2 = boost::asio::ip::address_v4::from_string("192.168.0.30");
+
+    std::string itf3_name = "host3";
+    interface itf3(itf3_name,
+                   interface::type_t::AFPACKET,
+                   interface::admin_state_t::UP);
+    HW::item<handle_t> hw_ifh(2, rc_t::OK);
+    HW::item<interface::admin_state_t> hw_as_up(interface::admin_state_t::UP, rc_t::OK);
+    ADD_EXPECT(interface_cmds::af_packet_create_cmd(hw_ifh, itf3_name));
+    ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh));
+    TRY_CHECK_RC(OM::write(Isaiah, itf3));
+
+    igmp_binding *ib = new igmp_binding(itf3);
+    HW::item<bool> hw_binding(true, rc_t::OK);
+    ADD_EXPECT(igmp_binding_cmds::bind_cmd(hw_binding, hw_ifh.data()));
+    TRY_CHECK_RC(OM::write(Isaiah, *ib));
+
+    igmp_listen::src_addrs_t saddrs = {saddr1, saddr2};
+
+    igmp_listen *il = new igmp_listen(*ib, gaddr, saddrs);
+    HW::item<bool> hw_as_listen(true, rc_t::OK);
+    ADD_EXPECT(igmp_listen_cmds::listen_cmd(hw_as_listen, hw_ifh.data(), gaddr, saddrs));
+    TRY_CHECK_RC(OM::write(Isaiah, *il));
+
+    delete il;
+    delete ib;
+
+    HW::item<interface::admin_state_t> hw_as_down(interface::admin_state_t::DOWN,
+                                                  rc_t::OK);
+    STRICT_ORDER_OFF();
+    ADD_EXPECT(igmp_listen_cmds::unlisten_cmd(hw_as_listen, hw_ifh.data(), gaddr));
+    ADD_EXPECT(igmp_binding_cmds::unbind_cmd(hw_binding, hw_ifh.data()));
+    ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh));
+    ADD_EXPECT(interface_cmds::af_packet_delete_cmd(hw_ifh, itf3_name));
+
+    TRY_CHECK(OM::remove(Isaiah));
+}
+
 BOOST_AUTO_TEST_CASE(test_arp_proxy) {
     VppInit vi;
     const std::string kurt = "KurtVonnegut";
@@ -1633,23 +1734,39 @@ BOOST_AUTO_TEST_CASE(test_routing) {
      * A route via interface 1 in the default table
      */
     route::prefix_t pfx_5("5.5.5.5", 32);
+    boost::asio::ip::address nh_9 = boost::asio::ip::address::from_string("10.10.10.9");
+    route::path *path_9 = new route::path(nh_9, itf1);
     boost::asio::ip::address nh_10 = boost::asio::ip::address::from_string("10.10.10.11");
     route::path *path_10 = new route::path(nh_10, itf1);
     route::ip_route *route_5 = new route::ip_route(pfx_5);
     route_5->add(*path_10);
+    route_5->add(*path_9);
     HW::item<bool> hw_route_5(true, rc_t::OK);
-    ADD_EXPECT(route::ip_route_cmds::update_cmd(hw_route_5, 0, pfx_5, {*path_10}));
+    ADD_EXPECT(route::ip_route_cmds::update_cmd(hw_route_5, 0, pfx_5, *path_9));
+    ADD_EXPECT(route::ip_route_cmds::update_cmd(hw_route_5, 0, pfx_5, *path_10));
+    TRY_CHECK_RC(OM::write(ian, *route_5));
+
+    route_5->remove(*path_9);
+    ADD_EXPECT(route::ip_route_cmds::delete_cmd(hw_route_5, 0, pfx_5, *path_9));
     TRY_CHECK_RC(OM::write(ian, *route_5));
 
+    delete path_9;
+
     /*
      * A route via interface 2 in the non-default table
      */
     boost::asio::ip::address nh_11 = boost::asio::ip::address::from_string("11.11.11.10");
     route::path *path_11 = new route::path(nh_11, *itf2);
+    boost::asio::ip::address nh_12 = boost::asio::ip::address::from_string("11.11.11.12");
+    route::path *path_12 = new route::path(nh_12, *itf2);
     route::ip_route *route_5_2 = new route::ip_route(rd4, pfx_5);
     route_5_2->add(*path_11);
     HW::item<bool> hw_route_5_2(true, rc_t::OK);
-    ADD_EXPECT(route::ip_route_cmds::update_cmd(hw_route_5_2, 1, pfx_5, {*path_11}));
+    ADD_EXPECT(route::ip_route_cmds::update_cmd(hw_route_5_2, 1, pfx_5, *path_11));
+    TRY_CHECK_RC(OM::write(ian, *route_5_2));
+
+    route_5_2->add(*path_12);
+    ADD_EXPECT(route::ip_route_cmds::update_cmd(hw_route_5_2, 1, pfx_5, *path_12));
     TRY_CHECK_RC(OM::write(ian, *route_5_2));
 
     /*
@@ -1658,7 +1775,9 @@ BOOST_AUTO_TEST_CASE(test_routing) {
     HW::item<bool> hw_neighbour(true, rc_t::OK);
     mac_address_t mac_n({0,1,2,4,5,6});
     neighbour *ne = new neighbour(itf1, nh_10, mac_n);
-    ADD_EXPECT(neighbour_cmds::create_cmd(hw_neighbour, hw_ifh.data(), mac_n, nh_10));
+    ADD_EXPECT(neighbour_cmds::create_cmd(hw_neighbour, hw_ifh.data(),
+                                          mac_n, nh_10,
+                                          neighbour::flags_t::STATIC));
     TRY_CHECK_RC(OM::write(ian, *ne));
 
     /*
@@ -1669,9 +1788,29 @@ BOOST_AUTO_TEST_CASE(test_routing) {
     route::ip_route *route_dvr = new route::ip_route(pfx_6);
     route_dvr->add(*path_l2);
     HW::item<bool> hw_route_dvr(true, rc_t::OK);
-    ADD_EXPECT(route::ip_route_cmds::update_cmd(hw_route_dvr, 0, pfx_6, {*path_l2}));
+    ADD_EXPECT(route::ip_route_cmds::update_cmd(hw_route_dvr, 0, pfx_6, *path_l2));
     TRY_CHECK_RC(OM::write(ian, *route_dvr));
 
+    /*
+     * a multicast route
+     */
+    route::mprefix_t mpfx_4(boost::asio::ip::address::from_string("232.1.1.1"), 32);
+    route::ip_mroute *mroute_4 = new route::ip_mroute(mpfx_4);
+
+    route::path *mp1 = new route::path(itf1, nh_proto_t::IPV4);
+    route::path *mp2 = new route::path(*itf2, nh_proto_t::IPV4);
+    mroute_4->add(*mp1, route::itf_flags_t::FORWARD);
+    mroute_4->add(*mp1, route::itf_flags_t::ACCEPT);
+    mroute_4->add(*mp2, route::itf_flags_t::FORWARD);
+    HW::item<bool> hw_mroute_4(true, rc_t::OK);
+    ADD_EXPECT(route::ip_mroute_cmds::update_cmd(hw_mroute_4, 0, mpfx_4,
+                                                 *mp1, route::itf_flags_t::FORWARD));
+    ADD_EXPECT(route::ip_mroute_cmds::update_cmd(hw_mroute_4, 0, mpfx_4,
+                                                 *mp2, route::itf_flags_t::FORWARD));
+    ADD_EXPECT(route::ip_mroute_cmds::update_cmd(hw_mroute_4, 0, mpfx_4,
+                                                 *mp1, route::itf_flags_t::ACCEPT));
+    TRY_CHECK_RC(OM::write(ian, *mroute_4));
+
     STRICT_ORDER_OFF();
     // delete the stack objects that hold references to others
     // so the OM::remove is the call that removes the last reference
@@ -1679,16 +1818,34 @@ BOOST_AUTO_TEST_CASE(test_routing) {
     delete l3_10;
     delete itf2;
     delete route_5;
-    delete path_10;
     delete route_5_2;
-    delete path_11;
     delete route_dvr;
-    delete path_l2;
     delete ne;
-    ADD_EXPECT(neighbour_cmds::delete_cmd(hw_neighbour, hw_ifh.data(), mac_n, nh_10));
-    ADD_EXPECT(route::ip_route_cmds::delete_cmd(hw_route_dvr, 0, pfx_6));
-    ADD_EXPECT(route::ip_route_cmds::delete_cmd(hw_route_5_2, 1, pfx_5));
-    ADD_EXPECT(route::ip_route_cmds::delete_cmd(hw_route_5, 0, pfx_5));
+    delete mroute_4;
+
+    ADD_EXPECT(route::ip_mroute_cmds::delete_cmd(hw_mroute_4, 0, mpfx_4,
+                                                 *mp1, route::itf_flags_t::FORWARD));
+    ADD_EXPECT(route::ip_mroute_cmds::delete_cmd(hw_mroute_4, 0, mpfx_4,
+                                                 *mp2, route::itf_flags_t::FORWARD));
+    ADD_EXPECT(route::ip_mroute_cmds::delete_cmd(hw_mroute_4, 0, mpfx_4,
+                                                 *mp1, route::itf_flags_t::ACCEPT));
+
+    delete mp1;
+    delete mp2;
+
+    ADD_EXPECT(neighbour_cmds::delete_cmd(hw_neighbour, hw_ifh.data(),
+                                          mac_n, nh_10,
+                                          neighbour::flags_t::STATIC));
+    ADD_EXPECT(route::ip_route_cmds::delete_cmd(hw_route_dvr, 0, pfx_6, *path_l2));
+    ADD_EXPECT(route::ip_route_cmds::delete_cmd(hw_route_5_2, 1, pfx_5, *path_11));
+    ADD_EXPECT(route::ip_route_cmds::delete_cmd(hw_route_5_2, 1, pfx_5, *path_12));
+    ADD_EXPECT(route::ip_route_cmds::delete_cmd(hw_route_5, 0, pfx_5, *path_10));
+
+    delete path_10;
+    delete path_11;
+    delete path_12;
+    delete path_l2;
+
     ADD_EXPECT(l3_binding_cmds::unbind_cmd(hw_l3_10_unbind, hw_ifh.data(), pfx_10));
     ADD_EXPECT(l3_binding_cmds::unbind_cmd(hw_l3_11_unbind, hw_ifh2.data(), pfx_11));
     ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh));
@@ -1971,7 +2128,8 @@ BOOST_AUTO_TEST_CASE(test_pipes) {
 
     ADD_EXPECT(l2_binding_cmds::bind_cmd(hw_l2_1_bind,
                                          pipe1.east()->handle(),
-                                         hw_bd.data(), false));
+                                         hw_bd.data(),
+                                         l2_binding::l2_port_type_t::L2_PORT_TYPE_NORMAL));
     TRY_CHECK_RC(OM::write(gk, *l2_1));
 
     l2_binding *l2_2 = new l2_binding(*pipe1.west(), bd1);
@@ -1979,7 +2137,8 @@ BOOST_AUTO_TEST_CASE(test_pipes) {
 
     ADD_EXPECT(l2_binding_cmds::bind_cmd(hw_l2_2_bind,
                                          pipe1.west()->handle(),
-                                         hw_bd.data(), false));
+                                         hw_bd.data(),
+                                         l2_binding::l2_port_type_t::L2_PORT_TYPE_NORMAL));
     TRY_CHECK_RC(OM::write(gk, *l2_2));
 
     STRICT_ORDER_OFF();
@@ -1989,11 +2148,11 @@ BOOST_AUTO_TEST_CASE(test_pipes) {
     ADD_EXPECT(l2_binding_cmds::unbind_cmd(hw_l2_1_bind,
                                            pipe1.east()->handle(),
                                            hw_bd.data(),
-                                           false));
+                                           l2_binding::l2_port_type_t::L2_PORT_TYPE_NORMAL));
     ADD_EXPECT(l2_binding_cmds::unbind_cmd(hw_l2_1_bind,
                                            pipe1.west()->handle(),
                                            hw_bd.data(),
-                                           false));
+                                           l2_binding::l2_port_type_t::L2_PORT_TYPE_NORMAL));
     ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_hdl));
     ADD_EXPECT(pipe_cmds::delete_cmd(hw_hdl, hw_hdl_pair));
     ADD_EXPECT(bridge_domain_cmds::delete_cmd(hw_bd));