Add IPv6 neighbor solicitation offload for APFv6 multi-devices tests
Test: m connectivity_multi_devices_snippet && atest CtsConnectivityMultiDevicesTestCases Change-Id: I97f6a60ddfa3dcaf4aee0ea1db83cc9636031a54
This commit is contained in:
parent
c5a9e2e745
commit
8e8bbcabde
1 changed files with 22 additions and 0 deletions
|
|
@ -22,6 +22,10 @@ from scapy.layers.inet6 import (
|
|||
ICMPv6MLQuery2,
|
||||
ICMPv6MLReport2,
|
||||
ICMPv6MLDMultAddrRec,
|
||||
ICMPv6NDOptSrcLLAddr,
|
||||
ICMPv6NDOptDstLLAddr,
|
||||
ICMPv6ND_NS,
|
||||
ICMPv6ND_NA,
|
||||
RouterAlert
|
||||
)
|
||||
from scapy.layers.l2 import Ether
|
||||
|
|
@ -96,6 +100,24 @@ class ApfV6Test(apf_test_base.ApfTestBase):
|
|||
arp_request, "DROPPED_ARP_REQUEST_REPLIED", arp_reply
|
||||
)
|
||||
|
||||
def test_non_dad_ipv6_neighbor_solicitation_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])
|
||||
icmpv6 = ICMPv6ND_NS(tgt=self.client_ipv6_addresses[0])
|
||||
opt = ICMPv6NDOptSrcLLAddr(lladdr=self.server_mac_address)
|
||||
neighbor_solicitation = bytes(eth/ip/icmpv6/opt).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])
|
||||
icmpv6 = ICMPv6ND_NA(tgt=self.client_ipv6_addresses[0], R=1, S=1, O=1)
|
||||
opt = ICMPv6NDOptDstLLAddr(lladdr=self.client_mac_address)
|
||||
expected_neighbor_advertisement = bytes(eth/ip/icmpv6/opt).hex()
|
||||
self.send_packet_and_expect_reply_received(
|
||||
neighbor_solicitation,
|
||||
"DROPPED_IPV6_NS_REPLIED_NON_DAD",
|
||||
expected_neighbor_advertisement
|
||||
)
|
||||
|
||||
@apf_utils.at_least_B()
|
||||
def test_ipv4_icmp_echo_request_offload(self):
|
||||
eth = Ether(src=self.server_mac_address, dst=self.client_mac_address)
|
||||
|
|
|
|||
Loading…
Reference in a new issue