diff --git a/tests/cts/multidevices/apfv6_test.py b/tests/cts/multidevices/apfv6_test.py index b82a3be573..fb45f4a36f 100644 --- a/tests/cts/multidevices/apfv6_test.py +++ b/tests/cts/multidevices/apfv6_test.py @@ -14,6 +14,7 @@ from mobly import asserts from scapy.layers.inet import IP, ICMP, IPOption_Router_Alert +from scapy.layers.inet6 import IPv6, ICMPv6EchoRequest, ICMPv6EchoReply from scapy.layers.l2 import Ether from scapy.contrib.igmpv3 import IGMPv3, IGMPv3mq, IGMPv3mr, IGMPv3gr from net_tests_utils.host.python import apf_test_base, apf_utils, adb_utils, assert_utils, packet_utils @@ -101,6 +102,22 @@ class ApfV6Test(apf_test_base.ApfTestBase): echo_request, "DROPPED_IPV4_PING_REQUEST_REPLIED", expected_echo_reply ) + @apf_utils.at_least_B() + def test_ipv6_icmp_echo_request_offload(self): + eth = Ether(src=self.server_mac_address, dst=self.client_mac_address) + ip = IPv6(src=self.server_ipv6_addresses[0], dst=self.client_ipv6_addresses[0]) + icmp = ICMPv6EchoRequest(id=1, seq=123) + echo_request = bytes(eth/ip/icmp/b"hello").hex() + + eth = Ether(src=self.client_mac_address, dst=self.server_mac_address) + ip = IPv6(src=self.client_ipv6_addresses[0], dst=self.server_ipv6_addresses[0]) + icmp = ICMPv6EchoReply(id=1, seq=123) + expected_echo_reply = bytes(eth/ip/icmp/b"hello").hex() + + self.send_packet_and_expect_reply_received( + echo_request, "DROPPED_IPV6_ICMP6_ECHO_REQUEST_REPLIED", expected_echo_reply + ) + @apf_utils.at_least_B() def test_igmpv3_general_query_offload(self): ether = Ether(src=self.server_mac_address, dst='01:00:5e:00:00:01')