From 49c7f0ca1770304183a8bdfa23a5df751a056401 Mon Sep 17 00:00:00 2001 From: Mohsin Kazmi Date: Wed, 7 Feb 2018 20:20:36 +0100 Subject: VOM: ACL: Add Object Model for acl ethertype Change-Id: I2b572ebd4b7bb26381f127912a4cc0825c04fc34 Signed-off-by: Mohsin Kazmi --- test/ext/vom_test.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/ext') diff --git a/test/ext/vom_test.cpp b/test/ext/vom_test.cpp index 0a687c5017c..d9bd67984f1 100644 --- a/test/ext/vom_test.cpp +++ b/test/ext/vom_test.cpp @@ -39,6 +39,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" @@ -280,6 +282,10 @@ public: { rc = handle_derived(f_exp, f_act); } + else if (typeid(*f_exp) == typeid(ACL::acl_ethertype_cmds::bind_cmd)) + { + rc = handle_derived(f_exp, f_act); + } else if (typeid(*f_exp) == typeid(ACL::list_cmds::l3_update_cmd)) { rc = handle_derived(f_exp, f_act); @@ -984,6 +990,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 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); @@ -1038,6 +1053,7 @@ BOOST_AUTO_TEST_CASE(test_acl) { TRY_CHECK(OM::remove(leo)); delete l3b; + delete a_e; HW::item hw_as_down(interface::admin_state_t::DOWN, rc_t::OK); STRICT_ORDER_OFF(); -- cgit 1.2.3-korg