-
Notifications
You must be signed in to change notification settings - Fork 1k
Support running acl tests without any IPv4 management configuration #21155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a05fbd8
b98a8de
d228ba8
1a2be2a
cee7180
9275036
1a58d4a
500339b
0972fc6
909e5ee
0743632
6922075
413d939
fa1dbe0
449a8af
8edc65f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,23 +32,27 @@ def gen_garp_packets(self): | |
| source_ipv6_str = config['target_ipv6'] | ||
| dut_mac = config['dut_mac'] | ||
| dst_ipv6 = config['dst_ipv6'] | ||
| source_ip = str(ip_interface(source_ip_str).ip) | ||
| source_ipv6 = str(ip_interface(source_ipv6_str).ip) | ||
| source_ip = str(ip_interface(source_ip_str).ip) if source_ip_str else None | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you remind me why
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prior to skipping all v4 cases when run on isolated-v6 testbeds, we found that the garp service was emitting a TypeError when trying to configure and send arp packets using a v4 address which was None. The changes here are meant to prevent this by selectively configuring and sending arp, or nd, or both, all depending on the configuration of the testbed. Granted, these changes are less impactful due to the fact that the |
||
| source_ipv6 = str(ip_interface(source_ipv6_str).ip) if source_ipv6_str else None | ||
|
|
||
| # PTF uses Scapy to create packets, so this is ok to create | ||
| # packets through PTF even though we are using Scapy to send the packets | ||
| garp_pkt = testutils.simple_arp_packet( | ||
| eth_src=source_mac, | ||
| hw_snd=source_mac, | ||
| ip_snd=source_ip, | ||
| # Re-use server IP as target IP, since it is within the subnet of the VLAN IP | ||
| ip_tgt=source_ip, | ||
| arp_op=2) | ||
|
|
||
| na_pkt = Ether(src=source_mac, dst=dut_mac) \ | ||
| / IPv6(dst=dst_ipv6, src=source_ipv6) \ | ||
| / ICMPv6ND_NA(tgt=source_ipv6, S=1, R=0, O=0) \ | ||
| / ICMPv6NDOptSrcLLAddr(type=2, lladdr=source_mac) | ||
| garp_pkt = None | ||
| na_pkt = None | ||
| if source_ip: | ||
| garp_pkt = testutils.simple_arp_packet( | ||
| eth_src=source_mac, | ||
| hw_snd=source_mac, | ||
| ip_snd=source_ip, | ||
| # Re-use server IP as target IP, since it is within the subnet of the VLAN IP | ||
| ip_tgt=source_ip, | ||
| arp_op=2) | ||
|
|
||
| if source_ipv6: | ||
| na_pkt = Ether(src=source_mac, dst=dut_mac) \ | ||
| / IPv6(dst=dst_ipv6, src=source_ipv6) \ | ||
| / ICMPv6ND_NA(tgt=source_ipv6, S=1, R=0, O=0) \ | ||
| / ICMPv6NDOptSrcLLAddr(type=2, lladdr=source_mac) | ||
|
|
||
| self.packets[intf_name] = [garp_pkt, na_pkt] | ||
|
|
||
|
|
@@ -69,7 +73,8 @@ def send_garp_packets(self): | |
| while True: | ||
| for socket, packet_list in list(sockets.items()): | ||
| for packet in packet_list: | ||
| socket.send(packet) | ||
| if packet: | ||
| socket.send(packet) | ||
|
|
||
| if self.interval is None: | ||
| break | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.