16
16
import os
17
17
import time
18
18
19
- import netaddr
20
19
from neutron_lib import constants
21
20
from neutronclient .common import exceptions
22
21
from oslo_utils import uuidutils
@@ -323,18 +322,6 @@ def setUp(self):
323
322
host_descriptions )
324
323
super (TestLegacyL3Agent , self ).setUp (env )
325
324
326
- def test_namespace_exists (self ):
327
- tenant_id = uuidutils .generate_uuid ()
328
-
329
- router = self .safe_client .create_router (tenant_id )
330
- network = self .safe_client .create_network (tenant_id )
331
- subnet = self .safe_client .create_subnet (
332
- tenant_id , network ['id' ], '20.0.0.0/24' , gateway_ip = '20.0.0.1' )
333
- self .safe_client .add_router_interface (router ['id' ], subnet ['id' ])
334
-
335
- namespace = self ._get_namespace (router ['id' ])
336
- self .assert_namespace_exists (namespace )
337
-
338
325
def test_mtu_update (self ):
339
326
tenant_id = uuidutils .generate_uuid ()
340
327
@@ -361,92 +348,6 @@ def test_mtu_update(self):
361
348
network = self .safe_client .update_network (network ['id' ], mtu = mtu )
362
349
common_utils .wait_until_true (lambda : ri_dev .link .mtu == mtu )
363
350
364
- def test_east_west_traffic (self ):
365
- tenant_id = uuidutils .generate_uuid ()
366
- router = self .safe_client .create_router (tenant_id )
367
-
368
- vm1 = self ._create_net_subnet_and_vm (
369
- tenant_id , ['20.0.0.0/24' , '2001:db8:aaaa::/64' ],
370
- self .environment .hosts [0 ], router )
371
- vm2 = self ._create_net_subnet_and_vm (
372
- tenant_id , ['21.0.0.0/24' , '2001:db8:bbbb::/64' ],
373
- self .environment .hosts [1 ], router )
374
-
375
- vm1 .block_until_ping (vm2 .ip )
376
- # Verify ping6 from vm2 to vm1 IPv6 Address
377
- vm2 .block_until_ping (vm1 .ipv6 )
378
-
379
- def test_north_south_traffic (self ):
380
- # This function creates an external network which is connected to
381
- # central_bridge and spawns an external_vm on it.
382
- # The external_vm is configured with the gateway_ip (both v4 & v6
383
- # addresses) of external subnet. Later, it creates a tenant router,
384
- # a tenant network and two tenant subnets (v4 and v6). The tenant
385
- # router is associated with tenant network and external network to
386
- # provide north-south connectivity to the VMs.
387
- # We validate the following in this testcase.
388
- # 1. SNAT support: using ping from tenant VM to external_vm
389
- # 2. Floating IP support: using ping from external_vm to VM floating ip
390
- # 3. IPv6 ext connectivity: using ping6 from tenant vm to external_vm.
391
- tenant_id = uuidutils .generate_uuid ()
392
- ext_net , ext_sub = self ._create_external_network_and_subnet (tenant_id )
393
- external_vm = self ._create_external_vm (ext_net , ext_sub )
394
- # Create an IPv6 subnet in the external network
395
- v6network = self .useFixture (
396
- ip_network .ExclusiveIPNetwork (
397
- "2001:db8:1234::1" , "2001:db8:1234::10" , "64" )).network
398
- # NOTE(ykarel): gateway_ip is explicitly added as iputils package
399
- # requires fix for https://github.com/iputils/iputils/issues/371
400
- # is not available in CentOS 9-Stream
401
- ext_v6sub = self .safe_client .create_subnet (
402
- tenant_id , ext_net ['id' ], v6network , gateway_ip = '2001:db8:1234::1' )
403
-
404
- router = self .safe_client .create_router (tenant_id ,
405
- external_network = ext_net ['id' ])
406
-
407
- # Configure the gateway_ip of external v6subnet on the external_vm.
408
- external_vm .ipv6_cidr = common_utils .ip_to_cidr (
409
- ext_v6sub ['gateway_ip' ], 64 )
410
-
411
- # Configure an IPv6 downstream route to the v6Address of router gw port
412
- for fixed_ip in router ['external_gateway_info' ]['external_fixed_ips' ]:
413
- if netaddr .IPNetwork (fixed_ip ['ip_address' ]).version == 6 :
414
- external_vm .set_default_gateway (fixed_ip ['ip_address' ])
415
-
416
- vm = self ._create_net_subnet_and_vm (
417
- tenant_id , ['20.0.0.0/24' , '2001:db8:aaaa::/64' ],
418
- self .environment .hosts [1 ], router )
419
-
420
- # ping external vm to test snat
421
- vm .block_until_ping (external_vm .ip )
422
-
423
- fip = self .safe_client .create_floatingip (
424
- tenant_id , ext_net ['id' ], vm .ip , vm .neutron_port ['id' ])
425
-
426
- # ping floating ip from external vm
427
- external_vm .block_until_ping (fip ['floating_ip_address' ])
428
-
429
- # Verify VM is able to reach the router interface.
430
- vm .block_until_ping (vm .gateway_ipv6 )
431
- # Verify north-south connectivity using ping6 to external_vm.
432
- vm .block_until_ping (external_vm .ipv6 )
433
-
434
- # Now let's remove and create again phys bridge and check connectivity
435
- # once again
436
- br_phys = self .environment .hosts [0 ].br_phys
437
- br_phys .destroy ()
438
- br_phys .create ()
439
- self .environment .hosts [0 ].connect_to_central_network_via_vlans (
440
- br_phys )
441
-
442
- # ping floating ip from external vm
443
- external_vm .block_until_ping (fip ['floating_ip_address' ])
444
-
445
- # Verify VM is able to reach the router interface.
446
- vm .block_until_ping (vm .gateway_ipv6 )
447
- # Verify north-south connectivity using ping6 to external_vm.
448
- vm .block_until_ping (external_vm .ipv6 )
449
-
450
351
def test_gateway_ip_changed (self ):
451
352
self ._test_gateway_ip_changed ()
452
353
0 commit comments