#NEWLINE# def data( TEST ) : #NEWLINE# #INDENT# TEST . agents = utils . TestDataContainer ( ) #NEWLINE# TEST . networks = utils . TestDataContainer ( ) #NEWLINE# TEST . subnets = utils . TestDataContainer ( ) #NEWLINE# TEST . subnetpools = utils . TestDataContainer ( ) #NEWLINE# TEST . ports = utils . TestDataContainer ( ) #NEWLINE# TEST . routers = utils . TestDataContainer ( ) #NEWLINE# TEST . routers_with_rules = utils . TestDataContainer ( ) #NEWLINE# TEST . routers_with_routes = utils . TestDataContainer ( ) #NEWLINE# TEST . q_floating_ips = utils . TestDataContainer ( ) #NEWLINE# TEST . q_secgroups = utils . TestDataContainer ( ) #NEWLINE# TEST . q_secgroup_rules = utils . TestDataContainer ( ) #NEWLINE# TEST . providers = utils . TestDataContainer ( ) #NEWLINE# TEST . pools = utils . TestDataContainer ( ) #NEWLINE# TEST . vips = utils . TestDataContainer ( ) #NEWLINE# TEST . members = utils . TestDataContainer ( ) #NEWLINE# TEST . monitors = utils . TestDataContainer ( ) #NEWLINE# TEST . neutron_quotas = utils . TestDataContainer ( ) #NEWLINE# TEST . neutron_quota_usages = utils . TestDataContainer ( ) #NEWLINE# TEST . net_profiles = utils . TestDataContainer ( ) #NEWLINE# TEST . policy_profiles = utils . TestDataContainer ( ) #NEWLINE# TEST . network_profile_binding = utils . TestDataContainer ( ) #NEWLINE# TEST . policy_profile_binding = utils . TestDataContainer ( ) #NEWLINE# TEST . vpnservices = utils . TestDataContainer ( ) #NEWLINE# TEST . ikepolicies = utils . TestDataContainer ( ) #NEWLINE# TEST . ipsecpolicies = utils . TestDataContainer ( ) #NEWLINE# TEST . ipsecsiteconnections = utils . TestDataContainer ( ) #NEWLINE# TEST . firewalls = utils . TestDataContainer ( ) #NEWLINE# TEST . fw_policies = utils . TestDataContainer ( ) #NEWLINE# TEST . fw_rules = utils . TestDataContainer ( ) #NEWLINE# TEST . api_agents = utils . TestDataContainer ( ) #NEWLINE# TEST . api_networks = utils . TestDataContainer ( ) #NEWLINE# TEST . api_subnets = utils . TestDataContainer ( ) #NEWLINE# TEST . api_subnetpools = utils . TestDataContainer ( ) #NEWLINE# TEST . api_ports = utils . TestDataContainer ( ) #NEWLINE# TEST . api_routers = utils . TestDataContainer ( ) #NEWLINE# TEST . api_routers_with_routes = utils . TestDataContainer ( ) #NEWLINE# TEST . api_q_floating_ips = utils . TestDataContainer ( ) #NEWLINE# TEST . api_q_secgroups = utils . TestDataContainer ( ) #NEWLINE# TEST . api_q_secgroup_rules = utils . TestDataContainer ( ) #NEWLINE# TEST . api_pools = utils . TestDataContainer ( ) #NEWLINE# TEST . api_vips = utils . TestDataContainer ( ) #NEWLINE# TEST . api_members = utils . TestDataContainer ( ) #NEWLINE# TEST . api_monitors = utils . TestDataContainer ( ) #NEWLINE# TEST . api_extensions = utils . TestDataContainer ( ) #NEWLINE# TEST . api_net_profiles = utils . TestDataContainer ( ) #NEWLINE# TEST . api_policy_profiles = utils . TestDataContainer ( ) #NEWLINE# TEST . api_network_profile_binding = utils . TestDataContainer ( ) #NEWLINE# TEST . api_policy_profile_binding = utils . TestDataContainer ( ) #NEWLINE# TEST . api_vpnservices = utils . TestDataContainer ( ) #NEWLINE# TEST . api_ikepolicies = utils . TestDataContainer ( ) #NEWLINE# TEST . api_ipsecpolicies = utils . TestDataContainer ( ) #NEWLINE# TEST . api_ipsecsiteconnections = utils . TestDataContainer ( ) #NEWLINE# TEST . api_firewalls = utils . TestDataContainer ( ) #NEWLINE# TEST . api_fw_policies = utils . TestDataContainer ( ) #NEWLINE# TEST . api_fw_rules = utils . TestDataContainer ( ) #NEWLINE# network_dict = { #NEWLINE# #INDENT# 'admin_state_up' : True , #NEWLINE# 'id' : '82288d84-e0a5-42ac-95be-e6af08727e42' , #NEWLINE# 'name' : 'net1' , #NEWLINE# 'status' : 'ACTIVE' , #NEWLINE# 'subnets' : [ 'e8abc972-eb0c-41f1-9edd-4bc6e3bcd8c9' ] , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'router:external' : False , #NEWLINE# 'shared' : False , #NEWLINE# #UNINDENT# } #NEWLINE# subnet_dict = { #NEWLINE# #INDENT# 'allocation_pools' : [ { #NEWLINE# #INDENT# 'end' : '10.0.0.254' , #NEWLINE# 'start' : '10.0.0.2' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# 'dns_nameservers' : [ ] , #NEWLINE# 'host_routes' : [ ] , #NEWLINE# 'cidr' : '10.0.0.0/24' , #NEWLINE# 'enable_dhcp' : True , #NEWLINE# 'gateway_ip' : '10.0.0.1' , #NEWLINE# 'id' : network_dict [ 'subnets' ] [ 0 ] , #NEWLINE# 'ip_version' : 4 , #NEWLINE# 'name' : 'mysubnet1' , #NEWLINE# 'network_id' : network_dict [ 'id' ] , #NEWLINE# 'tenant_id' : network_dict [ 'tenant_id' ] , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_networks . add ( network_dict ) #NEWLINE# TEST . api_subnets . add ( subnet_dict ) #NEWLINE# network = copy . deepcopy ( network_dict ) #NEWLINE# subnet = neutron . Subnet ( subnet_dict ) #NEWLINE# network [ 'subnets' ] = [ subnet ] #NEWLINE# TEST . networks . add ( neutron . Network ( network ) ) #NEWLINE# TEST . subnets . add ( subnet ) #NEWLINE# net_profile_dict = { #NEWLINE# #INDENT# 'name' : 'net_profile_test1' , #NEWLINE# 'segment_type' : 'vlan' , #NEWLINE# 'physical_network' : 'phys1' , #NEWLINE# 'segment_range' : '3000-3100' , #NEWLINE# 'id' : '00000000-1111-1111-1111-000000000000' , #NEWLINE# 'project' : TEST . networks . get ( name = 'net1' ) [ 'tenant_id' ] , #NEWLINE# 'multicast_ip_range' : None , #NEWLINE# 'sub_type' : None , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_net_profiles . add ( net_profile_dict ) #NEWLINE# TEST . net_profiles . add ( neutron . Profile ( net_profile_dict ) ) #NEWLINE# policy_profile_dict = { #NEWLINE# #INDENT# 'name' : 'policy_profile_test1' , #NEWLINE# 'id' : '00000000-9999-9999-9999-000000000000' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_policy_profiles . add ( policy_profile_dict ) #NEWLINE# TEST . policy_profiles . add ( neutron . Profile ( policy_profile_dict ) ) #NEWLINE# network_profile_binding_dict = { #NEWLINE# #INDENT# 'profile_id' : '00000000-1111-1111-1111-000000000000' , #NEWLINE# 'tenant_id' : network_dict [ 'tenant_id' ] , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_network_profile_binding . add ( network_profile_binding_dict ) #NEWLINE# TEST . network_profile_binding . add ( neutron . Profile ( network_profile_binding_dict ) ) #NEWLINE# policy_profile_binding_dict = { #NEWLINE# #INDENT# 'profile_id' : '00000000-9999-9999-9999-000000000000' , #NEWLINE# 'tenant_id' : network_dict [ 'tenant_id' ] , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_policy_profile_binding . add ( policy_profile_binding_dict ) #NEWLINE# TEST . policy_profile_binding . add ( neutron . Profile ( policy_profile_binding_dict ) ) #NEWLINE# port_dict = { #NEWLINE# #INDENT# 'admin_state_up' : True , #NEWLINE# 'device_id' : 'af75c8e5-a1cc-4567-8d04-44fcd6922890' , #NEWLINE# 'device_owner' : 'network:dhcp' , #NEWLINE# 'fixed_ips' : [ { #NEWLINE# #INDENT# 'ip_address' : '10.0.0.3' , #NEWLINE# 'subnet_id' : subnet_dict [ 'id' ] , #NEWLINE# #UNINDENT# } ] , #NEWLINE# 'id' : '063cf7f3-ded1-4297-bc4c-31eae876cc91' , #NEWLINE# 'mac_address' : 'fa:16:3e:9c:d5:7e' , #NEWLINE# 'name' : '' , #NEWLINE# 'network_id' : network_dict [ 'id' ] , #NEWLINE# 'status' : 'ACTIVE' , #NEWLINE# 'tenant_id' : network_dict [ 'tenant_id' ] , #NEWLINE# 'binding:vnic_type' : 'normal' , #NEWLINE# 'binding:host_id' : 'host' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_ports . add ( port_dict ) #NEWLINE# TEST . ports . add ( neutron . Port ( port_dict ) ) #NEWLINE# port_dict = { #NEWLINE# #INDENT# 'admin_state_up' : True , #NEWLINE# 'device_id' : '1' , #NEWLINE# 'device_owner' : 'compute:nova' , #NEWLINE# 'fixed_ips' : [ { #NEWLINE# #INDENT# 'ip_address' : '10.0.0.4' , #NEWLINE# 'subnet_id' : subnet_dict [ 'id' ] , #NEWLINE# #UNINDENT# } ] , #NEWLINE# 'id' : '7e6ce62c-7ea2-44f8-b6b4-769af90a8406' , #NEWLINE# 'mac_address' : 'fa:16:3e:9d:e6:2f' , #NEWLINE# 'name' : '' , #NEWLINE# 'network_id' : network_dict [ 'id' ] , #NEWLINE# 'status' : 'ACTIVE' , #NEWLINE# 'tenant_id' : network_dict [ 'tenant_id' ] , #NEWLINE# 'binding:vnic_type' : 'normal' , #NEWLINE# 'binding:host_id' : 'host' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_ports . add ( port_dict ) #NEWLINE# TEST . ports . add ( neutron . Port ( port_dict ) ) #NEWLINE# assoc_port = port_dict #NEWLINE# port_dict = { #NEWLINE# #INDENT# 'admin_state_up' : True , #NEWLINE# 'device_id' : '279989f7-54bb-41d9-ba42-0d61f12fda61' , #NEWLINE# 'device_owner' : 'network:router_interface' , #NEWLINE# 'fixed_ips' : [ { #NEWLINE# #INDENT# 'ip_address' : '10.0.0.1' , #NEWLINE# 'subnet_id' : subnet_dict [ 'id' ] , #NEWLINE# #UNINDENT# } ] , #NEWLINE# 'id' : '9036eedb-e7fa-458e-bc6e-d9d06d9d1bc4' , #NEWLINE# 'mac_address' : 'fa:16:3e:9c:d5:7f' , #NEWLINE# 'name' : '' , #NEWLINE# 'network_id' : network_dict [ 'id' ] , #NEWLINE# 'status' : 'ACTIVE' , #NEWLINE# 'tenant_id' : network_dict [ 'tenant_id' ] , #NEWLINE# 'binding:vnic_type' : 'normal' , #NEWLINE# 'binding:host_id' : 'host' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_ports . add ( port_dict ) #NEWLINE# TEST . ports . add ( neutron . Port ( port_dict ) ) #NEWLINE# network_dict = { #NEWLINE# #INDENT# 'admin_state_up' : True , #NEWLINE# 'id' : '72c3ab6c-c80f-4341-9dc5-210fa31ac6c2' , #NEWLINE# 'name' : 'net2' , #NEWLINE# 'status' : 'ACTIVE' , #NEWLINE# 'subnets' : [ '3f7c5d79-ee55-47b0-9213-8e669fb03009' ] , #NEWLINE# 'tenant_id' : '2' , #NEWLINE# 'router:external' : False , #NEWLINE# 'shared' : True , #NEWLINE# #UNINDENT# } #NEWLINE# subnet_dict = { #NEWLINE# #INDENT# 'allocation_pools' : [ { #NEWLINE# #INDENT# 'end' : '172.16.88.254' , #NEWLINE# 'start' : '172.16.88.2' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# 'dns_nameservers' : [ '10.56.1.20' , '10.56.1.21' ] , #NEWLINE# 'host_routes' : [ { #NEWLINE# #INDENT# 'destination' : '192.168.20.0/24' , #NEWLINE# 'nexthop' : '172.16.88.253' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'destination' : '192.168.21.0/24' , #NEWLINE# 'nexthop' : '172.16.88.252' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# 'cidr' : '172.16.88.0/24' , #NEWLINE# 'enable_dhcp' : True , #NEWLINE# 'gateway_ip' : '172.16.88.1' , #NEWLINE# 'id' : '3f7c5d79-ee55-47b0-9213-8e669fb03009' , #NEWLINE# 'ip_version' : 4 , #NEWLINE# 'name' : 'aaaa' , #NEWLINE# 'network_id' : network_dict [ 'id' ] , #NEWLINE# 'tenant_id' : network_dict [ 'tenant_id' ] , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_networks . add ( network_dict ) #NEWLINE# TEST . api_subnets . add ( subnet_dict ) #NEWLINE# network = copy . deepcopy ( network_dict ) #NEWLINE# subnet = neutron . Subnet ( subnet_dict ) #NEWLINE# network [ 'subnets' ] = [ subnet ] #NEWLINE# TEST . networks . add ( neutron . Network ( network ) ) #NEWLINE# TEST . subnets . add ( subnet ) #NEWLINE# port_dict = { #NEWLINE# #INDENT# 'admin_state_up' : True , #NEWLINE# 'device_id' : '2' , #NEWLINE# 'device_owner' : 'compute:nova' , #NEWLINE# 'fixed_ips' : [ { #NEWLINE# #INDENT# 'ip_address' : '172.16.88.3' , #NEWLINE# 'subnet_id' : subnet_dict [ 'id' ] , #NEWLINE# #UNINDENT# } ] , #NEWLINE# 'id' : '1db2cc37-3553-43fa-b7e2-3fc4eb4f9905' , #NEWLINE# 'mac_address' : 'fa:16:3e:56:e6:2f' , #NEWLINE# 'name' : '' , #NEWLINE# 'network_id' : network_dict [ 'id' ] , #NEWLINE# 'status' : 'ACTIVE' , #NEWLINE# 'tenant_id' : network_dict [ 'tenant_id' ] , #NEWLINE# 'binding:vnic_type' : 'normal' , #NEWLINE# 'binding:host_id' : 'host' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_ports . add ( port_dict ) #NEWLINE# TEST . ports . add ( neutron . Port ( port_dict ) ) #NEWLINE# network_dict = { #NEWLINE# #INDENT# 'admin_state_up' : True , #NEWLINE# 'id' : '9b466b94-213a-4cda-badf-72c102a874da' , #NEWLINE# 'name' : 'ext_net' , #NEWLINE# 'status' : 'ACTIVE' , #NEWLINE# 'subnets' : [ 'd6bdc71c-7566-4d32-b3ff-36441ce746e8' ] , #NEWLINE# 'tenant_id' : '3' , #NEWLINE# 'router:external' : True , #NEWLINE# 'shared' : False , #NEWLINE# #UNINDENT# } #NEWLINE# subnet_dict = { #NEWLINE# #INDENT# 'allocation_pools' : [ { #NEWLINE# #INDENT# 'start' : '172.24.4.226.' , #NEWLINE# 'end' : '172.24.4.238' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# 'dns_nameservers' : [ ] , #NEWLINE# 'host_routes' : [ ] , #NEWLINE# 'cidr' : '172.24.4.0/28' , #NEWLINE# 'enable_dhcp' : False , #NEWLINE# 'gateway_ip' : '172.24.4.225' , #NEWLINE# 'id' : 'd6bdc71c-7566-4d32-b3ff-36441ce746e8' , #NEWLINE# 'ip_version' : 4 , #NEWLINE# 'name' : 'ext_subnet' , #NEWLINE# 'network_id' : network_dict [ 'id' ] , #NEWLINE# 'tenant_id' : network_dict [ 'tenant_id' ] , #NEWLINE# #UNINDENT# } #NEWLINE# ext_net = network_dict #NEWLINE# TEST . api_networks . add ( network_dict ) #NEWLINE# TEST . api_subnets . add ( subnet_dict ) #NEWLINE# network = copy . deepcopy ( network_dict ) #NEWLINE# subnet = neutron . Subnet ( subnet_dict ) #NEWLINE# network [ 'subnets' ] = [ subnet ] #NEWLINE# TEST . networks . add ( neutron . Network ( network ) ) #NEWLINE# TEST . subnets . add ( subnet ) #NEWLINE# network_dict = { #NEWLINE# #INDENT# 'admin_state_up' : True , #NEWLINE# 'id' : '96688ea1-ffa5-78ec-22ca-33aaabfaf775' , #NEWLINE# 'name' : 'v6_net1' , #NEWLINE# 'status' : 'ACTIVE' , #NEWLINE# 'subnets' : [ '88ddd443-4377-ab1f-87dd-4bc4a662dbb6' ] , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'router:external' : False , #NEWLINE# 'shared' : False , #NEWLINE# #UNINDENT# } #NEWLINE# subnet_dict = { #NEWLINE# #INDENT# 'allocation_pools' : [ { #NEWLINE# #INDENT# 'end' : 'ff09::ff' , #NEWLINE# 'start' : 'ff09::02' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# 'dns_nameservers' : [ ] , #NEWLINE# 'host_routes' : [ ] , #NEWLINE# 'cidr' : 'ff09::/64' , #NEWLINE# 'enable_dhcp' : True , #NEWLINE# 'gateway_ip' : 'ff09::1' , #NEWLINE# 'id' : network_dict [ 'subnets' ] [ 0 ] , #NEWLINE# 'ip_version' : 6 , #NEWLINE# 'name' : 'v6_subnet1' , #NEWLINE# 'network_id' : network_dict [ 'id' ] , #NEWLINE# 'tenant_id' : network_dict [ 'tenant_id' ] , #NEWLINE# 'ipv6_modes' : 'none/none' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_networks . add ( network_dict ) #NEWLINE# TEST . api_subnets . add ( subnet_dict ) #NEWLINE# network = copy . deepcopy ( network_dict ) #NEWLINE# subnet = neutron . Subnet ( subnet_dict ) #NEWLINE# network [ 'subnets' ] = [ subnet ] #NEWLINE# TEST . networks . add ( neutron . Network ( network ) ) #NEWLINE# TEST . subnets . add ( subnet ) #NEWLINE# network_dict = { #NEWLINE# #INDENT# 'admin_state_up' : True , #NEWLINE# 'id' : 'c62e4bb3-296a-4cd1-8f6b-aaa7a0092326' , #NEWLINE# 'name' : 'v6_net2' , #NEWLINE# 'status' : 'ACTIVE' , #NEWLINE# 'subnets' : [ '5d736a21-0036-4779-8f8b-eed5f98077ec' ] , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'router:external' : False , #NEWLINE# 'shared' : False , #NEWLINE# #UNINDENT# } #NEWLINE# subnet_dict = { #NEWLINE# #INDENT# 'allocation_pools' : [ { #NEWLINE# #INDENT# 'end' : 'ff09::ff' , #NEWLINE# 'start' : 'ff09::02' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# 'dns_nameservers' : [ ] , #NEWLINE# 'host_routes' : [ ] , #NEWLINE# 'cidr' : 'ff09::/64' , #NEWLINE# 'enable_dhcp' : True , #NEWLINE# 'gateway_ip' : 'ff09::1' , #NEWLINE# 'id' : network_dict [ 'subnets' ] [ 0 ] , #NEWLINE# 'ip_version' : 6 , #NEWLINE# 'name' : 'v6_subnet2' , #NEWLINE# 'network_id' : network_dict [ 'id' ] , #NEWLINE# 'tenant_id' : network_dict [ 'tenant_id' ] , #NEWLINE# 'ipv6_modes' : 'slaac/slaac' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_networks . add ( network_dict ) #NEWLINE# TEST . api_subnets . add ( subnet_dict ) #NEWLINE# network = copy . deepcopy ( network_dict ) #NEWLINE# subnet = neutron . Subnet ( subnet_dict ) #NEWLINE# network [ 'subnets' ] = [ subnet ] #NEWLINE# TEST . networks . add ( neutron . Network ( network ) ) #NEWLINE# TEST . subnets . add ( subnet ) #NEWLINE# port_dict = { #NEWLINE# #INDENT# 'admin_state_up' : True , #NEWLINE# 'device_id' : '7180cede-bcd8-4334-b19f-f7ef2f331f53' , #NEWLINE# 'device_owner' : 'network:router_gateway' , #NEWLINE# 'fixed_ips' : [ { #NEWLINE# #INDENT# 'ip_address' : '10.0.0.3' , #NEWLINE# 'subnet_id' : subnet_dict [ 'id' ] , #NEWLINE# #UNINDENT# } ] , #NEWLINE# 'id' : '44ec6726-4bdc-48c5-94d4-df8d1fbf613b' , #NEWLINE# 'mac_address' : 'fa:16:3e:9c:d5:7e' , #NEWLINE# 'name' : '' , #NEWLINE# 'network_id' : TEST . networks . get ( name = 'ext_net' ) [ 'id' ] , #NEWLINE# 'status' : 'ACTIVE' , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'binding:vnic_type' : 'normal' , #NEWLINE# 'binding:host_id' : 'host' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_ports . add ( port_dict ) #NEWLINE# TEST . ports . add ( neutron . Port ( port_dict ) ) #NEWLINE# router_dict = { #NEWLINE# #INDENT# 'id' : '279989f7-54bb-41d9-ba42-0d61f12fda61' , #NEWLINE# 'name' : 'router1' , #NEWLINE# 'status' : 'ACTIVE' , #NEWLINE# 'admin_state_up' : True , #NEWLINE# 'distributed' : True , #NEWLINE# 'external_gateway_info' : { #NEWLINE# #INDENT# 'network_id' : ext_net [ 'id' ] , #NEWLINE# #UNINDENT# } , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_routers . add ( router_dict ) #NEWLINE# TEST . routers . add ( neutron . Router ( router_dict ) ) #NEWLINE# router_dict = { #NEWLINE# #INDENT# 'id' : '10e3dc42-1ce1-4d48-87cf-7fc333055d6c' , #NEWLINE# 'name' : 'router2' , #NEWLINE# 'status' : 'ACTIVE' , #NEWLINE# 'admin_state_up' : False , #NEWLINE# 'distributed' : False , #NEWLINE# 'external_gateway_info' : None , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_routers . add ( router_dict ) #NEWLINE# TEST . routers . add ( neutron . Router ( router_dict ) ) #NEWLINE# router_dict = { #NEWLINE# #INDENT# 'id' : '7180cede-bcd8-4334-b19f-f7ef2f331f53' , #NEWLINE# 'name' : 'rulerouter' , #NEWLINE# 'status' : 'ACTIVE' , #NEWLINE# 'admin_state_up' : True , #NEWLINE# 'distributed' : False , #NEWLINE# 'external_gateway_info' : { #NEWLINE# #INDENT# 'network_id' : ext_net [ 'id' ] , #NEWLINE# #UNINDENT# } , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'router_rules' : [ { #NEWLINE# #INDENT# 'id' : '101' , #NEWLINE# 'action' : 'deny' , #NEWLINE# 'source' : 'any' , #NEWLINE# 'destination' : 'any' , #NEWLINE# 'nexthops' : [ ] , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'id' : '102' , #NEWLINE# 'action' : 'permit' , #NEWLINE# 'source' : 'any' , #NEWLINE# 'destination' : '8.8.8.8/32' , #NEWLINE# 'nexthops' : [ '1.0.0.2' , '1.0.0.1' ] , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_routers . add ( router_dict ) #NEWLINE# TEST . routers_with_rules . add ( neutron . Router ( router_dict ) ) #NEWLINE# router_dict_with_route = { #NEWLINE# #INDENT# 'id' : '725c24c9-061b-416b-b9d4-012392b32fd9' , #NEWLINE# 'name' : 'routerouter' , #NEWLINE# 'status' : 'ACTIVE' , #NEWLINE# 'admin_state_up' : True , #NEWLINE# 'distributed' : False , #NEWLINE# 'external_gateway_info' : { #NEWLINE# #INDENT# 'network_id' : ext_net [ 'id' ] , #NEWLINE# #UNINDENT# } , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'routes' : [ { #NEWLINE# #INDENT# 'nexthop' : '10.0.0.1' , #NEWLINE# 'destination' : '172.0.0.0/24' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'nexthop' : '10.0.0.2' , #NEWLINE# 'destination' : '172.1.0.0/24' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_routers_with_routes . add ( router_dict_with_route ) #NEWLINE# TEST . routers_with_routes . add ( neutron . Router ( router_dict_with_route ) ) #NEWLINE# fip_dict = { #NEWLINE# #INDENT# 'tenant_id' : '1' , #NEWLINE# 'floating_ip_address' : '172.16.88.227' , #NEWLINE# 'floating_network_id' : ext_net [ 'id' ] , #NEWLINE# 'id' : '9012cd70-cfae-4e46-b71e-6a409e9e0063' , #NEWLINE# 'fixed_ip_address' : None , #NEWLINE# 'port_id' : None , #NEWLINE# 'router_id' : None , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_q_floating_ips . add ( fip_dict ) #NEWLINE# TEST . q_floating_ips . add ( neutron . FloatingIp ( fip_dict ) ) #NEWLINE# fip_dict = { #NEWLINE# #INDENT# 'tenant_id' : '1' , #NEWLINE# 'floating_ip_address' : '172.16.88.228' , #NEWLINE# 'floating_network_id' : ext_net [ 'id' ] , #NEWLINE# 'id' : 'a97af8f2-3149-4b97-abbd-e49ad19510f7' , #NEWLINE# 'fixed_ip_address' : assoc_port [ 'fixed_ips' ] [ 0 ] [ 'ip_address' ] , #NEWLINE# 'port_id' : assoc_port [ 'id' ] , #NEWLINE# 'router_id' : router_dict [ 'id' ] , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_q_floating_ips . add ( fip_dict ) #NEWLINE# TEST . q_floating_ips . add ( neutron . FloatingIp ( fip_dict ) ) #NEWLINE# sec_group_1 = { #NEWLINE# #INDENT# 'tenant_id' : '1' , #NEWLINE# 'description' : 'default' , #NEWLINE# 'id' : 'faad7c80-3b62-4440-967c-13808c37131d' , #NEWLINE# 'name' : 'default' , #NEWLINE# #UNINDENT# } #NEWLINE# sec_group_2 = { #NEWLINE# #INDENT# 'tenant_id' : '1' , #NEWLINE# 'description' : 'NotDefault' , #NEWLINE# 'id' : '27a5c9a1-bdbb-48ac-833a-2e4b5f54b31d' , #NEWLINE# 'name' : 'other_group' , #NEWLINE# #UNINDENT# } #NEWLINE# sec_group_3 = { #NEWLINE# #INDENT# 'tenant_id' : '1' , #NEWLINE# 'description' : 'NotDefault' , #NEWLINE# 'id' : '443a4d7a-4bd2-4474-9a77-02b35c9f8c95' , #NEWLINE# 'name' : 'another_group' , #NEWLINE# #UNINDENT# } #NEWLINE# def add_rule_to_group( secgroup , default_only = True ) : #NEWLINE# #INDENT# rule_egress_ipv4 = { #NEWLINE# #INDENT# 'id' : str ( uuid . uuid4 ( ) ) , #NEWLINE# 'direction' : 'egress' , #NEWLINE# 'ethertype' : 'IPv4' , #NEWLINE# 'port_range_min' : None , #NEWLINE# 'port_range_max' : None , #NEWLINE# 'protocol' : None , #NEWLINE# 'remote_group_id' : None , #NEWLINE# 'remote_ip_prefix' : None , #NEWLINE# 'security_group_id' : secgroup [ 'id' ] , #NEWLINE# 'tenant_id' : secgroup [ 'tenant_id' ] , #NEWLINE# #UNINDENT# } #NEWLINE# rule_egress_ipv6 = { #NEWLINE# #INDENT# 'id' : str ( uuid . uuid4 ( ) ) , #NEWLINE# 'direction' : 'egress' , #NEWLINE# 'ethertype' : 'IPv6' , #NEWLINE# 'port_range_min' : None , #NEWLINE# 'port_range_max' : None , #NEWLINE# 'protocol' : None , #NEWLINE# 'remote_group_id' : None , #NEWLINE# 'remote_ip_prefix' : None , #NEWLINE# 'security_group_id' : secgroup [ 'id' ] , #NEWLINE# 'tenant_id' : secgroup [ 'tenant_id' ] , #NEWLINE# #UNINDENT# } #NEWLINE# rule_tcp_80 = { #NEWLINE# #INDENT# 'id' : str ( uuid . uuid4 ( ) ) , #NEWLINE# 'direction' : 'ingress' , #NEWLINE# 'ethertype' : 'IPv4' , #NEWLINE# 'port_range_min' : 80 , #NEWLINE# 'port_range_max' : 80 , #NEWLINE# 'protocol' : 'tcp' , #NEWLINE# 'remote_group_id' : None , #NEWLINE# 'remote_ip_prefix' : '0.0.0.0/0' , #NEWLINE# 'security_group_id' : secgroup [ 'id' ] , #NEWLINE# 'tenant_id' : secgroup [ 'tenant_id' ] , #NEWLINE# #UNINDENT# } #NEWLINE# rule_icmp = { #NEWLINE# #INDENT# 'id' : str ( uuid . uuid4 ( ) ) , #NEWLINE# 'direction' : 'ingress' , #NEWLINE# 'ethertype' : 'IPv4' , #NEWLINE# 'port_range_min' : 5 , #NEWLINE# 'port_range_max' : 8 , #NEWLINE# 'protocol' : 'icmp' , #NEWLINE# 'remote_group_id' : None , #NEWLINE# 'remote_ip_prefix' : '0.0.0.0/0' , #NEWLINE# 'security_group_id' : secgroup [ 'id' ] , #NEWLINE# 'tenant_id' : secgroup [ 'tenant_id' ] , #NEWLINE# #UNINDENT# } #NEWLINE# rule_group = { #NEWLINE# #INDENT# 'id' : str ( uuid . uuid4 ( ) ) , #NEWLINE# 'direction' : 'ingress' , #NEWLINE# 'ethertype' : 'IPv4' , #NEWLINE# 'port_range_min' : 80 , #NEWLINE# 'port_range_max' : 80 , #NEWLINE# 'protocol' : 'tcp' , #NEWLINE# 'remote_group_id' : sec_group_1 [ 'id' ] , #NEWLINE# 'remote_ip_prefix' : None , #NEWLINE# 'security_group_id' : secgroup [ 'id' ] , #NEWLINE# 'tenant_id' : secgroup [ 'tenant_id' ] , #NEWLINE# #UNINDENT# } #NEWLINE# rule_all_tcp = { #NEWLINE# #INDENT# 'id' : str ( uuid . uuid4 ( ) ) , #NEWLINE# 'direction' : 'egress' , #NEWLINE# 'ethertype' : 'IPv4' , #NEWLINE# 'port_range_min' : 1 , #NEWLINE# 'port_range_max' : 65535 , #NEWLINE# 'protocol' : 'tcp' , #NEWLINE# 'remote_group_id' : None , #NEWLINE# 'remote_ip_prefix' : '0.0.0.0/24' , #NEWLINE# 'security_group_id' : secgroup [ 'id' ] , #NEWLINE# 'tenant_id' : secgroup [ 'tenant_id' ] , #NEWLINE# #UNINDENT# } #NEWLINE# rules = [ ] #NEWLINE# if ( not default_only ) : #NEWLINE# #INDENT# rules += [ rule_tcp_80 , rule_icmp , rule_group , rule_all_tcp ] #NEWLINE# #UNINDENT# rules += [ rule_egress_ipv4 , rule_egress_ipv6 ] #NEWLINE# secgroup [ 'security_group_rules' ] = rules #NEWLINE# #UNINDENT# add_rule_to_group ( sec_group_1 , default_only = False ) #NEWLINE# add_rule_to_group ( sec_group_2 ) #NEWLINE# add_rule_to_group ( sec_group_3 ) #NEWLINE# groups = [ sec_group_1 , sec_group_2 , sec_group_3 ] #NEWLINE# sg_name_dict = dict ( [ ( sg [ 'id' ] , sg [ 'name' ] ) for sg in groups ] ) #NEWLINE# for sg in groups : #NEWLINE# #INDENT# TEST . api_q_secgroups . add ( sg ) #NEWLINE# for rule in sg [ 'security_group_rules' ] : #NEWLINE# #INDENT# TEST . api_q_secgroup_rules . add ( copy . copy ( rule ) ) #NEWLINE# #UNINDENT# TEST . q_secgroups . add ( neutron . SecurityGroup ( copy . deepcopy ( sg ) , sg_name_dict ) ) #NEWLINE# for rule in sg [ 'security_group_rules' ] : #NEWLINE# #INDENT# TEST . q_secgroup_rules . add ( neutron . SecurityGroupRule ( copy . copy ( rule ) , sg_name_dict ) ) #NEWLINE# #UNINDENT# #UNINDENT# subnetpool_dict = { #NEWLINE# #INDENT# 'default_prefixlen' : 24 , #NEWLINE# 'default_quota' : None , #NEWLINE# 'id' : '419eb314-e244-4088-aed7-851af9d9500d' , #NEWLINE# 'ip_version' : 4 , #NEWLINE# 'max_prefixlen' : 32 , #NEWLINE# 'min_prefixlen' : 12 , #NEWLINE# 'name' : 'mysubnetpool1' , #NEWLINE# 'prefixes' : [ '172.16.0.0/12' ] , #NEWLINE# 'shared' : False , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_subnetpools . add ( subnetpool_dict ) #NEWLINE# subnetpool = neutron . SubnetPool ( subnetpool_dict ) #NEWLINE# TEST . subnetpools . add ( subnetpool ) #NEWLINE# subnetpool_dict = { #NEWLINE# #INDENT# 'default_prefixlen' : 64 , #NEWLINE# 'default_quota' : None , #NEWLINE# 'id' : 'dcdad289-46f3-4298-bec6-41d91c942efa' , #NEWLINE# 'ip_version' : 6 , #NEWLINE# 'max_prefixlen' : 64 , #NEWLINE# 'min_prefixlen' : 60 , #NEWLINE# 'name' : 'mysubnetpool2' , #NEWLINE# 'prefixes' : [ '2001:db8:42::/48' ] , #NEWLINE# 'shared' : False , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_subnetpools . add ( subnetpool_dict ) #NEWLINE# subnetpool = neutron . SubnetPool ( subnetpool_dict ) #NEWLINE# TEST . subnetpools . add ( subnetpool ) #NEWLINE# pool_dict = { #NEWLINE# #INDENT# 'id' : '8913dde8-4915-4b90-8d3e-b95eeedb0d49' , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'vip_id' : 'abcdef-c3eb-4fee-9763-12de3338041e' , #NEWLINE# 'name' : 'pool1' , #NEWLINE# 'description' : 'pool description' , #NEWLINE# 'subnet_id' : TEST . subnets . first ( ) . id , #NEWLINE# 'protocol' : 'HTTP' , #NEWLINE# 'lb_method' : 'ROUND_ROBIN' , #NEWLINE# 'health_monitors' : TEST . monitors . list ( ) , #NEWLINE# 'members' : [ '78a46e5e-eb1a-418a-88c7-0e3f5968b08' ] , #NEWLINE# 'admin_state_up' : True , #NEWLINE# 'status' : 'ACTIVE' , #NEWLINE# 'provider' : 'haproxy' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_pools . add ( pool_dict ) #NEWLINE# TEST . pools . add ( lbaas . Pool ( pool_dict ) ) #NEWLINE# pool_dict = { #NEWLINE# #INDENT# 'id' : '8913dde8-4915-4b90-8d3e-b95eeedb0d50' , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'vip_id' : 'f0881d38-c3eb-4fee-9763-12de3338041d' , #NEWLINE# 'name' : 'pool2' , #NEWLINE# 'description' : 'pool description' , #NEWLINE# 'subnet_id' : TEST . subnets . first ( ) . id , #NEWLINE# 'protocol' : 'HTTPS' , #NEWLINE# 'lb_method' : 'ROUND_ROBIN' , #NEWLINE# 'health_monitors' : TEST . monitors . list ( ) [ 0 : 1 ] , #NEWLINE# 'members' : [ ] , #NEWLINE# 'status' : 'PENDING_CREATE' , #NEWLINE# 'admin_state_up' : True , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_pools . add ( pool_dict ) #NEWLINE# TEST . pools . add ( lbaas . Pool ( pool_dict ) ) #NEWLINE# vip_dict = { #NEWLINE# #INDENT# 'id' : 'abcdef-c3eb-4fee-9763-12de3338041e' , #NEWLINE# 'name' : 'vip1' , #NEWLINE# 'address' : '10.0.0.100' , #NEWLINE# 'description' : 'vip description' , #NEWLINE# 'subnet_id' : TEST . subnets . first ( ) . id , #NEWLINE# 'port_id' : TEST . ports . first ( ) . id , #NEWLINE# 'subnet' : TEST . subnets . first ( ) . cidr , #NEWLINE# 'protocol_port' : 80 , #NEWLINE# 'protocol' : pool_dict [ 'protocol' ] , #NEWLINE# 'pool_id' : pool_dict [ 'id' ] , #NEWLINE# 'session_persistence' : { #NEWLINE# #INDENT# 'type' : 'APP_COOKIE' , #NEWLINE# 'cookie_name' : 'jssessionid' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'connection_limit' : 10 , #NEWLINE# 'admin_state_up' : True , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_vips . add ( vip_dict ) #NEWLINE# TEST . vips . add ( lbaas . Vip ( vip_dict ) ) #NEWLINE# setattr ( TEST . pools . first ( ) , 'vip' , TEST . vips . first ( ) ) #NEWLINE# vip_dict = { #NEWLINE# #INDENT# 'id' : 'f0881d38-c3eb-4fee-9763-12de3338041d' , #NEWLINE# 'name' : 'vip2' , #NEWLINE# 'address' : '10.0.0.110' , #NEWLINE# 'description' : 'vip description' , #NEWLINE# 'subnet_id' : TEST . subnets . first ( ) . id , #NEWLINE# 'port_id' : TEST . ports . list ( ) [ 0 ] . id , #NEWLINE# 'subnet' : TEST . subnets . first ( ) . cidr , #NEWLINE# 'protocol_port' : 80 , #NEWLINE# 'protocol' : pool_dict [ 'protocol' ] , #NEWLINE# 'pool_id' : pool_dict [ 'id' ] , #NEWLINE# 'session_persistence' : { #NEWLINE# #INDENT# 'type' : 'APP_COOKIE' , #NEWLINE# 'cookie_name' : 'jssessionid' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'connection_limit' : 10 , #NEWLINE# 'admin_state_up' : True , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_vips . add ( vip_dict ) #NEWLINE# TEST . vips . add ( lbaas . Vip ( vip_dict ) ) #NEWLINE# member_dict = { #NEWLINE# #INDENT# 'id' : '78a46e5e-eb1a-418a-88c7-0e3f5968b08' , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'pool_id' : pool_dict [ 'id' ] , #NEWLINE# 'address' : '10.0.0.11' , #NEWLINE# 'protocol_port' : 80 , #NEWLINE# 'weight' : 10 , #NEWLINE# 'status' : 'ACTIVE' , #NEWLINE# 'admin_state_up' : True , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_members . add ( member_dict ) #NEWLINE# TEST . members . add ( lbaas . Member ( member_dict ) ) #NEWLINE# member_dict = { #NEWLINE# #INDENT# 'id' : '41ac1f8d-6d9c-49a4-a1bf-41955e651f91' , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'pool_id' : pool_dict [ 'id' ] , #NEWLINE# 'address' : '10.0.0.12' , #NEWLINE# 'protocol_port' : 80 , #NEWLINE# 'weight' : 10 , #NEWLINE# 'status' : 'ACTIVE' , #NEWLINE# 'admin_state_up' : True , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_members . add ( member_dict ) #NEWLINE# TEST . members . add ( lbaas . Member ( member_dict ) ) #NEWLINE# pool_dict = { #NEWLINE# #INDENT# 'id' : 'c2983d70-8ac7-11e4-b116-123b93f75cba' , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'vip_id' : 'b6598a5e-8ab4-11e4-b116-123b93f75cba' , #NEWLINE# 'name' : 'v6_pool1' , #NEWLINE# 'description' : 'pool description' , #NEWLINE# 'subnet_id' : TEST . subnets . get ( name = 'v6_subnet1' ) . id , #NEWLINE# 'protocol' : 'HTTP' , #NEWLINE# 'lb_method' : 'ROUND_ROBIN' , #NEWLINE# 'health_monitors' : TEST . monitors . list ( ) , #NEWLINE# 'members' : [ '78a46e5e-eb1a-418a-88c7-0e3f5968b08' ] , #NEWLINE# 'admin_state_up' : True , #NEWLINE# 'status' : 'ACTIVE' , #NEWLINE# 'provider' : 'haproxy' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_pools . add ( pool_dict ) #NEWLINE# TEST . pools . add ( lbaas . Pool ( pool_dict ) ) #NEWLINE# vip_dict = { #NEWLINE# #INDENT# 'id' : 'b6598a5e-8ab4-11e4-b116-123b93f75cba' , #NEWLINE# 'name' : 'v6_vip1' , #NEWLINE# 'address' : 'ff09::03' , #NEWLINE# 'description' : 'vip description' , #NEWLINE# 'subnet_id' : TEST . subnets . get ( name = 'v6_subnet1' ) . id , #NEWLINE# 'port_id' : TEST . ports . first ( ) . id , #NEWLINE# 'subnet' : TEST . subnets . get ( name = 'v6_subnet1' ) . cidr , #NEWLINE# 'protocol_port' : 80 , #NEWLINE# 'protocol' : pool_dict [ 'protocol' ] , #NEWLINE# 'pool_id' : pool_dict [ 'id' ] , #NEWLINE# 'session_persistence' : { #NEWLINE# #INDENT# 'type' : 'APP_COOKIE' , #NEWLINE# 'cookie_name' : 'jssessionid' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'connection_limit' : 10 , #NEWLINE# 'admin_state_up' : True , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_vips . add ( vip_dict ) #NEWLINE# TEST . vips . add ( lbaas . Vip ( vip_dict ) ) #NEWLINE# vip_dict = { #NEWLINE# #INDENT# 'id' : 'b6598cc0-8ab4-11e4-b116-123b93f75cba' , #NEWLINE# 'name' : 'ff09::04' , #NEWLINE# 'address' : '10.0.0.110' , #NEWLINE# 'description' : 'vip description' , #NEWLINE# 'subnet_id' : TEST . subnets . get ( name = 'v6_subnet2' ) . id , #NEWLINE# 'port_id' : TEST . ports . list ( ) [ 0 ] . id , #NEWLINE# 'subnet' : TEST . subnets . get ( name = 'v6_subnet2' ) . cidr , #NEWLINE# 'protocol_port' : 80 , #NEWLINE# 'protocol' : pool_dict [ 'protocol' ] , #NEWLINE# 'pool_id' : pool_dict [ 'id' ] , #NEWLINE# 'session_persistence' : { #NEWLINE# #INDENT# 'type' : 'APP_COOKIE' , #NEWLINE# 'cookie_name' : 'jssessionid' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'connection_limit' : 10 , #NEWLINE# 'admin_state_up' : True , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_vips . add ( vip_dict ) #NEWLINE# TEST . vips . add ( lbaas . Vip ( vip_dict ) ) #NEWLINE# monitor_dict = { #NEWLINE# #INDENT# 'id' : '0dc936f8-8aca-11e4-b116-123b93f75cba' , #NEWLINE# 'type' : 'http' , #NEWLINE# 'delay' : 10 , #NEWLINE# 'timeout' : 10 , #NEWLINE# 'max_retries' : 10 , #NEWLINE# 'http_method' : 'GET' , #NEWLINE# 'url_path' : '/' , #NEWLINE# 'expected_codes' : '200' , #NEWLINE# 'admin_state_up' : True , #NEWLINE# 'pools' : [ { #NEWLINE# #INDENT# 'pool_id' : TEST . pools . get ( name = 'v6_pool1' ) . id , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_monitors . add ( monitor_dict ) #NEWLINE# TEST . monitors . add ( lbaas . PoolMonitor ( monitor_dict ) ) #NEWLINE# member_dict = { #NEWLINE# #INDENT# 'id' : '6bc03d1e-8ad0-11e4-b116-123b93f75cba' , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'pool_id' : TEST . pools . get ( name = 'v6_pool1' ) . id , #NEWLINE# 'address' : 'ff09::03' , #NEWLINE# 'protocol_port' : 80 , #NEWLINE# 'weight' : 10 , #NEWLINE# 'status' : 'ACTIVE' , #NEWLINE# 'member_type' : 'server_list' , #NEWLINE# 'admin_state_up' : True , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_members . add ( member_dict ) #NEWLINE# TEST . members . add ( lbaas . Member ( member_dict ) ) #NEWLINE# monitor_dict = { #NEWLINE# #INDENT# 'id' : 'd4a0500f-db2b-4cc4-afcf-ec026febff96' , #NEWLINE# 'type' : 'http' , #NEWLINE# 'delay' : 10 , #NEWLINE# 'timeout' : 10 , #NEWLINE# 'max_retries' : 10 , #NEWLINE# 'http_method' : 'GET' , #NEWLINE# 'url_path' : '/' , #NEWLINE# 'expected_codes' : '200' , #NEWLINE# 'admin_state_up' : True , #NEWLINE# 'pools' : [ { #NEWLINE# #INDENT# 'pool_id' : TEST . pools . list ( ) [ 0 ] . id , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'pool_id' : TEST . pools . list ( ) [ 1 ] . id , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_monitors . add ( monitor_dict ) #NEWLINE# TEST . monitors . add ( lbaas . PoolMonitor ( monitor_dict ) ) #NEWLINE# monitor_dict = { #NEWLINE# #INDENT# 'id' : 'd4a0500f-db2b-4cc4-afcf-ec026febff97' , #NEWLINE# 'type' : 'ping' , #NEWLINE# 'delay' : 10 , #NEWLINE# 'timeout' : 10 , #NEWLINE# 'max_retries' : 10 , #NEWLINE# 'admin_state_up' : True , #NEWLINE# 'pools' : [ ] , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_monitors . add ( monitor_dict ) #NEWLINE# TEST . monitors . add ( lbaas . PoolMonitor ( monitor_dict ) ) #NEWLINE# quota_data = { #NEWLINE# #INDENT# 'network' : '10' , #NEWLINE# 'subnet' : '10' , #NEWLINE# 'port' : '50' , #NEWLINE# 'router' : '10' , #NEWLINE# 'floatingip' : '50' , #NEWLINE# 'security_group' : '20' , #NEWLINE# 'security_group_rule' : '100' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . neutron_quotas . add ( base . QuotaSet ( quota_data ) ) #NEWLINE# quota_usage_data = { #NEWLINE# #INDENT# 'networks' : { #NEWLINE# #INDENT# 'used' : 0 , #NEWLINE# 'quota' : 5 , #NEWLINE# #UNINDENT# } , #NEWLINE# 'subnets' : { #NEWLINE# #INDENT# 'used' : 0 , #NEWLINE# 'quota' : 5 , #NEWLINE# #UNINDENT# } , #NEWLINE# 'routers' : { #NEWLINE# #INDENT# 'used' : 0 , #NEWLINE# 'quota' : 5 , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# quota_usage = usage_quotas . QuotaUsage ( ) #NEWLINE# for ( k , v ) in quota_usage_data . items ( ) : #NEWLINE# #INDENT# quota_usage . add_quota ( base . Quota ( k , v [ 'quota' ] ) ) #NEWLINE# quota_usage . tally ( k , v [ 'used' ] ) #NEWLINE# #UNINDENT# TEST . neutron_quota_usages . add ( quota_usage ) #NEWLINE# extension_1 = { #NEWLINE# #INDENT# 'name' : 'security-group' , #NEWLINE# 'alias' : 'security-group' , #NEWLINE# 'description' : 'The security groups extension.' , #NEWLINE# #UNINDENT# } #NEWLINE# extension_2 = { #NEWLINE# #INDENT# 'name' : 'Quota management support' , #NEWLINE# 'alias' : 'quotas' , #NEWLINE# 'description' : 'Expose functions for quotas management' , #NEWLINE# #UNINDENT# } #NEWLINE# extension_3 = { #NEWLINE# #INDENT# 'name' : 'Provider network' , #NEWLINE# 'alias' : 'provider' , #NEWLINE# 'description' : 'Provider network extension' , #NEWLINE# #UNINDENT# } #NEWLINE# extension_4 = { #NEWLINE# #INDENT# 'name' : 'Distributed Virtual Router' , #NEWLINE# 'alias' : 'dvr' , #NEWLINE# 'description' : 'Enables configuration of Distributed Virtual Routers.' , #NEWLINE# #UNINDENT# } #NEWLINE# extension_5 = { #NEWLINE# #INDENT# 'name' : 'HA Router extension' , #NEWLINE# 'alias' : 'l3-ha' , #NEWLINE# 'description' : 'Add HA capability to routers.' , #NEWLINE# #UNINDENT# } #NEWLINE# extension_6 = { #NEWLINE# #INDENT# 'name' : 'LoadBalancing service' , #NEWLINE# 'alias' : 'lbaas' , #NEWLINE# 'description' : 'Extension for LoadBalancing service' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_extensions . add ( extension_1 ) #NEWLINE# TEST . api_extensions . add ( extension_2 ) #NEWLINE# TEST . api_extensions . add ( extension_3 ) #NEWLINE# TEST . api_extensions . add ( extension_4 ) #NEWLINE# TEST . api_extensions . add ( extension_5 ) #NEWLINE# TEST . api_extensions . add ( extension_6 ) #NEWLINE# agent_dict = { #NEWLINE# #INDENT# 'binary' : 'neutron-openvswitch-agent' , #NEWLINE# 'description' : None , #NEWLINE# 'admin_state_up' : True , #NEWLINE# 'heartbeat_timestamp' : '2013-07-26 06:51:47' , #NEWLINE# 'alive' : True , #NEWLINE# 'id' : 'c876ff05-f440-443e-808c-1d34cda3e88a' , #NEWLINE# 'topic' : 'N/A' , #NEWLINE# 'host' : 'devstack001' , #NEWLINE# 'agent_type' : 'Open vSwitch agent' , #NEWLINE# 'started_at' : '2013-07-26 05:23:28' , #NEWLINE# 'created_at' : '2013-07-26 05:23:28' , #NEWLINE# 'configurations' : { #NEWLINE# #INDENT# 'devices' : 2 , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_agents . add ( agent_dict ) #NEWLINE# TEST . agents . add ( neutron . Agent ( agent_dict ) ) #NEWLINE# agent_dict = { #NEWLINE# #INDENT# 'binary' : 'neutron-dhcp-agent' , #NEWLINE# 'description' : None , #NEWLINE# 'admin_state_up' : True , #NEWLINE# 'heartbeat_timestamp' : '2013-07-26 06:51:48' , #NEWLINE# 'alive' : True , #NEWLINE# 'id' : 'f0d12e3d-1973-41a2-b977-b95693f9a8aa' , #NEWLINE# 'topic' : 'dhcp_agent' , #NEWLINE# 'host' : 'devstack001' , #NEWLINE# 'agent_type' : 'DHCP agent' , #NEWLINE# 'started_at' : '2013-07-26 05:23:30' , #NEWLINE# 'created_at' : '2013-07-26 05:23:30' , #NEWLINE# 'configurations' : { #NEWLINE# #INDENT# 'subnets' : 1 , #NEWLINE# 'use_namespaces' : True , #NEWLINE# 'dhcp_lease_duration' : 120 , #NEWLINE# 'dhcp_driver' : 'neutron.agent.linux.dhcp.Dnsmasq' , #NEWLINE# 'networks' : 1 , #NEWLINE# 'ports' : 1 , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_agents . add ( agent_dict ) #NEWLINE# TEST . agents . add ( neutron . Agent ( agent_dict ) ) #NEWLINE# provider_1 = { #NEWLINE# #INDENT# 'service_type' : 'LOADBALANCER' , #NEWLINE# 'name' : 'haproxy' , #NEWLINE# 'default' : True , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . providers . add ( provider_1 ) #NEWLINE# vpnservice_dict = { #NEWLINE# #INDENT# 'id' : '09a26949-6231-4f72-942a-0c8c0ddd4d61' , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'name' : 'cloud_vpn1' , #NEWLINE# 'description' : 'vpn description' , #NEWLINE# 'subnet_id' : TEST . subnets . first ( ) . id , #NEWLINE# 'router_id' : TEST . routers . first ( ) . id , #NEWLINE# 'vpn_type' : 'ipsec' , #NEWLINE# 'ipsecsiteconnections' : [ ] , #NEWLINE# 'admin_state_up' : True , #NEWLINE# 'status' : 'Active' , #NEWLINE# 'ipsecsiteconns' : TEST . ipsecsiteconnections . list ( ) , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_vpnservices . add ( vpnservice_dict ) #NEWLINE# TEST . vpnservices . add ( vpn . VPNService ( vpnservice_dict ) ) #NEWLINE# vpnservice_dict = { #NEWLINE# #INDENT# 'id' : '09a26949-6231-4f72-942a-0c8c0ddd4d62' , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'name' : 'cloud_vpn2' , #NEWLINE# 'description' : 'vpn description' , #NEWLINE# 'subnet_id' : TEST . subnets . first ( ) . id , #NEWLINE# 'router_id' : TEST . routers . first ( ) . id , #NEWLINE# 'vpn_type' : 'ipsec' , #NEWLINE# 'ipsecsiteconnections' : [ ] , #NEWLINE# 'admin_state_up' : True , #NEWLINE# 'status' : 'Active' , #NEWLINE# 'ipsecsiteconns' : [ ] , #NEWLINE# 'external_v4_ip' : '10.0.0.0/24' , #NEWLINE# 'external_v6_ip' : 'fd4c:a535:831c::/64' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_vpnservices . add ( vpnservice_dict ) #NEWLINE# TEST . vpnservices . add ( vpn . VPNService ( vpnservice_dict ) ) #NEWLINE# ikepolicy_dict = { #NEWLINE# #INDENT# 'id' : 'a1f009b7-0ffa-43a7-ba19-dcabb0b4c981' , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'name' : 'ikepolicy_1' , #NEWLINE# 'description' : 'ikepolicy description' , #NEWLINE# 'auth_algorithm' : 'sha1' , #NEWLINE# 'encryption_algorithm' : 'aes-256' , #NEWLINE# 'ike_version' : 'v1' , #NEWLINE# 'lifetime' : { #NEWLINE# #INDENT# 'units' : 'seconds' , #NEWLINE# 'value' : 3600 , #NEWLINE# #UNINDENT# } , #NEWLINE# 'phase1_negotiation_mode' : 'main' , #NEWLINE# 'pfs' : 'group5' , #NEWLINE# 'ipsecsiteconns' : TEST . ipsecsiteconnections . list ( ) , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_ikepolicies . add ( ikepolicy_dict ) #NEWLINE# TEST . ikepolicies . add ( vpn . IKEPolicy ( ikepolicy_dict ) ) #NEWLINE# ikepolicy_dict = { #NEWLINE# #INDENT# 'id' : 'a1f009b7-0ffa-43a7-ba19-dcabb0b4c982' , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'name' : 'ikepolicy_2' , #NEWLINE# 'description' : 'ikepolicy description' , #NEWLINE# 'auth_algorithm' : 'sha1' , #NEWLINE# 'encryption_algorithm' : 'aes-256' , #NEWLINE# 'ike_version' : 'v1' , #NEWLINE# 'lifetime' : { #NEWLINE# #INDENT# 'units' : 'seconds' , #NEWLINE# 'value' : 3600 , #NEWLINE# #UNINDENT# } , #NEWLINE# 'phase1_negotiation_mode' : 'main' , #NEWLINE# 'pfs' : 'group5' , #NEWLINE# 'ipsecsiteconns' : [ ] , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_ikepolicies . add ( ikepolicy_dict ) #NEWLINE# TEST . ikepolicies . add ( vpn . IKEPolicy ( ikepolicy_dict ) ) #NEWLINE# ipsecpolicy_dict = { #NEWLINE# #INDENT# 'id' : '8376e1dd-2b1c-4346-b23c-6989e75ecdb8' , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'name' : 'ipsecpolicy_1' , #NEWLINE# 'description' : 'ipsecpolicy description' , #NEWLINE# 'auth_algorithm' : 'sha1' , #NEWLINE# 'encapsulation_mode' : 'tunnel' , #NEWLINE# 'encryption_algorithm' : '3des' , #NEWLINE# 'lifetime' : { #NEWLINE# #INDENT# 'units' : 'seconds' , #NEWLINE# 'value' : 3600 , #NEWLINE# #UNINDENT# } , #NEWLINE# 'pfs' : 'group5' , #NEWLINE# 'transform_protocol' : 'esp' , #NEWLINE# 'ipsecsiteconns' : TEST . ipsecsiteconnections . list ( ) , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_ipsecpolicies . add ( ipsecpolicy_dict ) #NEWLINE# TEST . ipsecpolicies . add ( vpn . IPSecPolicy ( ipsecpolicy_dict ) ) #NEWLINE# ipsecpolicy_dict = { #NEWLINE# #INDENT# 'id' : '8376e1dd-2b1c-4346-b23c-6989e75ecdb9' , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'name' : 'ipsecpolicy_2' , #NEWLINE# 'description' : 'ipsecpolicy description' , #NEWLINE# 'auth_algorithm' : 'sha1' , #NEWLINE# 'encapsulation_mode' : 'tunnel' , #NEWLINE# 'encryption_algorithm' : '3des' , #NEWLINE# 'lifetime' : { #NEWLINE# #INDENT# 'units' : 'seconds' , #NEWLINE# 'value' : 3600 , #NEWLINE# #UNINDENT# } , #NEWLINE# 'pfs' : 'group5' , #NEWLINE# 'transform_protocol' : 'esp' , #NEWLINE# 'ipsecsiteconns' : [ ] , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_ipsecpolicies . add ( ipsecpolicy_dict ) #NEWLINE# TEST . ipsecpolicies . add ( vpn . IPSecPolicy ( ipsecpolicy_dict ) ) #NEWLINE# ipsecsiteconnection_dict = { #NEWLINE# #INDENT# 'id' : 'dd1dd3a0-f349-49be-b013-245e147763d6' , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'name' : 'ipsec_connection_1' , #NEWLINE# 'description' : 'vpn connection description' , #NEWLINE# 'dpd' : { #NEWLINE# #INDENT# 'action' : 'hold' , #NEWLINE# 'interval' : 30 , #NEWLINE# 'timeout' : 120 , #NEWLINE# #UNINDENT# } , #NEWLINE# 'ikepolicy_id' : ikepolicy_dict [ 'id' ] , #NEWLINE# 'initiator' : 'bi-directional' , #NEWLINE# 'ipsecpolicy_id' : ipsecpolicy_dict [ 'id' ] , #NEWLINE# 'mtu' : 1500 , #NEWLINE# 'peer_address' : '2607:f0d0:4545:3:200:f8ff:fe21:67cf' , #NEWLINE# 'peer_cidrs' : [ '20.1.0.0/24' , '21.1.0.0/24' ] , #NEWLINE# 'peer_id' : '2607:f0d0:4545:3:200:f8ff:fe21:67cf' , #NEWLINE# 'psk' : 'secret' , #NEWLINE# 'vpnservice_id' : vpnservice_dict [ 'id' ] , #NEWLINE# 'admin_state_up' : True , #NEWLINE# 'status' : 'Active' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_ipsecsiteconnections . add ( ipsecsiteconnection_dict ) #NEWLINE# TEST . ipsecsiteconnections . add ( vpn . IPSecSiteConnection ( ipsecsiteconnection_dict ) ) #NEWLINE# ipsecsiteconnection_dict = { #NEWLINE# #INDENT# 'id' : 'dd1dd3a0-f349-49be-b013-245e147763d7' , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'name' : 'ipsec_connection_2' , #NEWLINE# 'description' : 'vpn connection description' , #NEWLINE# 'dpd' : { #NEWLINE# #INDENT# 'action' : 'hold' , #NEWLINE# 'interval' : 30 , #NEWLINE# 'timeout' : 120 , #NEWLINE# #UNINDENT# } , #NEWLINE# 'ikepolicy_id' : ikepolicy_dict [ 'id' ] , #NEWLINE# 'initiator' : 'bi-directional' , #NEWLINE# 'ipsecpolicy_id' : ipsecpolicy_dict [ 'id' ] , #NEWLINE# 'mtu' : 1500 , #NEWLINE# 'peer_address' : '172.0.0.2' , #NEWLINE# 'peer_cidrs' : [ '20.1.0.0/24' ] , #NEWLINE# 'peer_id' : '172.0.0.2' , #NEWLINE# 'psk' : 'secret' , #NEWLINE# 'vpnservice_id' : vpnservice_dict [ 'id' ] , #NEWLINE# 'admin_state_up' : True , #NEWLINE# 'status' : 'Active' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_ipsecsiteconnections . add ( ipsecsiteconnection_dict ) #NEWLINE# TEST . ipsecsiteconnections . add ( vpn . IPSecSiteConnection ( ipsecsiteconnection_dict ) ) #NEWLINE# rule1_dict = { #NEWLINE# #INDENT# 'id' : 'f0881d38-c3eb-4fee-9763-12de3338041d' , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'name' : 'rule1' , #NEWLINE# 'description' : 'rule1 description' , #NEWLINE# 'protocol' : 'tcp' , #NEWLINE# 'action' : 'allow' , #NEWLINE# 'source_ip_address' : '1.2.3.0/24' , #NEWLINE# 'source_port' : '80' , #NEWLINE# 'destination_ip_address' : '4.5.6.7/32' , #NEWLINE# 'destination_port' : '1:65535' , #NEWLINE# 'firewall_policy_id' : 'abcdef-c3eb-4fee-9763-12de3338041e' , #NEWLINE# 'position' : 1 , #NEWLINE# 'shared' : True , #NEWLINE# 'enabled' : True , #NEWLINE# 'ip_version' : '4' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_fw_rules . add ( rule1_dict ) #NEWLINE# rule1 = fwaas . Rule ( copy . deepcopy ( rule1_dict ) ) #NEWLINE# TEST . fw_rules . add ( rule1 ) #NEWLINE# rule2_dict = { #NEWLINE# #INDENT# 'id' : 'c6298a93-850f-4f64-b78a-959fd4f1e5df' , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'name' : '' , #NEWLINE# 'description' : '' , #NEWLINE# 'protocol' : 'udp' , #NEWLINE# 'action' : 'deny' , #NEWLINE# 'source_ip_address' : '1.2.3.0/24' , #NEWLINE# 'source_port' : '80' , #NEWLINE# 'destination_ip_address' : '4.5.6.7/32' , #NEWLINE# 'destination_port' : '1:65535' , #NEWLINE# 'firewall_policy_id' : 'abcdef-c3eb-4fee-9763-12de3338041e' , #NEWLINE# 'position' : 2 , #NEWLINE# 'shared' : True , #NEWLINE# 'enabled' : True , #NEWLINE# 'ip_version' : '6' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_fw_rules . add ( rule2_dict ) #NEWLINE# rule2 = fwaas . Rule ( copy . deepcopy ( rule2_dict ) ) #NEWLINE# TEST . fw_rules . add ( rule2 ) #NEWLINE# rule3_dict = { #NEWLINE# #INDENT# 'id' : 'h0881d38-c3eb-4fee-9763-12de3338041d' , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'name' : 'rule3' , #NEWLINE# 'description' : 'rule3 description' , #NEWLINE# 'protocol' : None , #NEWLINE# 'action' : 'allow' , #NEWLINE# 'source_ip_address' : '1.2.3.0/24' , #NEWLINE# 'source_port' : '80' , #NEWLINE# 'destination_ip_address' : '4.5.6.7/32' , #NEWLINE# 'destination_port' : '1:65535' , #NEWLINE# 'firewall_policy_id' : None , #NEWLINE# 'position' : None , #NEWLINE# 'shared' : True , #NEWLINE# 'enabled' : True , #NEWLINE# 'ip_version' : '4' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_fw_rules . add ( rule3_dict ) #NEWLINE# rule3 = fwaas . Rule ( copy . deepcopy ( rule3_dict ) ) #NEWLINE# rule3 . _apidict [ 'policy' ] = None #NEWLINE# TEST . fw_rules . add ( rule3 ) #NEWLINE# policy1_dict = { #NEWLINE# #INDENT# 'id' : 'abcdef-c3eb-4fee-9763-12de3338041e' , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'name' : 'policy1' , #NEWLINE# 'description' : 'policy with two rules' , #NEWLINE# 'firewall_rules' : [ rule1_dict [ 'id' ] , rule2_dict [ 'id' ] ] , #NEWLINE# 'audited' : True , #NEWLINE# 'shared' : True , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_fw_policies . add ( policy1_dict ) #NEWLINE# policy1 = fwaas . Policy ( copy . deepcopy ( policy1_dict ) ) #NEWLINE# policy1 . _apidict [ 'rules' ] = [ rule1 , rule2 ] #NEWLINE# TEST . fw_policies . add ( policy1 ) #NEWLINE# rule1 . _apidict [ 'policy' ] = policy1 #NEWLINE# rule2 . _apidict [ 'policy' ] = policy1 #NEWLINE# policy2_dict = { #NEWLINE# #INDENT# 'id' : 'cf50b331-787a-4623-825e-da794c918d6a' , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'name' : '' , #NEWLINE# 'description' : '' , #NEWLINE# 'firewall_rules' : [ ] , #NEWLINE# 'audited' : False , #NEWLINE# 'shared' : False , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_fw_policies . add ( policy2_dict ) #NEWLINE# policy2 = fwaas . Policy ( copy . deepcopy ( policy2_dict ) ) #NEWLINE# policy2 . _apidict [ 'rules' ] = [ ] #NEWLINE# TEST . fw_policies . add ( policy2 ) #NEWLINE# fw1_dict = { #NEWLINE# #INDENT# 'id' : '8913dde8-4915-4b90-8d3e-b95eeedb0d49' , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'firewall_policy_id' : 'abcdef-c3eb-4fee-9763-12de3338041e' , #NEWLINE# 'name' : 'firewall1' , #NEWLINE# 'router_ids' : [ TEST . routers . first ( ) . id ] , #NEWLINE# 'description' : 'firewall description' , #NEWLINE# 'status' : 'PENDING_CREATE' , #NEWLINE# 'admin_state_up' : True , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_firewalls . add ( fw1_dict ) #NEWLINE# fw1 = fwaas . Firewall ( copy . deepcopy ( fw1_dict ) ) #NEWLINE# fw1 . _apidict [ 'policy' ] = policy1 #NEWLINE# fw1 . _apidict [ 'routers' ] = [ TEST . routers . first ( ) ] #NEWLINE# TEST . firewalls . add ( fw1 ) #NEWLINE# fw2_dict = { #NEWLINE# #INDENT# 'id' : '1aa75150-415f-458e-bae5-5a362a4fb1f7' , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'firewall_policy_id' : 'abcdef-c3eb-4fee-9763-12de3338041e' , #NEWLINE# 'name' : '' , #NEWLINE# 'router_ids' : [ ] , #NEWLINE# 'description' : '' , #NEWLINE# 'status' : 'PENDING_CREATE' , #NEWLINE# 'admin_state_up' : True , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_firewalls . add ( fw2_dict ) #NEWLINE# fw2 = fwaas . Firewall ( copy . deepcopy ( fw2_dict ) ) #NEWLINE# fw2 . _apidict [ 'policy' ] = policy1 #NEWLINE# TEST . firewalls . add ( fw2 ) #NEWLINE# net_profile_dict = { #NEWLINE# #INDENT# 'name' : 'net_profile_test2' , #NEWLINE# 'segment_type' : 'overlay' , #NEWLINE# 'sub_type' : 'native_vxlan' , #NEWLINE# 'segment_range' : '10000-10100' , #NEWLINE# 'multicast_ip_range' : '144.0.0.0-144.0.0.100' , #NEWLINE# 'id' : '00000000-2222-2222-2222-000000000000' , #NEWLINE# 'project' : '1' , #NEWLINE# 'physical_network' : None , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_net_profiles . add ( net_profile_dict ) #NEWLINE# TEST . net_profiles . add ( neutron . Profile ( net_profile_dict ) ) #NEWLINE# network_profile_binding_dict = { #NEWLINE# #INDENT# 'profile_id' : '00000000-2222-2222-2222-000000000000' , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_network_profile_binding . add ( network_profile_binding_dict ) #NEWLINE# TEST . network_profile_binding . add ( neutron . Profile ( network_profile_binding_dict ) ) #NEWLINE# net_profile_dict = { #NEWLINE# #INDENT# 'name' : 'net_profile_test3' , #NEWLINE# 'segment_type' : 'overlay' , #NEWLINE# 'sub_type' : 'other' , #NEWLINE# 'other_subtype' : 'GRE' , #NEWLINE# 'segment_range' : '11000-11100' , #NEWLINE# 'id' : '00000000-3333-3333-3333-000000000000' , #NEWLINE# 'project' : '1' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_net_profiles . add ( net_profile_dict ) #NEWLINE# TEST . net_profiles . add ( neutron . Profile ( net_profile_dict ) ) #NEWLINE# network_profile_binding_dict = { #NEWLINE# #INDENT# 'profile_id' : '00000000-3333-3333-3333-000000000000' , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_network_profile_binding . add ( network_profile_binding_dict ) #NEWLINE# TEST . network_profile_binding . add ( neutron . Profile ( network_profile_binding_dict ) ) #NEWLINE# net_profile_dict = { #NEWLINE# #INDENT# 'name' : 'net_profile_test4' , #NEWLINE# 'segment_type' : 'trunk' , #NEWLINE# 'sub_type_trunk' : 'vlan' , #NEWLINE# 'id' : '00000000-4444-4444-4444-000000000000' , #NEWLINE# 'project' : '1' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_net_profiles . add ( net_profile_dict ) #NEWLINE# TEST . net_profiles . add ( neutron . Profile ( net_profile_dict ) ) #NEWLINE# network_profile_binding_dict = { #NEWLINE# #INDENT# 'profile_id' : '00000000-4444-4444-4444-000000000000' , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_network_profile_binding . add ( network_profile_binding_dict ) #NEWLINE# TEST . network_profile_binding . add ( neutron . Profile ( network_profile_binding_dict ) ) #NEWLINE# network_dict = { #NEWLINE# #INDENT# 'admin_state_up' : True , #NEWLINE# 'id' : '7aa23d91-ffff-abab-dcdc-3411ae767e8a' , #NEWLINE# 'name' : 'net4' , #NEWLINE# 'status' : 'ACTIVE' , #NEWLINE# 'subnets' : [ '31be4a21-aadd-73da-6422-821ff249a4bb' ] , #NEWLINE# 'tenant_id' : '1' , #NEWLINE# 'router:external' : False , #NEWLINE# 'shared' : False , #NEWLINE# #UNINDENT# } #NEWLINE# subnet_dict = { #NEWLINE# #INDENT# 'allocation_pools' : [ { #NEWLINE# #INDENT# 'end' : '11.10.0.254' , #NEWLINE# 'start' : '11.10.0.2' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# 'dns_nameservers' : [ ] , #NEWLINE# 'host_routes' : [ ] , #NEWLINE# 'cidr' : '11.10.0.0/24' , #NEWLINE# 'enable_dhcp' : True , #NEWLINE# 'gateway_ip' : '11.10.0.1' , #NEWLINE# 'id' : network_dict [ 'subnets' ] [ 0 ] , #NEWLINE# 'ip_version' : 4 , #NEWLINE# 'name' : 'mysubnet4' , #NEWLINE# 'network_id' : network_dict [ 'id' ] , #NEWLINE# 'tenant_id' : network_dict [ 'tenant_id' ] , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_networks . add ( network_dict ) #NEWLINE# TEST . api_subnets . add ( subnet_dict ) #NEWLINE# network = copy . deepcopy ( network_dict ) #NEWLINE# subnet = neutron . Subnet ( subnet_dict ) #NEWLINE# network [ 'subnets' ] = [ subnet ] #NEWLINE# TEST . networks . add ( neutron . Network ( network ) ) #NEWLINE# TEST . subnets . add ( subnet ) #NEWLINE# net_profile_dict = { #NEWLINE# #INDENT# 'name' : 'net_profile_test5' , #NEWLINE# 'segment_type' : 'vlan' , #NEWLINE# 'physical_network' : 'phys5' , #NEWLINE# 'segment_range' : '400-450' , #NEWLINE# 'id' : '00000000-5555-5555-5555-000000000000' , #NEWLINE# 'project' : TEST . networks . get ( name = 'net4' ) [ 'tenant_id' ] , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_net_profiles . add ( net_profile_dict ) #NEWLINE# TEST . net_profiles . add ( neutron . Profile ( net_profile_dict ) ) #NEWLINE# policy_profile_dict = { #NEWLINE# #INDENT# 'name' : 'policy_profile_test2' , #NEWLINE# 'id' : '11111111-9999-9999-9999-111111111111' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_policy_profiles . add ( policy_profile_dict ) #NEWLINE# TEST . policy_profiles . add ( neutron . Profile ( policy_profile_dict ) ) #NEWLINE# network_profile_binding_dict = { #NEWLINE# #INDENT# 'profile_id' : '00000000-5555-5555-5555-000000000000' , #NEWLINE# 'tenant_id' : TEST . networks . get ( name = 'net4' ) [ 'tenant_id' ] , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_network_profile_binding . add ( network_profile_binding_dict ) #NEWLINE# TEST . network_profile_binding . add ( neutron . Profile ( network_profile_binding_dict ) ) #NEWLINE# policy_profile_binding_dict = { #NEWLINE# #INDENT# 'profile_id' : '11111111-9999-9999-9999-111111111111' , #NEWLINE# 'tenant_id' : TEST . networks . get ( name = 'net4' ) [ 'tenant_id' ] , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_policy_profile_binding . add ( policy_profile_binding_dict ) #NEWLINE# TEST . policy_profile_binding . add ( neutron . Profile ( policy_profile_binding_dict ) ) #NEWLINE# port_dict = { #NEWLINE# #INDENT# 'admin_state_up' : True , #NEWLINE# 'device_id' : '9872faaa-b2b2-eeee-9911-21332eedaa77' , #NEWLINE# 'device_owner' : 'network:dhcp' , #NEWLINE# 'fixed_ips' : [ { #NEWLINE# #INDENT# 'ip_address' : '11.10.0.3' , #NEWLINE# 'subnet_id' : TEST . subnets . get ( name = 'mysubnet4' ) [ 'id' ] , #NEWLINE# #UNINDENT# } ] , #NEWLINE# 'id' : 'a21dcd22-6733-cccc-aa32-22adafaf16a2' , #NEWLINE# 'mac_address' : '78:22:ff:1a:ba:23' , #NEWLINE# 'name' : 'port5' , #NEWLINE# 'network_id' : TEST . networks . get ( name = 'net4' ) [ 'id' ] , #NEWLINE# 'status' : 'ACTIVE' , #NEWLINE# 'tenant_id' : TEST . networks . get ( name = 'net4' ) [ 'tenant_id' ] , #NEWLINE# 'binding:vnic_type' : 'normal' , #NEWLINE# 'binding:host_id' : 'host' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . api_ports . add ( port_dict ) #NEWLINE# TEST . ports . add ( neutron . Port ( port_dict ) )