VOM: support for pipes
[vpp.git] / test / ext / vom_test.cpp
index c9ae255..5ccdf55 100644 (file)
 #include "vom/om.hpp"
 #include "vom/interface.hpp"
 #include "vom/interface_cmds.hpp"
+#include "vom/bond_interface_cmds.hpp"
+#include "vom/bond_group_binding.hpp"
+#include "vom/bond_group_binding_cmds.hpp"
 #include "vom/l2_binding.hpp"
 #include "vom/l2_binding_cmds.hpp"
+#include "vom/l2_xconnect.hpp"
+#include "vom/l2_xconnect_cmds.hpp"
 #include "vom/l3_binding.hpp"
 #include "vom/l3_binding_cmds.hpp"
 #include "vom/bridge_domain.hpp"
@@ -39,6 +44,8 @@
 #include "vom/vxlan_tunnel_cmds.hpp"
 #include "vom/sub_interface.hpp"
 #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_binding.hpp"
 #include "vom/acl_list_cmds.hpp"
@@ -60,6 +67,8 @@
 #include "vom/nat_static_cmds.hpp"
 #include "vom/nat_binding.hpp"
 #include "vom/nat_binding_cmds.hpp"
+#include "vom/pipe.hpp"
+#include "vom/pipe_cmds.hpp"
 
 using namespace boost;
 using namespace VOM;
@@ -80,7 +89,7 @@ public:
 class MockListener : public interface::event_listener,
                      public interface::stat_listener
 {
-    void handle_interface_stat(interface_cmds::stats_cmd *cmd)
+    void handle_interface_stat(interface_cmds::stats_enable_cmd *cmd)
     {
     }
     void handle_interface_event(interface_cmds::events_cmd *cmd)
@@ -172,6 +181,14 @@ public:
                     {
                         rc = handle_derived<interface_cmds::loopback_create_cmd>(f_exp, f_act);
                     }
+                    else if (typeid(*f_exp) == typeid(interface_cmds::vhost_create_cmd))
+                    {
+                        rc = handle_derived<interface_cmds::vhost_create_cmd>(f_exp, f_act);
+                    }
+                    else if (typeid(*f_exp) == typeid(bond_interface_cmds::create_cmd))
+                    {
+                       rc = handle_derived<bond_interface_cmds::create_cmd>(f_exp, f_act);
+                    }
                     else if (typeid(*f_exp) == typeid(interface_cmds::loopback_delete_cmd))
                     {
                         rc = handle_derived<interface_cmds::loopback_delete_cmd>(f_exp, f_act);
@@ -180,6 +197,14 @@ public:
                     {
                         rc = handle_derived<interface_cmds::af_packet_delete_cmd>(f_exp, f_act);
                     }
+                    else if (typeid(*f_exp) == typeid(interface_cmds::vhost_delete_cmd))
+                    {
+                       rc = handle_derived<interface_cmds::vhost_delete_cmd>(f_exp, f_act);
+                    }
+                    else if (typeid(*f_exp) == typeid(bond_interface_cmds::delete_cmd))
+                    {
+                       rc = handle_derived<bond_interface_cmds::delete_cmd>(f_exp, f_act);
+                    }
                     else if (typeid(*f_exp) == typeid(interface_cmds::state_change_cmd))
                     {
                         rc = handle_derived<interface_cmds::state_change_cmd>(f_exp, f_act);
@@ -196,6 +221,14 @@ public:
                     {
                         rc = handle_derived<interface_cmds::set_tag>(f_exp, f_act);
                     }
+                    else if (typeid(*f_exp) == typeid(bond_group_binding_cmds::bind_cmd))
+                    {
+                       rc = handle_derived<bond_group_binding_cmds::bind_cmd>(f_exp, f_act);
+                    }
+                    else if (typeid(*f_exp) == typeid(bond_group_binding_cmds::unbind_cmd))
+                    {
+                       rc = handle_derived<bond_group_binding_cmds::unbind_cmd>(f_exp, f_act);
+                    }
                     else if (typeid(*f_exp) == typeid(route_domain_cmds::create_cmd))
                     {
                        rc = handle_derived<route_domain_cmds::create_cmd>(f_exp, f_act);
@@ -264,6 +297,14 @@ public:
                     {
                         rc = handle_derived<l2_binding_cmds::set_vtr_op_cmd>(f_exp, f_act);
                     }
+                    else if (typeid(*f_exp) == typeid(l2_xconnect_cmds::bind_cmd))
+                    {
+                        rc = handle_derived<l2_xconnect_cmds::bind_cmd>(f_exp, f_act);
+                    }
+                    else if (typeid(*f_exp) == typeid(l2_xconnect_cmds::unbind_cmd))
+                    {
+                        rc = handle_derived<l2_xconnect_cmds::unbind_cmd>(f_exp, f_act);
+                    }
                     else if (typeid(*f_exp) == typeid(vxlan_tunnel_cmds::create_cmd))
                     {
                         rc = handle_derived<vxlan_tunnel_cmds::create_cmd>(f_exp, f_act);
@@ -280,6 +321,14 @@ public:
                     {
                         rc = handle_derived<sub_interface_cmds::delete_cmd>(f_exp, f_act);
                     }
+                    else if (typeid(*f_exp) == typeid(ACL::acl_ethertype_cmds::bind_cmd))
+                    {
+                        rc = handle_derived<ACL::acl_ethertype_cmds::bind_cmd>(f_exp, f_act);
+                    }
+                    else if (typeid(*f_exp) == typeid(ACL::acl_ethertype_cmds::unbind_cmd))
+                    {
+                        rc = handle_derived<ACL::acl_ethertype_cmds::unbind_cmd>(f_exp, f_act);
+                    }
                     else if (typeid(*f_exp) == typeid(ACL::list_cmds::l3_update_cmd))
                     {
                         rc = handle_derived<ACL::list_cmds::l3_update_cmd>(f_exp, f_act);
@@ -380,6 +429,14 @@ public:
                     {
                         rc = handle_derived<interface_cmds::events_cmd>(f_exp, f_act);
                     }
+                    else if (typeid(*f_exp) == typeid(pipe_cmds::create_cmd))
+                    {
+                        rc = handle_derived<pipe_cmds::create_cmd>(f_exp, f_act);
+                    }
+                    else if (typeid(*f_exp) == typeid(pipe_cmds::delete_cmd))
+                    {
+                        rc = handle_derived<pipe_cmds::delete_cmd>(f_exp, f_act);
+                    }
                     else
                     {
                         throw ExpException(2);
@@ -472,7 +529,7 @@ public:
     }
 };
 
-BOOST_AUTO_TEST_SUITE(VppOM_test)
+BOOST_AUTO_TEST_SUITE(vom)
 
 #define TRY_CHECK_RC(stmt)                    \
 {                                             \
@@ -599,12 +656,15 @@ BOOST_AUTO_TEST_CASE(test_interface) {
     TRY_CHECK(OM::mark(go));
 
     std::string itf2_name = "afpacket2";
+    std::string itf2_tag = "uuid-of-afpacket2-interface";
     interface itf2(itf2_name,
                    interface::type_t::AFPACKET,
-                   interface::admin_state_t::UP);
+                   interface::admin_state_t::UP,
+                   itf2_tag);
     HW::item<handle_t> hw_ifh2(3, rc_t::OK);
 
     ADD_EXPECT(interface_cmds::af_packet_create_cmd(hw_ifh2, itf2_name));
+    ADD_EXPECT(interface_cmds::set_tag(hw_ifh2, itf2_tag));
     ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh2));
     TRY_CHECK_RC(OM::write(go, itf2));
 
@@ -617,6 +677,23 @@ BOOST_AUTO_TEST_CASE(test_interface) {
     ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh2));
     ADD_EXPECT(interface_cmds::af_packet_delete_cmd(hw_ifh2, itf2_name));
     TRY_CHECK(OM::sweep(go));
+
+
+    std::string itf3_name = "/PATH/TO/vhost_user1.sock";
+    std::string itf3_tag = "uuid-of-vhost_user1-interface";
+    interface itf3(itf3_name,
+                   interface::type_t::VHOST,
+                   interface::admin_state_t::UP,
+                   itf3_tag);
+    HW::item<handle_t> hw_ifh3(4, rc_t::OK);
+
+    ADD_EXPECT(interface_cmds::vhost_create_cmd(hw_ifh3, itf3_name, itf3_tag));
+    ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh3));
+    TRY_CHECK_RC(OM::write(go, itf3));
+
+    ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh3));
+    ADD_EXPECT(interface_cmds::vhost_delete_cmd(hw_ifh3, itf3_name));
+    TRY_CHECK(OM::remove(go));
 }
 
 BOOST_AUTO_TEST_CASE(test_bvi) {
@@ -732,10 +809,85 @@ BOOST_AUTO_TEST_CASE(test_bvi) {
     TRY_CHECK(OM::remove(graham));
 }
 
+BOOST_AUTO_TEST_CASE(test_bond) {
+    VppInit vi;
+    const std::string cb = "CarolBerg";
+    rc_t rc = rc_t::OK;
+
+    /*
+     * creates the interfaces
+     */
+    std::string itf1_name = "afpacket1";
+    interface itf1(itf1_name,
+                   interface::type_t::AFPACKET,
+                   interface::admin_state_t::UP);
+
+    HW::item<handle_t> hw_ifh(2, rc_t::OK);
+    ADD_EXPECT(interface_cmds::af_packet_create_cmd(hw_ifh, itf1_name));
+
+    HW::item<interface::admin_state_t> hw_as_up(interface::admin_state_t::UP, rc_t::OK);
+    ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh));
+
+    TRY_CHECK_RC(OM::write(cb, itf1));
+
+    std::string itf2_name = "afpacket2";
+    interface itf2(itf2_name,
+                   interface::type_t::AFPACKET,
+                   interface::admin_state_t::UP);
+
+
+    HW::item<handle_t> hw_ifh2(4, rc_t::OK);
+    ADD_EXPECT(interface_cmds::af_packet_create_cmd(hw_ifh2, itf2_name));
+    ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh2));
+
+    TRY_CHECK_RC(OM::write(cb, itf2));
+
+    std::string bond_name = "bond";
+    bond_interface bond_itf(bond_name, interface::admin_state_t::UP,
+                                 bond_interface::mode_t::LACP);
+
+    HW::item<handle_t> hw_ifh3(6, rc_t::OK);
+    ADD_EXPECT(bond_interface_cmds::create_cmd(hw_ifh3, bond_name,
+      bond_interface::mode_t::LACP, bond_interface::lb_t::L2, l2_address_t::ZERO));
+    ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh3));
+
+    TRY_CHECK_RC(OM::write(cb, bond_itf));
+
+    bond_member *bm1 = new bond_member(itf1, bond_member::mode_t::ACTIVE,
+                                         bond_member::rate_t::SLOW);
+    bond_member *bm2 = new bond_member(itf2, bond_member::mode_t::ACTIVE,
+                                         bond_member::rate_t::SLOW);
+    bond_group_binding *bgb = new bond_group_binding(bond_itf, {*bm1, *bm2});
+
+    HW::item<bool> bond_hw_bind(true, rc_t::OK);
+    ADD_EXPECT(bond_group_binding_cmds::bind_cmd(bond_hw_bind, hw_ifh3.data(), *bm1));
+    ADD_EXPECT(bond_group_binding_cmds::bind_cmd(bond_hw_bind, hw_ifh3.data(), *bm2));
+
+    TRY_CHECK_RC(OM::write(cb, *bgb));
+
+    delete bgb;
+    delete bm2;
+    delete bm1;
+
+    STRICT_ORDER_OFF();
+    HW::item<interface::admin_state_t> hw_as_down(interface::admin_state_t::DOWN, rc_t::OK);
+    ADD_EXPECT(bond_group_binding_cmds::unbind_cmd(bond_hw_bind, hw_ifh.data()));
+    ADD_EXPECT(bond_group_binding_cmds::unbind_cmd(bond_hw_bind, hw_ifh2.data()));
+    ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh2));
+    ADD_EXPECT(interface_cmds::af_packet_delete_cmd(hw_ifh2, itf2_name));
+    ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh3));
+    ADD_EXPECT(bond_interface_cmds::delete_cmd(hw_ifh3));
+    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(cb));
+}
+
 BOOST_AUTO_TEST_CASE(test_bridge) {
     VppInit vi;
     const std::string franz = "FranzKafka";
     const std::string dante = "Dante";
+    const std::string jkr = "jkrowling";
     rc_t rc = rc_t::OK;
 
     /*
@@ -760,7 +912,11 @@ BOOST_AUTO_TEST_CASE(test_bridge) {
     bridge_domain bd1(33);
 
     HW::item<uint32_t> hw_bd(33, rc_t::OK);
-    ADD_EXPECT(bridge_domain_cmds::create_cmd(hw_bd, bridge_domain::learning_mode_t::ON));
+    ADD_EXPECT(bridge_domain_cmds::create_cmd(hw_bd,
+                                              bridge_domain::learning_mode_t::ON,
+                                              bridge_domain::arp_term_mode_t::ON,
+                                              bridge_domain::flood_mode_t::ON,
+                                              bridge_domain::mac_age_mode_t::OFF));
 
     TRY_CHECK_RC(OM::write(franz, bd1));
 
@@ -801,7 +957,8 @@ BOOST_AUTO_TEST_CASE(test_bridge) {
     HW::item<bool> hw_be1(true, rc_t::OK);
     mac_address_t mac1({0,1,2,3,4,5});
     bridge_domain_entry *be1 = new bridge_domain_entry(bd1, mac1, itf2);
-    ADD_EXPECT(bridge_domain_entry_cmds::create_cmd(hw_be1, mac1, bd1.id(), hw_ifh2.data()));
+    ADD_EXPECT(bridge_domain_entry_cmds::create_cmd(hw_be1, mac1, bd1.id(), hw_ifh2.data(),
+                                                   false));
     TRY_CHECK_RC(OM::write(dante, *be1));
 
     // Add some entries to the bridge-domain ARP termination table
@@ -827,13 +984,111 @@ BOOST_AUTO_TEST_CASE(test_bridge) {
     delete be1;
     delete bea1;
     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(bridge_domain_cmds::delete_cmd(hw_bd));
     ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh2));
     ADD_EXPECT(interface_cmds::af_packet_delete_cmd(hw_ifh2, itf2_name));
-    ADD_EXPECT(bridge_domain_entry_cmds::delete_cmd(hw_be1, mac1, bd1.id()));
-    ADD_EXPECT(bridge_domain_arp_entry_cmds::delete_cmd(hw_be1, bd1.id(), mac1, ip1));
-    ADD_EXPECT(bridge_domain_cmds::delete_cmd(hw_bd));
     TRY_CHECK(OM::remove(dante));
+
+    // test the BVI entry in l2fib
+    bridge_domain bd2(99);
+
+    HW::item<uint32_t> hw_bd2(99, rc_t::OK);
+    ADD_EXPECT(bridge_domain_cmds::create_cmd(hw_bd2,
+                                              bridge_domain::learning_mode_t::ON,
+                                              bridge_domain::arp_term_mode_t::ON,
+                                              bridge_domain::flood_mode_t::ON,
+                                              bridge_domain::mac_age_mode_t::OFF));
+
+    TRY_CHECK_RC(OM::write(jkr, bd2));
+
+    std::string itf3_name = "bvi";
+    interface itf3(itf3_name,
+                   interface::type_t::BVI,
+                   interface::admin_state_t::UP);
+
+    HW::item<handle_t> hw_ifh3(5, rc_t::OK);
+    ADD_EXPECT(interface_cmds::loopback_create_cmd(hw_ifh3, itf3_name));
+    ADD_EXPECT(interface_cmds::set_tag(hw_ifh3, itf3_name));
+    ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh3));
+    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));
+    TRY_CHECK_RC(OM::write(jkr, *l2itf3));
+
+    HW::item<bool> hw_be2(true, rc_t::OK);
+    mac_address_t mac2({0,1,2,3,4,5});
+    bridge_domain_entry *be2 = new bridge_domain_entry(bd2, mac2, itf3);
+    ADD_EXPECT(bridge_domain_entry_cmds::create_cmd(hw_be2, mac2, bd2.id(), hw_ifh3.data(), true));
+    TRY_CHECK_RC(OM::write(jkr, *be2));
+
+    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(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));
+    ADD_EXPECT(bridge_domain_cmds::delete_cmd(hw_bd2));
+    TRY_CHECK(OM::remove(jkr));
+}
+
+BOOST_AUTO_TEST_CASE(test_l2_xconnect) {
+    VppInit vi;
+    const std::string nicholas = "NicholasAbercrombie";
+    rc_t rc = rc_t::OK;
+
+    /*
+     * Interface 1
+     */
+    std::string itf1_name = "host1";
+    interface itf1(itf1_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, itf1_name));
+    ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh));
+    TRY_CHECK_RC(OM::write(nicholas, itf1));
+
+    /*
+     * Interface 2
+     */
+    std::string itf2_name = "host2";
+    interface itf2(itf2_name,
+                   interface::type_t::AFPACKET,
+                   interface::admin_state_t::UP);
+
+    HW::item<handle_t> hw_ifh2(4, rc_t::OK);
+    ADD_EXPECT(interface_cmds::af_packet_create_cmd(hw_ifh2, itf2_name));
+    ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh2));
+    TRY_CHECK_RC(OM::write(nicholas, itf2));
+
+    l2_xconnect *l2_xconn = new l2_xconnect(itf1, itf2);
+    HW::item<bool> xconnect_east(true, rc_t::OK);
+    HW::item<bool> xconnect_west(true, rc_t::OK);
+    HW::item<bool> xconnect_east_unbind(false, rc_t::OK);
+    HW::item<bool> xconnect_west_unbind(false, rc_t::OK);
+    ADD_EXPECT(l2_xconnect_cmds::bind_cmd(xconnect_east, hw_ifh.data(), hw_ifh2.data()));
+    ADD_EXPECT(l2_xconnect_cmds::bind_cmd(xconnect_west, hw_ifh2.data(), hw_ifh.data()));
+    TRY_CHECK_RC(OM::write(nicholas, *l2_xconn));
+
+    delete l2_xconn;
+
+    HW::item<interface::admin_state_t> hw_as_down(interface::admin_state_t::DOWN, rc_t::OK);
+    STRICT_ORDER_OFF();
+    ADD_EXPECT(l2_xconnect_cmds::unbind_cmd(xconnect_east_unbind, hw_ifh.data(), hw_ifh2.data()));
+    ADD_EXPECT(l2_xconnect_cmds::unbind_cmd(xconnect_west_unbind, hw_ifh2.data(), hw_ifh.data()));
+    ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh2));
+    ADD_EXPECT(interface_cmds::af_packet_delete_cmd(hw_ifh2, itf2_name));
+    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(nicholas));
 }
 
 BOOST_AUTO_TEST_CASE(test_vxlan) {
@@ -847,8 +1102,8 @@ BOOST_AUTO_TEST_CASE(test_vxlan) {
 
     // VXLAN create
     vxlan_tunnel::endpoint_t ep(boost::asio::ip::address::from_string("10.10.10.10"),
-                               boost::asio::ip::address::from_string("10.10.10.11"),
-                               322);
+                                boost::asio::ip::address::from_string("10.10.10.11"),
+                                322);
 
     vxlan_tunnel vxt(ep.src, ep.dst, ep.vni);
 
@@ -858,10 +1113,17 @@ BOOST_AUTO_TEST_CASE(test_vxlan) {
     TRY_CHECK_RC(OM::write(franz, vxt));
 
     // bridge-domain create
-    bridge_domain bd1(33, bridge_domain::learning_mode_t::OFF);
+    bridge_domain bd1(33, bridge_domain::learning_mode_t::OFF,
+                      bridge_domain::arp_term_mode_t::OFF,
+                      bridge_domain::flood_mode_t::OFF,
+                      bridge_domain::mac_age_mode_t::ON);
 
     HW::item<uint32_t> hw_bd(33, rc_t::OK);
-    ADD_EXPECT(bridge_domain_cmds::create_cmd(hw_bd, bridge_domain::learning_mode_t::OFF));
+    ADD_EXPECT(bridge_domain_cmds::create_cmd(hw_bd,
+                                              bridge_domain::learning_mode_t::OFF,
+                                              bridge_domain::arp_term_mode_t::OFF,
+                                              bridge_domain::flood_mode_t::OFF,
+                                              bridge_domain::mac_age_mode_t::ON));
 
     TRY_CHECK_RC(OM::write(franz, bd1));
 
@@ -942,6 +1204,15 @@ BOOST_AUTO_TEST_CASE(test_acl) {
     ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh));
     TRY_CHECK_RC(OM::write(fyodor, itf1));
 
+    ACL::ethertype_rule_t e1(ethertype_t::ARP, direction_t::INPUT);
+    ACL::ethertype_rule_t e2(ethertype_t::ARP, direction_t::OUTPUT);
+    ACL::ethertype_rule_t e3(ethertype_t::IPV4, direction_t::INPUT);
+    ACL::acl_ethertype::ethertype_rules_t l_e = {e1, e2, e3};
+    ACL::acl_ethertype *a_e = new ACL::acl_ethertype(itf1, l_e);
+    HW::item<bool> ae_binding(true, rc_t::OK);
+    ADD_EXPECT(ACL::acl_ethertype_cmds::bind_cmd(ae_binding, hw_ifh.data(), l_e));
+    TRY_CHECK_RC(OM::write(fyodor, *a_e));
+
     route::prefix_t src("10.10.10.10", 32);
     ACL::l3_rule r1(10, ACL::action_t::PERMIT, src, route::prefix_t::ZERO);
     ACL::l3_rule r2(20, ACL::action_t::DENY, route::prefix_t::ZERO, route::prefix_t::ZERO);
@@ -956,6 +1227,13 @@ BOOST_AUTO_TEST_CASE(test_acl) {
     ADD_EXPECT(ACL::list_cmds::l3_update_cmd(hw_acl, acl_name, rules));
     TRY_CHECK_RC(OM::write(fyodor, acl1));
 
+    ACL::l3_rule r3(30, ACL::action_t::PERMIT, route::prefix_t::ZERO, route::prefix_t::ZERO);
+    ACL::l3_list acl2(acl_name);
+    acl2.insert(r3);
+    ACL::l3_list::rules_t rules2 = {r3};
+    ADD_EXPECT(ACL::list_cmds::l3_update_cmd(hw_acl, acl_name, rules2));
+    TRY_CHECK_RC(OM::write(fyodor, acl2));
+
     ACL::l3_binding *l3b = new ACL::l3_binding(direction_t::INPUT, itf1, acl1);
     HW::item<bool> hw_binding(true, rc_t::OK);
     ADD_EXPECT(ACL::binding_cmds::l3_bind_cmd(hw_binding, direction_t::INPUT,
@@ -996,12 +1274,14 @@ BOOST_AUTO_TEST_CASE(test_acl) {
     TRY_CHECK(OM::remove(leo));
 
     delete l3b;
+    delete a_e;
     HW::item<interface::admin_state_t> hw_as_down(interface::admin_state_t::DOWN,
                                                   rc_t::OK);
     STRICT_ORDER_OFF();
     ADD_EXPECT(ACL::binding_cmds::l3_unbind_cmd(hw_binding, direction_t::INPUT,
                                          hw_ifh.data(), hw_acl.data()));
     ADD_EXPECT(ACL::list_cmds::l3_delete_cmd(hw_acl));
+    ADD_EXPECT(ACL::acl_ethertype_cmds::unbind_cmd(ae_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, itf1_name));
 
@@ -1031,7 +1311,7 @@ BOOST_AUTO_TEST_CASE(test_arp_proxy) {
     ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh));
     TRY_CHECK_RC(OM::write(kurt, itf3));
 
-    arp_proxy_binding *apb = new arp_proxy_binding(itf3, ap);
+    arp_proxy_binding *apb = new arp_proxy_binding(itf3);
     HW::item<bool> hw_binding(true, rc_t::OK);
     ADD_EXPECT(arp_proxy_binding_cmds::bind_cmd(hw_binding, hw_ifh.data()));
     TRY_CHECK_RC(OM::write(kurt, *apb));
@@ -1463,8 +1743,6 @@ BOOST_AUTO_TEST_CASE(test_interface_events) {
 
     HW::enqueue(itf);
     HW::write();
-
-    HW::dequeue(itf);
 }
 
 BOOST_AUTO_TEST_CASE(test_interface_route_domain_change) {
@@ -1554,4 +1832,110 @@ BOOST_AUTO_TEST_CASE(test_interface_route_domain_change) {
     TRY_CHECK(OM::remove(rene));
 }
 
+BOOST_AUTO_TEST_CASE(test_prefixes) {
+    route::prefix_t p6_s_16(boost::asio::ip::address::from_string("2001::"), 16);
+
+    BOOST_CHECK(p6_s_16.mask() == boost::asio::ip::address::from_string("ffff::"));
+
+    route::prefix_t p6_s_17(boost::asio::ip::address::from_string("2001:ff00::"), 17);
+
+    BOOST_CHECK(p6_s_17.mask() == boost::asio::ip::address::from_string("ffff:8000::"));
+    BOOST_CHECK(p6_s_17.low().address() == boost::asio::ip::address::from_string("2001:8000::"));
+
+    route::prefix_t p6_s_15(boost::asio::ip::address::from_string("2001:ff00::"), 15);
+    BOOST_CHECK(p6_s_15.mask() == boost::asio::ip::address::from_string("fffe::"));
+    BOOST_CHECK(p6_s_15.low().address() == boost::asio::ip::address::from_string("2000::"));
+
+    route::prefix_t p4_s_16(boost::asio::ip::address::from_string("192.168.0.0"), 16);
+
+    BOOST_CHECK(p4_s_16.mask() == boost::asio::ip::address::from_string("255.255.0.0"));
+
+    route::prefix_t p4_s_17(boost::asio::ip::address::from_string("192.168.127.0"), 17);
+
+    BOOST_CHECK(p4_s_17.mask() == boost::asio::ip::address::from_string("255.255.128.0"));
+    BOOST_CHECK(p4_s_17.low().address() == boost::asio::ip::address::from_string("192.168.0.0"));
+    BOOST_CHECK(p4_s_17.high().address() == boost::asio::ip::address::from_string("192.168.127.255"));
+
+    route::prefix_t p4_s_15(boost::asio::ip::address::from_string("192.168.255.255"), 15);
+
+    BOOST_CHECK(p4_s_15.mask() == boost::asio::ip::address::from_string("255.254.0.0"));
+    BOOST_CHECK(p4_s_15.low().address() == boost::asio::ip::address::from_string("192.168.0.0"));
+    BOOST_CHECK(p4_s_15.high().address() == boost::asio::ip::address::from_string("192.169.255.255"));
+
+    route::prefix_t p4_s_32(boost::asio::ip::address::from_string("192.168.1.1"), 32);
+
+    BOOST_CHECK(p4_s_32.mask() == boost::asio::ip::address::from_string("255.255.255.255"));
+    BOOST_CHECK(p4_s_32.low().address() == boost::asio::ip::address::from_string("192.168.1.1"));
+    BOOST_CHECK(p4_s_32.high().address() == boost::asio::ip::address::from_string("192.168.1.1"));
+
+}
+
+BOOST_AUTO_TEST_CASE(test_pipes) {
+    VppInit vi;
+    const std::string gk = "GKChesterton";
+
+    const std::string pipe_name_1 = "pipe1";
+    VOM::pipe pipe1(1, interface::admin_state_t::UP);
+    HW::item<handle_t> hw_hdl(4, rc_t::OK);
+    HW::item<pipe::handle_pair_t> hw_hdl_pair(std::make_pair(5,6), rc_t::OK);
+
+    HW::item<interface::admin_state_t> hw_as_up(interface::admin_state_t::UP,
+                                                rc_t::OK);
+    HW::item<interface::admin_state_t> hw_as_down(interface::admin_state_t::DOWN,
+                                                  rc_t::OK);
+    ADD_EXPECT(pipe_cmds::create_cmd(hw_hdl, pipe_name_1, 1, hw_hdl_pair));
+    ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_hdl));
+    TRY_CHECK_RC(OM::write(gk, pipe1));
+
+    pipe1.set_ends(hw_hdl_pair.data());
+
+    // put each end of the pipe in a BD
+    bridge_domain bd1(33, bridge_domain::learning_mode_t::OFF,
+                      bridge_domain::arp_term_mode_t::OFF,
+                      bridge_domain::flood_mode_t::OFF,
+                      bridge_domain::mac_age_mode_t::ON);
+
+    HW::item<uint32_t> hw_bd(33, rc_t::OK);
+    ADD_EXPECT(bridge_domain_cmds::create_cmd(hw_bd,
+                                              bridge_domain::learning_mode_t::OFF,
+                                              bridge_domain::arp_term_mode_t::OFF,
+                                              bridge_domain::flood_mode_t::OFF,
+                                              bridge_domain::mac_age_mode_t::ON));
+
+    TRY_CHECK_RC(OM::write(gk, bd1));
+
+    l2_binding *l2_1 = new l2_binding(*pipe1.east(), bd1);
+    HW::item<bool> hw_l2_1_bind(true, rc_t::OK);
+
+    ADD_EXPECT(l2_binding_cmds::bind_cmd(hw_l2_1_bind,
+                                         pipe1.east()->handle(),
+                                         hw_bd.data(), false));
+    TRY_CHECK_RC(OM::write(gk, *l2_1));
+
+    l2_binding *l2_2 = new l2_binding(*pipe1.west(), bd1);
+    HW::item<bool> hw_l2_2_bind(true, rc_t::OK);
+
+    ADD_EXPECT(l2_binding_cmds::bind_cmd(hw_l2_2_bind,
+                                         pipe1.west()->handle(),
+                                         hw_bd.data(), false));
+    TRY_CHECK_RC(OM::write(gk, *l2_2));
+
+    STRICT_ORDER_OFF();
+
+    delete l2_1;
+    delete l2_2;
+    ADD_EXPECT(l2_binding_cmds::unbind_cmd(hw_l2_1_bind,
+                                           pipe1.east()->handle(),
+                                           hw_bd.data(),
+                                           false));
+    ADD_EXPECT(l2_binding_cmds::unbind_cmd(hw_l2_1_bind,
+                                           pipe1.west()->handle(),
+                                           hw_bd.data(),
+                                           false));
+    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));
+    TRY_CHECK(OM::remove(gk));
+}
+
 BOOST_AUTO_TEST_SUITE_END()