diff options
| author | songyanchao <[email protected]> | 2024-01-08 03:36:10 +0000 |
|---|---|---|
| committer | songyanchao <[email protected]> | 2024-01-08 03:36:10 +0000 |
| commit | 144397383716bff8039adaabb1bd1c8acbe88e08 (patch) | |
| tree | b0b33daea23ec5694efda19609c59a506de90028 /test | |
| parent | 4117c15c1dfb8be49ca8176facbf3a34c818d916 (diff) | |
🧪 test(TSG-17959): Add traffic_link_id test case for Tera test.
Add traffic_link_id test case for Tera test.
Diffstat (limited to 'test')
| -rw-r--r-- | test/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | test/msgpack_test.py | 4 | ||||
| -rw-r--r-- | test/tera_test.py | 104 |
3 files changed, 95 insertions, 15 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 15cb8f1..6f19a83 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -115,5 +115,5 @@ add_test( NAME tera_test COMMAND /usr/local/bin/ptf --test-dir ${CMAKE_SOURCE_DIR}/test --interface 0@veth0-ptf0 --interface 1@veth1-ptf1 - tera_base_test --test-params "source_dir='${CMAKE_SOURCE_DIR}'" + tera_base_test tera_mpack_test tera_nf_test --test-params "source_dir='${CMAKE_SOURCE_DIR}'" ) diff --git a/test/msgpack_test.py b/test/msgpack_test.py index adea563..87b5b67 100644 --- a/test/msgpack_test.py +++ b/test/msgpack_test.py @@ -128,7 +128,7 @@ class MpackSerializeTest(BaseTest): # Verify verify_data = {'port': 0, 'packet_type': 0, 'ol_flags': 0, 'data_len': 100, 'pkt_len': 100, 'dir': 0, 'packet_create_from_nf': 0, - 'is_ctrlbuf': 0, 'adapter_type': 1, 'adapter_id': 0, 'payload_offset': 0, 'user_0': 0, 'ef_link_id': 0, 'traffic_link_id': 255, + 'is_ctrlbuf': 0, 'adapter_type': 1, 'adapter_id': 0, 'payload_offset': 0, 'user_0': 0, 'ef_link_id': 0, 'traffic_link_id': 65535, 'ef_peer_index': 0, 'port_ingress': 0, 'port_egress': 2, 'session_id': 0, 'cur_sid': 1000, 'sids': [0, 0, 0, 0, 0, 1000, 300, 0], 'head': 7, 'tail': 6, 'capacity': 7, 'packet':send_pkt.__bytes__()} @@ -258,7 +258,7 @@ class MpackDeserializeTest(BaseTest): verify_pkt = simple_udp_packet(ip_src="172.17.1.100", ip_dst="172.17.2.200",udp_payload="hello world") send_data = {'port': 0, 'packet_type': 0, 'ol_flags': 0, 'data_len': 100, 'pkt_len': 100, 'dir': 0, 'packet_create_from_nf': 0, - 'is_ctrlbuf': 0, 'adapter_type': 1, 'adapter_id': 0, 'payload_offset': 0, 'user_0': 0, 'ef_link_id': 0, 'traffic_link_id': 255, + 'is_ctrlbuf': 0, 'adapter_type': 1, 'adapter_id': 0, 'payload_offset': 0, 'user_0': 0, 'ef_link_id': 0, 'traffic_link_id': 65535, 'ef_peer_index': 0, 'port_ingress': 0, 'port_egress': 2, 'session_id': 0, 'cur_sid': 1000, 'sids': [0, 0, 0, 0, 0, 1000, 300, 0], 'head': 7, 'tail': 6, 'capacity': 7, 'packet':verify_pkt.__bytes__()} diff --git a/test/tera_test.py b/test/tera_test.py index e0d57e4..942b7d2 100644 --- a/test/tera_test.py +++ b/test/tera_test.py @@ -715,6 +715,86 @@ action=nf_steering priority=1 category=0 sid=1000 + +[link_db:0] +type=2 +traffic_link_id=1000 +tera_id=0 + +[link_db:1] +type=2 +traffic_link_id=1001 +tera_id=1 + +[link_db:2] +type=2 +traffic_link_id=1002 +tera_id=2 + +[link_db:3] +type=2 +traffic_link_id=1003 +tera_id=3 + +[link_db:4] +type=2 +traffic_link_id=1004 +tera_id=4 + +[link_db:5] +type=2 +traffic_link_id=1005 +tera_id=5 + +[link_db:6] +type=2 +traffic_link_id=1006 +tera_id=6 + +[link_db:7] +type=2 +traffic_link_id=1007 +tera_id=7 + +[link_db:8] +type=2 +traffic_link_id=1008 +tera_id=8 + +[link_db:9] +type=2 +traffic_link_id=1009 +tera_id=9 + +[link_db:10] +type=2 +traffic_link_id=1010 +tera_id=10 + +[link_db:11] +type=2 +traffic_link_id=1011 +tera_id=11 + +[link_db:12] +type=2 +traffic_link_id=1012 +tera_id=12 + +[link_db:13] +type=2 +traffic_link_id=1013 +tera_id=13 + +[link_db:14] +type=2 +traffic_link_id=1014 +tera_id=14 + +[link_db:15] +type=2 +traffic_link_id=1015 +tera_id=15 """ """ +------------+ +------------------------------------------+ +------------+ @@ -723,8 +803,8 @@ sid=1000 | veth0-ptf0 | ---> | veth0 | ---> | veth1 (serialize) | ---> | veth1-ptf1 | +------------+ +------------+ +--------------------+ +------------+ """ -@group("tera_msgpack_test") -class IPv4TestForIToE(BaseTest): +@group("tera_mpack_test") +class IPv4MpackTestForIToE(BaseTest): def setUp(self): self.dataplane = ptf.dataplane_instance @@ -745,7 +825,7 @@ class IPv4TestForIToE(BaseTest): mac_flapping_pkt = simple_udp_packet(eth_dst="02:5A:B0:BE:49:52",eth_src="02:5A:B0:BE:49:51",vlan_vid=111+i*2, dl_vlan_enable=True,udp_payload="tera test") msgpack_data = {'port': 0, 'packet_type': 0, 'ol_flags': 1, 'data_len': 100, 'pkt_len': 100, 'dir': 0, 'packet_create_from_nf': 0, 'is_ctrlbuf': 0, 'adapter_type': 2, 'adapter_id': i, 'payload_offset': 0, 'user_0': 0, 'ef_link_id': 0, - 'traffic_link_id': 255, 'ef_peer_index': 0, 'port_ingress': 0, 'port_egress': 1, 'session_id': 0, 'cur_sid': 1000, + 'traffic_link_id': 1000 + i, 'ef_peer_index': 0, 'port_ingress': 0, 'port_egress': 1, 'session_id': 0, 'cur_sid': 1000, 'sids': [0, 0, 0, 0, 0, 1000, 500+i, 0], 'head': 7, 'tail': 6, 'capacity': 7, 'packet': mac_flapping_pkt.__bytes__()} binary_data = msgpack.dumps(msgpack_data) @@ -759,8 +839,8 @@ class IPv4TestForIToE(BaseTest): finally: mrzcpd.stop() -@group("tera_msgpack_test") -class IPv4TestForEToI(BaseTest): +@group("tera_mpack_test") +class IPv4MpackTestForEToI(BaseTest): def setUp(self): self.dataplane = ptf.dataplane_instance @@ -781,7 +861,7 @@ class IPv4TestForEToI(BaseTest): mac_flapping_pkt = simple_udp_packet(eth_dst="02:5A:B0:BE:49:52",eth_src="02:5A:B0:BE:49:51",vlan_vid=110+i*2, dl_vlan_enable=True,udp_payload="tera test") msgpack_data = {'port': 0, 'packet_type': 0, 'ol_flags': 1, 'data_len': 100, 'pkt_len': 100, 'dir': 1, 'packet_create_from_nf': 0, 'is_ctrlbuf': 0, 'adapter_type': 2, 'adapter_id': i, 'payload_offset': 0, 'user_0': 0, 'ef_link_id': 0, - 'traffic_link_id': 255, 'ef_peer_index': 0, 'port_ingress': 0, 'port_egress': 1, 'session_id': 0, 'cur_sid': 1000, + 'traffic_link_id': 1000 + i, 'ef_peer_index': 0, 'port_ingress': 0, 'port_egress': 1, 'session_id': 0, 'cur_sid': 1000, 'sids': [0, 0, 0, 0, 0, 1000, 500+i, 0], 'head': 7, 'tail': 6, 'capacity': 7, 'packet': mac_flapping_pkt.__bytes__()} binary_data = msgpack.dumps(msgpack_data) @@ -795,8 +875,8 @@ class IPv4TestForEToI(BaseTest): finally: mrzcpd.stop() -@group("tera_msgpack_test") -class IPv6TestForIToE(BaseTest): +@group("tera_mpack_test") +class IPv6MpackTestForIToE(BaseTest): def setUp(self): self.dataplane = ptf.dataplane_instance @@ -817,7 +897,7 @@ class IPv6TestForIToE(BaseTest): mac_flapping_pkt = simple_udpv6_packet(eth_dst="02:5A:B0:BE:49:52",eth_src="02:5A:B0:BE:49:51",vlan_vid=111+i*2, dl_vlan_enable=True,udp_payload="tera test") msgpack_data = {'port': 0, 'packet_type': 0, 'ol_flags': 1, 'data_len': 100, 'pkt_len': 100, 'dir': 0, 'packet_create_from_nf': 0, 'is_ctrlbuf': 0, 'adapter_type': 2, 'adapter_id': i, 'payload_offset': 0, 'user_0': 0, 'ef_link_id': 0, - 'traffic_link_id': 255, 'ef_peer_index': 0, 'port_ingress': 0, 'port_egress': 1, 'session_id': 0, 'cur_sid': 1000, + 'traffic_link_id': 1000 + i, 'ef_peer_index': 0, 'port_ingress': 0, 'port_egress': 1, 'session_id': 0, 'cur_sid': 1000, 'sids': [0, 0, 0, 0, 0, 1000, 500+i, 0], 'head': 7, 'tail': 6, 'capacity': 7, 'packet': mac_flapping_pkt.__bytes__()} binary_data = msgpack.dumps(msgpack_data) @@ -831,8 +911,8 @@ class IPv6TestForIToE(BaseTest): finally: mrzcpd.stop() -@group("tera_msgpack_test") -class IPv6TestForEToI(BaseTest): +@group("tera_mpack_test") +class IPv6MpackTestForEToI(BaseTest): def setUp(self): self.dataplane = ptf.dataplane_instance @@ -853,7 +933,7 @@ class IPv6TestForEToI(BaseTest): mac_flapping_pkt = simple_udpv6_packet(eth_dst="02:5A:B0:BE:49:52",eth_src="02:5A:B0:BE:49:51",vlan_vid=110+i*2, dl_vlan_enable=True,udp_payload="tera test") msgpack_data = {'port': 0, 'packet_type': 0, 'ol_flags': 1, 'data_len': 100, 'pkt_len': 100, 'dir': 1, 'packet_create_from_nf': 0, 'is_ctrlbuf': 0, 'adapter_type': 2, 'adapter_id': i, 'payload_offset': 0, 'user_0': 0, 'ef_link_id': 0, - 'traffic_link_id': 255, 'ef_peer_index': 0, 'port_ingress': 0, 'port_egress': 1, 'session_id': 0, 'cur_sid': 1000, + 'traffic_link_id': 1000 + i, 'ef_peer_index': 0, 'port_ingress': 0, 'port_egress': 1, 'session_id': 0, 'cur_sid': 1000, 'sids': [0, 0, 0, 0, 0, 1000, 500+i, 0], 'head': 7, 'tail': 6, 'capacity': 7, 'packet': mac_flapping_pkt.__bytes__()} binary_data = msgpack.dumps(msgpack_data) |
