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')