def setUp(self):
        super(L3outVlanAllocationTestCase, self).setUp()
        self.context = context.get_admin_context()
        ext_net_dict = {
            'Mgmt-Out': {
                'router_id': '1.0.0.2',
                'host_pool_cidr': '10.1.2.1/24',
                'port': '1/48',
                'switch': '401',
                'gateway_ip': '1.103.2.1',
                'router_type': 'asr',
                'vlan_range': '1500:1500, 1510:1510',
                'cidr_exposed': '1.103.2.254/24'
            },
            'DC-Out': {
                'router_id': '1.0.0.1',
                'host_pool_cidr': '10.1.2.1/24',
                'port': '1/48',
                'switch': '401',
                'gateway_ip': '1.103.2.1',
                'router_type': 'asr',
                'vlan_range': '1051:1055',
                'cidr_exposed': '1.103.2.254/24'
            },
        }

        self.l3out_vlan_alloc = l3out_vlan_alloc.L3outVlanAlloc()
        self.l3out_vlan_alloc.sync_vlan_allocations(ext_net_dict)
 def test_no_range_no_exception(self):
     ext_net_dict = {
         'NoRange-Out': {
             'router_id': '1.0.0.1',
             'cidr_exposed': '1.103.2.254/24'
         }
     }
     no_range_l3out_vlan_alloc = l3out_vlan_alloc.L3outVlanAlloc()
     no_range_l3out_vlan_alloc.sync_vlan_allocations(ext_net_dict)
 def test_bad_range_no_exception(self):
     bad_ext_net_dict = {
         'BadRange-Out': {
             'router_id': '1.0.0.1',
             'vlan_range': '4000:5000',
             'cidr_exposed': '1.103.2.254/24'
         }
     }
     bad_range_l3out_vlan_alloc = l3out_vlan_alloc.L3outVlanAlloc()
     bad_range_l3out_vlan_alloc.sync_vlan_allocations(bad_ext_net_dict)