def resource_setup(cls):
super(L2GatewayConnectionTest, cls).resource_setup()
# create primary tenant's VLAN network
_subnet = cls.getattr_or_skip_test("vlan_subnet_ipv4_dict")
for _x in ('mask_bits',):
if _x in _subnet:
_subnet[_x] = int(_subnet[_x])
# cidr must be presented & in IPNetwork structure
_subnet['cidr'] = netaddr.IPNetwork(_subnet['cidr'])
_start = _subnet.pop('start', None)
_end = _subnet.pop('end', None)
if _start and _end:
_subnet['allocation_pools'] = [{'start': _start, 'end': _end}]
cls.network = cls.create_network()
# baseAdminNetworkTest does not derive ip_version, mask_bits from cidr
_subnet['ip_version'] = 4
if 'mask_bits' not in _subnet:
_subnet['mask_bits'] = _subnet['cidr'].prefixlen
cls.subnet = cls.create_subnet(cls.network, **_subnet)
test_l2_gateway_connection.py 文件源码
python
阅读 18
收藏 0
点赞 0
评论 0
评论列表
文章目录