Kevin Benton | a305d59 | 2016-09-19 04:26:10 -0700 | [diff] [blame] | 1 | # All Rights Reserved. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 | # not use this file except in compliance with the License. You may obtain |
| 5 | # a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations |
| 13 | # under the License. |
| 14 | |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 15 | import collections |
| 16 | |
| 17 | from neutron_lib import constants |
Kevin Benton | 07c9056 | 2017-02-27 01:53:16 -0800 | [diff] [blame] | 18 | from oslo_log import log as logging |
Chandan Kumar | c125fd1 | 2017-11-15 19:41:01 +0530 | [diff] [blame] | 19 | from tempest.common import utils as tutils |
Itzik Brown | bac51dc | 2016-10-31 12:25:04 +0000 | [diff] [blame] | 20 | from tempest.lib.common.utils import data_utils |
Sławek Kapłoński | c0caa2e | 2017-02-25 10:11:32 +0000 | [diff] [blame] | 21 | from tempest.lib import decorators |
Genadi Chereshnya | e91b69c | 2017-07-16 09:51:58 +0300 | [diff] [blame] | 22 | import testtools |
Kevin Benton | a305d59 | 2016-09-19 04:26:10 -0700 | [diff] [blame] | 23 | |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 24 | from neutron_tempest_plugin.common import ip |
Chandan Kumar | 667d3d3 | 2017-09-22 12:24:06 +0530 | [diff] [blame] | 25 | from neutron_tempest_plugin.common import ssh |
| 26 | from neutron_tempest_plugin.common import utils |
| 27 | from neutron_tempest_plugin import config |
| 28 | from neutron_tempest_plugin.scenario import base |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 29 | |
Kevin Benton | a305d59 | 2016-09-19 04:26:10 -0700 | [diff] [blame] | 30 | |
Kevin Benton | 07c9056 | 2017-02-27 01:53:16 -0800 | [diff] [blame] | 31 | LOG = logging.getLogger(__name__) |
Kevin Benton | a305d59 | 2016-09-19 04:26:10 -0700 | [diff] [blame] | 32 | CONF = config.CONF |
Kevin Benton | a305d59 | 2016-09-19 04:26:10 -0700 | [diff] [blame] | 33 | |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 34 | |
| 35 | ServerWithTrunkPort = collections.namedtuple( |
| 36 | 'ServerWithTrunkPort', |
| 37 | ['port', 'subport', 'trunk', 'floating_ip', 'server', |
| 38 | 'ssh_client']) |
Jakub Libosvar | 6d397d3 | 2016-12-30 10:57:52 -0500 | [diff] [blame] | 39 | |
| 40 | |
Kevin Benton | a305d59 | 2016-09-19 04:26:10 -0700 | [diff] [blame] | 41 | class TrunkTest(base.BaseTempestTestCase): |
| 42 | credentials = ['primary'] |
| 43 | force_tenant_isolation = False |
| 44 | |
| 45 | @classmethod |
Chandan Kumar | c125fd1 | 2017-11-15 19:41:01 +0530 | [diff] [blame] | 46 | @tutils.requires_ext(extension="trunk", service="network") |
Kevin Benton | a305d59 | 2016-09-19 04:26:10 -0700 | [diff] [blame] | 47 | def resource_setup(cls): |
| 48 | super(TrunkTest, cls).resource_setup() |
| 49 | # setup basic topology for servers we can log into |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 50 | cls.rand_name = data_utils.rand_name( |
| 51 | cls.__name__.rsplit('.', 1)[-1]) |
| 52 | cls.network = cls.create_network(name=cls.rand_name) |
| 53 | cls.subnet = cls.create_subnet(network=cls.network, |
| 54 | name=cls.rand_name) |
Huifeng Le | 1c9f40b | 2018-11-07 01:14:21 +0800 | [diff] [blame] | 55 | cls.router = cls.create_router_by_client() |
| 56 | cls.create_router_interface(cls.router['id'], cls.subnet['id']) |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 57 | cls.keypair = cls.create_keypair(name=cls.rand_name) |
Kevin Benton | a305d59 | 2016-09-19 04:26:10 -0700 | [diff] [blame] | 58 | |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 59 | def setUp(self): |
| 60 | super(TrunkTest, self).setUp() |
| 61 | self.security_group = self.create_security_group(name=self.rand_name) |
| 62 | self.create_loginable_secgroup_rule(self.security_group['id']) |
Kevin Benton | a305d59 | 2016-09-19 04:26:10 -0700 | [diff] [blame] | 63 | |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 64 | def _create_server_with_network(self, network, use_advanced_image=False): |
| 65 | port = self._create_server_port(network=network) |
| 66 | floating_ip = self.create_floatingip(port=port) |
| 67 | ssh_client = self._create_ssh_client( |
| 68 | floating_ip=floating_ip, use_advanced_image=use_advanced_image) |
| 69 | server = self._create_server(port=port, |
| 70 | use_advanced_image=use_advanced_image) |
| 71 | return ServerWithTrunkPort(port=port, subport=None, trunk=None, |
| 72 | floating_ip=floating_ip, server=server, |
| 73 | ssh_client=ssh_client) |
| 74 | |
| 75 | def _create_server_with_trunk_port(self, subport_network=None, |
| 76 | segmentation_id=None, |
| 77 | use_advanced_image=False): |
| 78 | port = self._create_server_port() |
| 79 | floating_ip = self.create_floatingip(port=port) |
| 80 | ssh_client = self._create_ssh_client( |
| 81 | floating_ip=floating_ip, use_advanced_image=use_advanced_image) |
| 82 | |
| 83 | subport = None |
| 84 | subports = None |
| 85 | if subport_network: |
| 86 | subport = self._create_server_port( |
| 87 | network=subport_network, mac_address=port['mac_address']) |
| 88 | subports = [{'port_id': subport['id'], |
| 89 | 'segmentation_type': 'vlan', |
| 90 | 'segmentation_id': segmentation_id}] |
| 91 | trunk = self.create_trunk(port=port, subports=subports) |
| 92 | |
| 93 | server = self._create_server(port=port, |
| 94 | use_advanced_image=use_advanced_image) |
| 95 | return ServerWithTrunkPort(port=port, subport=subport, trunk=trunk, |
| 96 | floating_ip=floating_ip, server=server, |
| 97 | ssh_client=ssh_client) |
| 98 | |
| 99 | def _create_server_port(self, network=None, **params): |
| 100 | network = network or self.network |
| 101 | return self.create_port(network=network, name=self.rand_name, |
| 102 | security_groups=[self.security_group['id']], |
| 103 | **params) |
| 104 | |
| 105 | def _create_server(self, port, use_advanced_image=False, **params): |
Slawek Kaplonski | da17f00 | 2018-10-11 18:35:23 +0200 | [diff] [blame] | 106 | if use_advanced_image: |
| 107 | flavor_ref = CONF.neutron_plugin_options.advanced_image_flavor_ref |
| 108 | image_ref = CONF.neutron_plugin_options.advanced_image_ref |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 109 | else: |
| 110 | flavor_ref = CONF.compute.flavor_ref |
| 111 | image_ref = CONF.compute.image_ref |
| 112 | return self.create_server(flavor_ref=flavor_ref, |
| 113 | image_ref=image_ref, |
| 114 | key_name=self.keypair['name'], |
| 115 | networks=[{'port': port['id']}], |
| 116 | **params)['server'] |
Jakub Libosvar | 6d397d3 | 2016-12-30 10:57:52 -0500 | [diff] [blame] | 117 | |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 118 | def _show_port(self, port, update=False): |
| 119 | observed = self.client.show_port(port['id'])['port'] |
| 120 | if update: |
| 121 | port.update(observed) |
| 122 | return observed |
Kevin Benton | a305d59 | 2016-09-19 04:26:10 -0700 | [diff] [blame] | 123 | |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 124 | def _show_trunk(self, trunk, update=False): |
| 125 | observed = self.client.show_trunk(trunk['id'])['trunk'] |
| 126 | if update: |
| 127 | trunk.update(observed) |
| 128 | return observed |
Kevin Benton | a305d59 | 2016-09-19 04:26:10 -0700 | [diff] [blame] | 129 | |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 130 | def _is_trunk_status(self, trunk, status, update=False): |
| 131 | return self._show_trunk(trunk, update)['status'] == status |
Kevin Benton | a305d59 | 2016-09-19 04:26:10 -0700 | [diff] [blame] | 132 | |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 133 | def _is_port_status(self, port, status, update=False): |
| 134 | return self._show_port(port, update)['status'] == status |
| 135 | |
| 136 | def _wait_for_port(self, port, status=constants.ACTIVE): |
| 137 | utils.wait_until_true( |
| 138 | lambda: self._is_port_status(port, status), |
| 139 | exception=RuntimeError( |
| 140 | "Timed out waiting for port {!r} to transition to get " |
| 141 | "status {!r}.".format(port['id'], status))) |
| 142 | |
| 143 | def _wait_for_trunk(self, trunk, status=constants.ACTIVE): |
| 144 | utils.wait_until_true( |
| 145 | lambda: self._is_trunk_status(trunk, status), |
| 146 | exception=RuntimeError( |
| 147 | "Timed out waiting for trunk {!r} to transition to get " |
| 148 | "status {!r}.".format(trunk['id'], status))) |
| 149 | |
| 150 | def _create_ssh_client(self, floating_ip, use_advanced_image=False): |
Huifeng Le | 1c9f40b | 2018-11-07 01:14:21 +0800 | [diff] [blame] | 151 | if use_advanced_image: |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 152 | username = CONF.neutron_plugin_options.advanced_image_ssh_user |
| 153 | else: |
| 154 | username = CONF.validation.image_ssh_user |
| 155 | return ssh.Client(host=floating_ip['floating_ip_address'], |
| 156 | username=username, |
| 157 | pkey=self.keypair['private_key']) |
Huifeng Le | 1c9f40b | 2018-11-07 01:14:21 +0800 | [diff] [blame] | 158 | |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 159 | def _assert_has_ssh_connectivity(self, ssh_client): |
| 160 | ssh_client.exec_command("true") |
Huifeng Le | 1c9f40b | 2018-11-07 01:14:21 +0800 | [diff] [blame] | 161 | |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 162 | def _configure_vlan_subport(self, vm, vlan_tag, vlan_subnet): |
| 163 | self.wait_for_server_active(server=vm.server) |
| 164 | self._wait_for_trunk(trunk=vm.trunk) |
| 165 | self._wait_for_port(port=vm.port) |
| 166 | self._wait_for_port(port=vm.subport) |
Huifeng Le | 1c9f40b | 2018-11-07 01:14:21 +0800 | [diff] [blame] | 167 | |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 168 | ip_command = ip.IPCommand(ssh_client=vm.ssh_client) |
| 169 | for address in ip_command.list_addresses(port=vm.port): |
| 170 | port_iface = address.device.name |
| 171 | break |
| 172 | else: |
| 173 | self.fail("Parent port fixed IP not found on server.") |
Jakub Libosvar | 6d397d3 | 2016-12-30 10:57:52 -0500 | [diff] [blame] | 174 | |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 175 | subport_iface = ip_command.configure_vlan_subport( |
| 176 | port=vm.port, subport=vm.subport, vlan_tag=vlan_tag, |
| 177 | subnets=[vlan_subnet]) |
| 178 | for address in ip_command.list_addresses(port=vm.subport): |
| 179 | self.assertEqual(subport_iface, address.device.name) |
| 180 | self.assertEqual(port_iface, address.device.parent) |
| 181 | break |
| 182 | else: |
| 183 | self.fail("Sub-port fixed IP not found on server.") |
Jakub Libosvar | 6d397d3 | 2016-12-30 10:57:52 -0500 | [diff] [blame] | 184 | |
Sławek Kapłoński | c0caa2e | 2017-02-25 10:11:32 +0000 | [diff] [blame] | 185 | @decorators.idempotent_id('bb13fe28-f152-4000-8131-37890a40c79e') |
Kevin Benton | a305d59 | 2016-09-19 04:26:10 -0700 | [diff] [blame] | 186 | def test_trunk_subport_lifecycle(self): |
| 187 | """Test trunk creation and subport transition to ACTIVE status. |
| 188 | |
| 189 | This is a basic test for the trunk extension to ensure that we |
| 190 | can create a trunk, attach it to a server, add/remove subports, |
| 191 | while ensuring the status transitions as appropriate. |
| 192 | |
| 193 | This test does not assert any dataplane behavior for the subports. |
| 194 | It's just a high-level check to ensure the agents claim to have |
| 195 | wired the port correctly and that the trunk port itself maintains |
| 196 | connectivity. |
| 197 | """ |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 198 | vm1 = self._create_server_with_trunk_port() |
| 199 | vm2 = self._create_server_with_trunk_port() |
| 200 | for vm in (vm1, vm2): |
| 201 | self.wait_for_server_active(server=vm.server) |
| 202 | self._wait_for_trunk(vm.trunk) |
| 203 | self._assert_has_ssh_connectivity(vm.ssh_client) |
| 204 | |
Kevin Benton | a305d59 | 2016-09-19 04:26:10 -0700 | [diff] [blame] | 205 | # create a few more networks and ports for subports |
Yariv Rachmani | fed6f86 | 2017-12-19 11:55:25 +0200 | [diff] [blame] | 206 | # check limit of networks per project |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 207 | segment_ids = range( |
| 208 | 3, 3 + CONF.neutron_plugin_options.max_networks_per_project) |
| 209 | tagged_networks = [self.create_network() for _ in segment_ids] |
| 210 | tagged_ports = [self.create_port(network=network) |
| 211 | for network in tagged_networks] |
| 212 | subports = [{'port_id': tagged_ports[i]['id'], |
| 213 | 'segmentation_type': 'vlan', |
| 214 | 'segmentation_id': segment_id} |
| 215 | for i, segment_id in enumerate(segment_ids)] |
Jakub Libosvar | 6d397d3 | 2016-12-30 10:57:52 -0500 | [diff] [blame] | 216 | |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 217 | # add all subports to server1 |
| 218 | self.client.add_subports(vm1.trunk['id'], subports) |
| 219 | self._wait_for_trunk(vm1.trunk) |
| 220 | for port in tagged_ports: |
| 221 | self._wait_for_port(port) |
| 222 | |
| 223 | # ensure main data-plane wasn't interrupted |
| 224 | self._assert_has_ssh_connectivity(vm1.ssh_client) |
| 225 | |
| 226 | # move subports over to other server |
| 227 | self.client.remove_subports(vm1.trunk['id'], subports) |
| 228 | # ensure all subports go down |
| 229 | for port in tagged_ports: |
| 230 | self._wait_for_port(port, status=constants.DOWN) |
| 231 | |
| 232 | self.client.add_subports(vm2.trunk['id'], subports) |
| 233 | |
| 234 | # wait for both trunks to go back to ACTIVE |
| 235 | for vm in [vm1, vm2]: |
| 236 | self._wait_for_trunk(vm.trunk) |
| 237 | |
| 238 | # ensure subports come up on other trunk |
| 239 | for port in tagged_ports: |
| 240 | self._wait_for_port(port) |
| 241 | |
| 242 | # final connectivity check |
| 243 | for vm in [vm1, vm2]: |
| 244 | self._wait_for_trunk(vm.trunk) |
| 245 | self._assert_has_ssh_connectivity(vm1.ssh_client) |
| 246 | |
Yariv Rachmani | fa1081a | 2018-11-21 12:46:57 +0200 | [diff] [blame] | 247 | @testtools.skipUnless( |
| 248 | (CONF.neutron_plugin_options.advanced_image_ref or |
| 249 | CONF.neutron_plugin_options.default_image_is_advanced), |
| 250 | "Advanced image is required to run this test.") |
Sławek Kapłoński | c0caa2e | 2017-02-25 10:11:32 +0000 | [diff] [blame] | 251 | @decorators.idempotent_id('a8a02c9b-b453-49b5-89a2-cce7da66aafb') |
Jakub Libosvar | 6d397d3 | 2016-12-30 10:57:52 -0500 | [diff] [blame] | 252 | def test_subport_connectivity(self): |
| 253 | vlan_tag = 10 |
Jakub Libosvar | 6d397d3 | 2016-12-30 10:57:52 -0500 | [diff] [blame] | 254 | vlan_network = self.create_network() |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 255 | vlan_subnet = self.create_subnet(network=vlan_network, gateway=None) |
Jakub Libosvar | 6d397d3 | 2016-12-30 10:57:52 -0500 | [diff] [blame] | 256 | |
Yariv Rachmani | fa1081a | 2018-11-21 12:46:57 +0200 | [diff] [blame] | 257 | use_advanced_image = ( |
| 258 | not CONF.neutron_plugin_options.default_image_is_advanced) |
| 259 | |
| 260 | vm1 = self._create_server_with_trunk_port( |
| 261 | subport_network=vlan_network, |
| 262 | segmentation_id=vlan_tag, |
| 263 | use_advanced_image=use_advanced_image) |
| 264 | vm2 = self._create_server_with_trunk_port( |
| 265 | subport_network=vlan_network, |
| 266 | segmentation_id=vlan_tag, |
| 267 | use_advanced_image=use_advanced_image) |
Jakub Libosvar | 6d397d3 | 2016-12-30 10:57:52 -0500 | [diff] [blame] | 268 | |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 269 | for vm in [vm1, vm2]: |
| 270 | self._configure_vlan_subport(vm=vm, |
| 271 | vlan_tag=vlan_tag, |
| 272 | vlan_subnet=vlan_subnet) |
Jakub Libosvar | 6d397d3 | 2016-12-30 10:57:52 -0500 | [diff] [blame] | 273 | |
Kevin Benton | 6f1f9d5 | 2017-03-01 09:14:45 -0800 | [diff] [blame] | 274 | # Ping from server1 to server2 via VLAN interface should fail because |
| 275 | # we haven't allowed ICMP |
| 276 | self.check_remote_connectivity( |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 277 | vm1.ssh_client, |
| 278 | vm2.subport['fixed_ips'][0]['ip_address'], |
| 279 | should_succeed=False) |
| 280 | |
| 281 | # allow intra-security-group traffic |
| 282 | self.create_pingable_secgroup_rule(self.security_group['id']) |
Kevin Benton | 6f1f9d5 | 2017-03-01 09:14:45 -0800 | [diff] [blame] | 283 | self.check_remote_connectivity( |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 284 | vm1.ssh_client, |
| 285 | vm2.subport['fixed_ips'][0]['ip_address']) |
Huifeng Le | 1c9f40b | 2018-11-07 01:14:21 +0800 | [diff] [blame] | 286 | |
| 287 | @testtools.skipUnless( |
Yariv Rachmani | fa1081a | 2018-11-21 12:46:57 +0200 | [diff] [blame] | 288 | (CONF.neutron_plugin_options.advanced_image_ref or |
| 289 | CONF.neutron_plugin_options.default_image_is_advanced), |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 290 | "Advanced image is required to run this test.") |
Huifeng Le | 1c9f40b | 2018-11-07 01:14:21 +0800 | [diff] [blame] | 291 | @testtools.skipUnless( |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 292 | CONF.neutron_plugin_options.q_agent == "linuxbridge", |
| 293 | "Linux bridge agent is required to run this test.") |
Huifeng Le | 1c9f40b | 2018-11-07 01:14:21 +0800 | [diff] [blame] | 294 | @decorators.idempotent_id('d61cbdf6-1896-491c-b4b4-871caf7fbffe') |
| 295 | def test_parent_port_connectivity_after_trunk_deleted_lb(self): |
| 296 | vlan_tag = 10 |
Huifeng Le | 1c9f40b | 2018-11-07 01:14:21 +0800 | [diff] [blame] | 297 | vlan_network = self.create_network() |
| 298 | vlan_subnet = self.create_subnet(vlan_network) |
| 299 | self.create_router_interface(self.router['id'], vlan_subnet['id']) |
| 300 | |
Yariv Rachmani | fa1081a | 2018-11-21 12:46:57 +0200 | [diff] [blame] | 301 | use_advanced_image = ( |
| 302 | not CONF.neutron_plugin_options.default_image_is_advanced) |
| 303 | |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 304 | # Create servers |
| 305 | trunk_network_server = self._create_server_with_trunk_port( |
| 306 | subport_network=vlan_network, |
| 307 | segmentation_id=vlan_tag, |
Yariv Rachmani | fa1081a | 2018-11-21 12:46:57 +0200 | [diff] [blame] | 308 | use_advanced_image=use_advanced_image) |
Huifeng Le | 1c9f40b | 2018-11-07 01:14:21 +0800 | [diff] [blame] | 309 | normal_network_server = self._create_server_with_network(self.network) |
| 310 | vlan_network_server = self._create_server_with_network(vlan_network) |
| 311 | |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 312 | self._configure_vlan_subport(vm=trunk_network_server, |
| 313 | vlan_tag=vlan_tag, |
| 314 | vlan_subnet=vlan_subnet) |
| 315 | for vm in [normal_network_server, vlan_network_server]: |
| 316 | self.wait_for_server_active(vm.server) |
Huifeng Le | 1c9f40b | 2018-11-07 01:14:21 +0800 | [diff] [blame] | 317 | |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 318 | # allow ICMP traffic |
| 319 | self.create_pingable_secgroup_rule(self.security_group['id']) |
Huifeng Le | 1c9f40b | 2018-11-07 01:14:21 +0800 | [diff] [blame] | 320 | |
| 321 | # Ping from trunk_network_server to normal_network_server |
| 322 | # via parent port |
| 323 | self.check_remote_connectivity( |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 324 | trunk_network_server.ssh_client, |
| 325 | normal_network_server.port['fixed_ips'][0]['ip_address'], |
| 326 | should_succeed=True) |
Huifeng Le | 1c9f40b | 2018-11-07 01:14:21 +0800 | [diff] [blame] | 327 | |
| 328 | # Ping from trunk_network_server to vlan_network_server via VLAN |
| 329 | # interface should success |
| 330 | self.check_remote_connectivity( |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 331 | trunk_network_server.ssh_client, |
| 332 | vlan_network_server.port['fixed_ips'][0]['ip_address'], |
| 333 | should_succeed=True) |
Huifeng Le | 1c9f40b | 2018-11-07 01:14:21 +0800 | [diff] [blame] | 334 | |
| 335 | # Delete the trunk |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 336 | self.delete_trunk( |
| 337 | trunk_network_server.trunk, |
Huifeng Le | 1c9f40b | 2018-11-07 01:14:21 +0800 | [diff] [blame] | 338 | detach_parent_port=False) |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 339 | LOG.debug("Trunk %s is deleted.", |
| 340 | trunk_network_server.trunk['id']) |
Huifeng Le | 1c9f40b | 2018-11-07 01:14:21 +0800 | [diff] [blame] | 341 | |
| 342 | # Ping from trunk_network_server to normal_network_server |
| 343 | # via parent port success after trunk deleted |
| 344 | self.check_remote_connectivity( |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 345 | trunk_network_server.ssh_client, |
| 346 | normal_network_server.port['fixed_ips'][0]['ip_address'], |
| 347 | should_succeed=True) |
Huifeng Le | 1c9f40b | 2018-11-07 01:14:21 +0800 | [diff] [blame] | 348 | |
| 349 | # Ping from trunk_network_server to vlan_network_server via VLAN |
| 350 | # interface should fail after trunk deleted |
| 351 | self.check_remote_connectivity( |
Federico Ressi | 06ef854 | 2018-10-25 15:23:52 +0200 | [diff] [blame] | 352 | trunk_network_server.ssh_client, |
| 353 | vlan_network_server.port['fixed_ips'][0]['ip_address'], |
| 354 | should_succeed=False) |