- self.assertEquals(vm_inst, inst_creator.get_vm_inst())
-
- validate_ssh_client(inst_creator)
-
- # TODO - Determine how allowed_address_pairs is supposed to operate before continuing this test
- # see http://docs.openstack.org/developer/dragonflow/specs/allowed_address_pairs.html for a functional description
- # def test_allowed_address_port_access(self):
- # """
- # Tests to ensure that setting allowed_address_pairs on a port functions as designed
- # """
- # port_settings_1 = PortSettings(
- # name=self.port_1_name + '-1', network_name=self.pub_net_config.network_settings.name)
- #
- # instance_settings_1 = VmInstanceSettings(
- # name=self.vm_inst_name + '-1', flavor=self.flavor_creator.flavor_settings.name, port_settings=[port_settings_1],
- # floating_ip_settings=[FloatingIpSettings(
- # name=self.floating_ip_name + '-1', port_name=port_settings_1.name,
- # router_name=self.pub_net_config.router_settings.name)])
- #
- # inst_creator_1 = OpenStackVmInstance(
- # self.os_creds, instance_settings_1, self.image_creator.image_settings,
- # keypair_settings=self.keypair_creator.keypair_settings)
- # self.inst_creators.append(inst_creator_1)
- #
- # # block=True will force the create() method to block until the
- # vm_inst_1 = inst_creator_1.create(block=True)
- # self.assertIsNotNone(vm_inst_1)
- #
- # port_settings_1 = PortSettings(
- # name=self.port_1_name + '-1', network_name=self.pub_net_config.network_settings.name)
- #
- # instance_settings_1 = VmInstanceSettings(
- # name=self.vm_inst_name + '-1', flavor=self.flavor_creator.flavor_settings.name, port_settings=[port_settings_1],
- # floating_ip_settings=[FloatingIpSettings(
- # name=self.floating_ip_name + '-1', port_name=port_settings_1.name,
- # router_name=self.pub_net_config.router_settings.name)])
- #
- # inst_creator_1 = OpenStackVmInstance(
- # self.os_creds, instance_settings_1, self.image_creator.image_settings,
- # keypair_settings=self.keypair_creator.keypair_settings)
- # self.inst_creators.append(inst_creator_1)
- # inst_creator_1.create(block=True)
- #
- # ip = inst_creator_1.get_port_ip(port_settings_1.name,
- # subnet_name=self.pub_net_config.network_settings.subnet_settings[0].name)
- # self.assertIsNotNone(ip)
- # mac_addr = inst_creator_1.get_port_mac(port_settings_1.name)
- # self.assertIsNotNone(mac_addr)
- #
- # allowed_address_pairs = [{'ip_address': ip, 'mac_address': mac_addr}]
- #
- # # Create VM that can be accessed by vm_inst_1
- # port_settings_2 = PortSettings(
- # name=self.port_1_name + '-2', network_name=self.pub_net_config.network_settings.name,
- # allowed_address_pairs=allowed_address_pairs)
- #
- # instance_settings_2 = VmInstanceSettings(
- # name=self.vm_inst_name + '-2', flavor=self.flavor_creator.flavor_settings.name,
- # port_settings=[port_settings_2])
- #
- # inst_creator_2 = OpenStackVmInstance(
- # self.os_creds, instance_settings_2, self.image_creator.image_settings)
- # self.inst_creators.append(inst_creator_2)
- # inst_creator_2.create(block=True)
- #
- # # Create VM that cannot be accessed by vm_inst_1
- # ip = '10.55.0.101'
- # mac_addr = '0a:1b:2c:3d:4e:5f'
- # invalid_address_pairs = [{'ip_address': ip, 'mac_address': mac_addr}]
- #
- # port_settings_3 = PortSettings(
- # name=self.port_1_name + '-3', network_name=self.pub_net_config.network_settings.name,
- # allowed_address_pairs=invalid_address_pairs)
- #
- # instance_settings_3 = VmInstanceSettings(
- # name=self.vm_inst_name + '-3', flavor=self.flavor_creator.flavor_settings.name,
- # port_settings=[port_settings_3])
- #
- # inst_creator_3 = OpenStackVmInstance(
- # self.os_creds, instance_settings_3, self.image_creator.image_settings)
- # self.inst_creators.append(inst_creator_3)
- # inst_creator_3.create(block=True)
- #
- # print 'foo'
- # I expected that this feature would block/allow traffic from specific endpoints (VMs). In this case, I would expect
- # inst_1 to be able to access inst_2 but not inst_3; however, they all can access each other.
- # TODO - Add validation