reassembly: feature/concurrency
[vpp.git] / test / ext / vom_test.cpp
index 4c09ab4..435d8fd 100644 (file)
@@ -174,6 +174,10 @@ 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(interface_cmds::loopback_delete_cmd))
                     {
                         rc = handle_derived<interface_cmds::loopback_delete_cmd>(f_exp, f_act);
@@ -182,6 +186,10 @@ 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(interface_cmds::state_change_cmd))
                     {
                         rc = handle_derived<interface_cmds::state_change_cmd>(f_exp, f_act);
@@ -286,6 +294,10 @@ public:
                     {
                         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);
@@ -605,12 +617,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));
 
@@ -623,6 +638,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) {
@@ -1067,6 +1099,7 @@ BOOST_AUTO_TEST_CASE(test_acl) {
     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));