def main(): import sys from vn_test import VNFixture from vm_test import VMFixture # sys.settrace(tracefunc) # obj = LBaasFixture(api_type='neutron', name='LB', connections=setup_test_infra(), network_id='4b39a2bd-4528-40e8-b848-28084e59c944', members={'vms': ['a72ad607-f1ca-44f2-b31e-e825a3f2d408'], 'address': ['192.168.1.10']}, vip_net_id='4b39a2bd-4528-40e8-b848-28084e59c944', protocol='TCP', port='22', healthmonitors=[{'delay':5, 'timeout':5, 'max_retries':5, 'probe_type':'PING'}]) conn = setup_test_infra() vnfix = VNFixture(connections=conn, vn_name='admin-33688095') vnfix.setUp() fip_fix = VNFixture(connections=conn, router_external=True, vn_name='fip-vn') fip_fix.setUp() subnet = vnfix.get_cidrs()[0] vm_fix = VMFixture(connections=conn, vn_obj=vnfix.obj, vm_name='member-vm') vm_fix.setUp() obj = LBaasV2Fixture(lb_name='LB-Test', connections=conn, network_id=vnfix.uuid, fip_net_id=fip_fix.uuid, listener_name='Listener-Test', vip_port='80', vip_protocol='HTTP', pool_name='Pool-Test', pool_port='80', pool_protocol='HTTP', pool_algorithm='ROUND_ROBIN', members={'vms': [vm_fix.vm_id]}, hm_delay=5, hm_timeout=5, hm_max_retries=5, hm_probe_type='PING', ) obj.setUp() import pdb; pdb.set_trace() obj.verify_on_setup() obj.cleanUp() exit() import pdb; pdb.set_trace() # obj = LBaasFixture(api_type='neutron', uuid='58e5fb2c-ec47-4eb8-b4bf-9c66b0473f78', connections=setup_test_infra()) obj.verify_on_setup() obj.delete_custom_attr('max_sess_rate') obj.add_custom_attr('client_timeout', 20000) obj.delete_custom_attr('server_timeout') obj.add_custom_attr('max_sess_rate', 20000) obj.delete_custom_attr('rate_limit_sessions') obj.add_custom_attr('rate_limit_sessions', 20) obj.delete_custom_attr('max_conn') obj.add_custom_attr('max_conn', 20) obj.delete_custom_attr('http_server_close') obj.add_custom_attr('http_server_close', "False") obj.verify_on_setup() obj.create_fip_on_vip() obj.verify_on_setup() obj.delete_fip_on_vip() obj.verify_on_setup() obj.delete_vip() obj.verify_on_setup() obj.check_and_create_vip() obj.verify_on_setup() obj.delete_member(address=obj.member_ips[1]) obj.verify_on_setup() obj.create_member(address=get_random_ip(subnet)) obj.verify_on_setup() obj.delete_hmon(obj.hmons.keys()[0]) obj.verify_on_setup() obj.create_hmon({'delay': 5, 'max_retries': 5, 'probe_type': 'PING', 'timeout': 10}) obj.verify_on_setup() obj.cleanUp() vm_fix.cleanUp() vnfix.cleanUp() vip_fix.cleanUp() fip_fix.cleanUp()
def test_check_vxlan_id_reuse(self): ''' Create a VN X Create another VN Y and check that the VNid is the next number Delete the two Vns On creating a VN again, verify that Vxlan id of X is used (i.e vxlan id gets reused) ''' vn1_name = get_random_name('vn') vn1_subnets = [get_random_cidr()] vn2_name = get_random_name('vn') vn2_subnets = [get_random_cidr()] # First VN vn1_obj = VNFixture(project_name=self.inputs.project_name, connections=self.connections, inputs=self.inputs, vn_name=vn1_name, subnets=vn1_subnets) vn1_obj.setUp() vxlan_id1 = vn1_obj.get_vxlan_id() # Second VN vn2_obj = VNFixture(project_name=self.inputs.project_name, connections=self.connections, inputs=self.inputs, vn_name=vn2_name, subnets=vn2_subnets) vn2_obj.setUp() vxlan_id2 = vn2_obj.get_vxlan_id() assert vxlan_id2 == (vxlan_id1+1), ( "Vxlan ID allocation is not incremental, " "Two VNs were seen to have vxlan ids %s, %s" % ( vxlan_id1, vxlan_id2)) # Delete the vns vn1_obj.cleanUp() vn2_obj.cleanUp() vn3_fixture = self.create_vn() assert vn3_fixture.verify_on_setup(), "VNFixture verify failed!" new_vxlan_id = vn3_fixture.get_vxlan_id() assert new_vxlan_id == vxlan_id1, ( "Vxlan ID reuse does not seem to happen", "Expected : %s, Got : %s" % (vxlan_id1, new_vxlan_id)) self.logger.info('Vxlan ids are reused..ok')
def test_check_vxlan_id_reuse(self): ''' Create a VN X Create another VN Y and check that the VNid is the next number Delete the two Vns On creating a VN again, verify that Vxlan id of X is used (i.e vxlan id gets reused) ''' vn1_name = get_random_name('vn') vn1_subnets = [get_random_cidr()] vn2_name = get_random_name('vn') vn2_subnets = [get_random_cidr()] # First VN vn1_obj = VNFixture(project_name=self.inputs.project_name, connections=self.connections, inputs=self.inputs, vn_name=vn1_name, subnets=vn1_subnets) vn1_obj.setUp() vxlan_id1 = vn1_obj.get_vxlan_id() # Second VN vn2_obj = VNFixture(project_name=self.inputs.project_name, connections=self.connections, inputs=self.inputs, vn_name=vn2_name, subnets=vn2_subnets) vn2_obj.setUp() vxlan_id2 = vn2_obj.get_vxlan_id() assert vxlan_id2 == ( vxlan_id1 + 1), ("Vxlan ID allocation is not incremental, " "Two VNs were seen to have vxlan ids %s, %s" % (vxlan_id1, vxlan_id2)) # Delete the vns vn1_obj.cleanUp() vn2_obj.cleanUp() vn3_fixture = self.create_vn() assert vn3_fixture.verify_on_setup(), "VNFixture verify failed!" new_vxlan_id = vn3_fixture.get_vxlan_id() assert new_vxlan_id == vxlan_id1, ( "Vxlan ID reuse does not seem to happen", "Expected : %s, Got : %s" % (vxlan_id1, new_vxlan_id)) self.logger.info('Vxlan ids are reused..ok')
obj.add_custom_attr('max_conn', 20) obj.delete_custom_attr('http_server_close') obj.add_custom_attr('http_server_close', "False") obj.verify_on_setup() obj.create_fip_on_vip() obj.verify_on_setup() obj.delete_fip_on_vip() obj.verify_on_setup() obj.delete_vip() obj.verify_on_setup() obj.check_and_create_vip() obj.verify_on_setup() obj.delete_member(address=obj.member_ips[1]) obj.verify_on_setup() obj.create_member(address=get_random_ip(subnet)) obj.verify_on_setup() obj.delete_hmon(obj.hmons.keys()[0]) obj.verify_on_setup() obj.create_hmon({ 'delay': 5, 'max_retries': 5, 'probe_type': 'PING', 'timeout': 10 }) obj.verify_on_setup() obj.cleanUp() vm_fix.cleanUp() vnfix.cleanUp() vip_fix.cleanUp() fip_fix.cleanUp()
def main(): import sys from vn_test import VNFixture from vm_test import VMFixture # sys.settrace(tracefunc) # obj = LBaasFixture(api_type='neutron', name='LB', connections=setup_test_infra(), network_id='4b39a2bd-4528-40e8-b848-28084e59c944', members={'vms': ['a72ad607-f1ca-44f2-b31e-e825a3f2d408'], 'address': ['192.168.1.10']}, vip_net_id='4b39a2bd-4528-40e8-b848-28084e59c944', protocol='TCP', port='22', healthmonitors=[{'delay':5, 'timeout':5, 'max_retries':5, 'probe_type':'PING'}]) conn = setup_test_infra() vnfix = VNFixture(connections=conn, vn_name='admin-33688095') vnfix.setUp() fip_fix = VNFixture(connections=conn, router_external=True, vn_name='fip-vn') fip_fix.setUp() subnet = vnfix.get_cidrs()[0] vm_fix = VMFixture(connections=conn, vn_obj=vnfix.obj, vm_name='member-vm') vm_fix.setUp() obj = LBaasV2Fixture( lb_name='LB-Test', connections=conn, network_id=vnfix.uuid, fip_net_id=fip_fix.uuid, listener_name='Listener-Test', vip_port='80', vip_protocol='HTTP', pool_name='Pool-Test', pool_port='80', pool_protocol='HTTP', pool_algorithm='ROUND_ROBIN', members={'vms': [vm_fix.vm_id]}, hm_delay=5, hm_timeout=5, hm_max_retries=5, hm_probe_type='PING', ) obj.setUp() import pdb pdb.set_trace() obj.verify_on_setup() obj.cleanUp() exit() import pdb pdb.set_trace() # obj = LBaasFixture(api_type='neutron', uuid='58e5fb2c-ec47-4eb8-b4bf-9c66b0473f78', connections=setup_test_infra()) obj.verify_on_setup() obj.delete_custom_attr('max_sess_rate') obj.add_custom_attr('client_timeout', 20000) obj.delete_custom_attr('server_timeout') obj.add_custom_attr('max_sess_rate', 20000) obj.delete_custom_attr('rate_limit_sessions') obj.add_custom_attr('rate_limit_sessions', 20) obj.delete_custom_attr('max_conn') obj.add_custom_attr('max_conn', 20) obj.delete_custom_attr('http_server_close') obj.add_custom_attr('http_server_close', "False") obj.verify_on_setup() obj.create_fip_on_vip() obj.verify_on_setup() obj.delete_fip_on_vip() obj.verify_on_setup() obj.delete_vip() obj.verify_on_setup() obj.check_and_create_vip() obj.verify_on_setup() obj.delete_member(address=obj.member_ips[1]) obj.verify_on_setup() obj.create_member(address=get_random_ip(subnet)) obj.verify_on_setup() obj.delete_hmon(obj.hmons.keys()[0]) obj.verify_on_setup() obj.create_hmon({ 'delay': 5, 'max_retries': 5, 'probe_type': 'PING', 'timeout': 10 }) obj.verify_on_setup() obj.cleanUp() vm_fix.cleanUp() vnfix.cleanUp() vip_fix.cleanUp() fip_fix.cleanUp()
obj.delete_custom_attr('server_timeout') obj.add_custom_attr('max_sess_rate', 20000) obj.delete_custom_attr('rate_limit_sessions') obj.add_custom_attr('rate_limit_sessions', 20) obj.delete_custom_attr('max_conn') obj.add_custom_attr('max_conn', 20) obj.delete_custom_attr('http_server_close') obj.add_custom_attr('http_server_close', "False") obj.verify_on_setup() obj.create_fip_on_vip() obj.verify_on_setup() obj.delete_fip_on_vip() obj.verify_on_setup() obj.delete_vip() obj.verify_on_setup() obj.check_and_create_vip() obj.verify_on_setup() obj.delete_member(address=obj.member_ips[1]) obj.verify_on_setup() obj.create_member(address=get_random_ip(subnet)) obj.verify_on_setup() obj.delete_hmon(obj.hmons.keys()[0]) obj.verify_on_setup() obj.create_hmon({'delay': 5, 'max_retries': 5, 'probe_type': 'PING', 'timeout': 10}) obj.verify_on_setup() obj.cleanUp() vm_fix.cleanUp() vnfix.cleanUp() vip_fix.cleanUp() fip_fix.cleanUp()