|
| 1 | +from common.vrouter.base import BaseVrouterTest |
| 2 | +from tcutils.wrappers import preposttest_wrapper |
| 3 | +import test |
| 4 | +from tcutils.util import get_random_name, is_v6 |
| 5 | +import random |
| 6 | +from common.neutron.lbaasv2.base import BaseLBaaSTest |
| 7 | +from common.servicechain.config import ConfigSvcChain |
| 8 | +from common.servicechain.verify import VerifySvcChain |
| 9 | + |
| 10 | +AF_TEST = 'v6' |
| 11 | + |
| 12 | +class FatFlowAggrSerial(BaseVrouterTest, BaseLBaaSTest): |
| 13 | + |
| 14 | + @classmethod |
| 15 | + def setUpClass(cls): |
| 16 | + super(FatFlowAggrSerial, cls).setUpClass() |
| 17 | + |
| 18 | + @classmethod |
| 19 | + def tearDownClass(cls): |
| 20 | + super(FatFlowAggrSerial, cls).tearDownClass() |
| 21 | + |
| 22 | + @test.attr(type=['dev_reg']) |
| 23 | + @preposttest_wrapper |
| 24 | + def test_fat_flow_aggr_dest_udp_inter_vn_inter_node(self): |
| 25 | + """: |
| 26 | + Description: Verify fat flow prefix aggr dest (IPv4) for intra-vn inter-node |
| 27 | + Steps: |
| 28 | + 1. Create 2 VNs and launch 3 VMs.2 client VMs in VN1 on same node |
| 29 | + and server VM in VN2 on different node. |
| 30 | + Client 1 in subnet 1, Client 2 in the next subnet. |
| 31 | + Policy p1 configured to allow udp traffic between VN1 and VN2. |
| 32 | + 2. On server VM, config fat flow aggr prefix dest len 29 for UDP port 55. |
| 33 | + 3. From both the client VMs, send ICMP traffic to the server VM twice with diff. src ports |
| 34 | + Pass criteria: |
| 35 | + 1. On the remote CN, expect 2 pairs ( 1 for client 1, 1 for client 2) |
| 36 | + of fat flows with prefix aggregated for the src IPs |
| 37 | + (VM to fabric, Prefix Aggr Dest: Aggregation happens for SRC IPs) |
| 38 | + 2. On client VM compute nodes, expect 4 pairs of flows and on server compute, |
| 39 | + expect 2 pairs of flows |
| 40 | + 3. On server compute node, flow's source port should be 0 for fat flows |
| 41 | +
|
| 42 | + |
| 43 | +
|
| 44 | + """ |
| 45 | + prefix_length = 29 |
| 46 | + ipv6 = False |
| 47 | + only_v6 = False |
| 48 | + if self.inputs.get_af() == 'dual': |
| 49 | + ipv6 = True |
| 50 | + only_v6 = True |
| 51 | + prefix_length6 = 125 |
| 52 | + inter_node = True |
| 53 | + inter_vn = True |
| 54 | + proto = 'udp' |
| 55 | + port = 55 |
| 56 | + policy_deny = False |
| 57 | + vn_policy = True |
| 58 | + self.fat_flow_with_prefix_aggr(prefix_length=prefix_length, |
| 59 | + inter_node=inter_node,inter_vn=inter_vn, proto=proto, |
| 60 | + port=port, vn_policy=vn_policy, policy_deny=policy_deny, |
| 61 | + dual=ipv6, prefix_length6=prefix_length6, only_v6=only_v6) |
| 62 | + return True |
| 63 | + |
| 64 | +class FatFlowAggrIpv6Serial(FatFlowAggrSerial): |
| 65 | + @classmethod |
| 66 | + def setUpClass(cls): |
| 67 | + super(FatFlowAggrSerial, cls).setUpClass() |
| 68 | + cls.inputs.set_af(AF_TEST) |
| 69 | + |
| 70 | + @test.attr(type=['sanity','dev_reg']) |
| 71 | + @preposttest_wrapper |
| 72 | + def test_fat_flow_aggr_dest_udp_inter_vn_inter_node(self): |
| 73 | + """ |
| 74 | + Description: Verify fat flow prefix aggr dest (IPv6) for intra-vn inter-node |
| 75 | + Steps: |
| 76 | + 1. Create 2 VNs with IPv6 subnets and launch 3 VMs.2 client VMs in VN1 on same node |
| 77 | + and server VM in VN2 on different node. |
| 78 | + Client 1 in subnet 1, Client 2 in the next subnet. |
| 79 | + Policy p1 configured to allow udp traffic between VN1 and VN2. |
| 80 | + 2. On server VM, config fat flow aggr prefix dest IPv6 len 125 for UDP port 55. |
| 81 | + 3. From both the client VMs, send ICMP6 traffic to the server VM twice with diff. src ports |
| 82 | + Pass criteria: |
| 83 | + 1. On the remote CN, expect 2 pairs ( 1 for client 1, 1 for client 2) |
| 84 | + of IPv6 fat flows with prefix aggregated for the src IPs |
| 85 | + (VM to fabric, Prefix Aggr Dest: Aggregation happens for SRC IPs) |
| 86 | + 2. On client VM compute nodes, expect 4 pairs of IPv6 flows and on server compute, |
| 87 | + expect 2 pairs of IPv6 flows |
| 88 | + 3. On server compute node, flow's source port should be 0 for fat flows |
| 89 | +
|
| 90 | + |
| 91 | +
|
| 92 | + """ |
| 93 | + self.inputs.set_af('dual') |
| 94 | + super(FatFlowAggrIpv6Serial, self).test_fat_flow_aggr_dest_udp_inter_vn_inter_node() |
| 95 | + |
0 commit comments