Comments (6)
@kellyyeh Can you help check this issue?
from sonic-mgmt.
I don't have a dualtor setup, but the active ports on my setup are not starting from index 0, hence the same radv test cases failed for me due to the hardcoded "eth1". This following change fixed the issue, basically replacing the hardcoded "eth1" with constructed "ethX" with the input port index X
.
diff --git a/ansible/roles/test/files/ptftests/router_adv_mflag_test.py b/ansible/roles/test/files/ptftests/router_adv_mflag_test.py
index 3049494e..cfaf77c0 100644
--- a/ansible/roles/test/files/ptftests/router_adv_mflag_test.py
+++ b/ansible/roles/test/files/ptftests/router_adv_mflag_test.py
@@ -53,15 +53,16 @@ class DataplaneBaseTest(BaseTest):
"""
- def create_icmpv6_router_advertisement_packet_send(self, dst_mac, dst_ip, src_mac, src_ip):
+ def create_icmpv6_router_advertisement_packet_send(self, dst_mac, dst_ip, src_mac, src_ip, port_index):
ether = Ether(dst=dst_mac, src=src_mac)
ip6 = IPv6(src=src_ip, dst=dst_ip, fl=0, tc=0, hlim=255)
icmp6 = RA(code=0, M=1, O=0)
# NOTE: Test expects RA packet to contain route prefix as the first option
icmp6 /= PrefixInfo(type=3, len=4)
rapkt = ether / ip6 / icmp6
- scapy2.sendp(rapkt, iface="eth1")
- logging.info(scapy2.sniff(iface='eth1', timeout=10))
+ iface = "eth" + str(port_index)
+ scapy2.sendp(rapkt, iface=iface)
+ logging.info(scapy2.sniff(iface=iface, timeout=10))
return rapkt
"""
@@ -136,7 +137,8 @@ class RadvUnSolicitedRATest(DataplaneBaseTest):
src_mac=self.downlink_vlan_mac,
dst_mac=ALL_NODES_MULTICAST_MAC_ADDRESS,
src_ip=self.downlink_vlan_ip6,
- dst_ip=ALL_NODES_IPV6_MULTICAST_ADDRESS)
+ dst_ip=ALL_NODES_IPV6_MULTICAST_ADDRESS,
+ port_index=self.ptf_port_index)
self.masked_rapkt = self.mask_off_dont_care_ra_packet_fields(rapkt)
def tearDown(self):
@@ -188,7 +190,8 @@ class RadvSolicitedRATest(DataplaneBaseTest):
src_mac=self.downlink_vlan_mac,
dst_mac=self.ptf_port_mac,
src_ip=self.downlink_vlan_ip6,
- dst_ip=self.ptf_port_ip6)
+ dst_ip=self.ptf_port_ip6,
+ port_index=self.ptf_port_index)
self.masked_rapkt = self.mask_off_dont_care_ra_packet_fields(rapkt)
self.rs_packet = self.create_icmpv6_router_solicitation_packet()
from sonic-mgmt.
I don't have a dualtor setup, but the active ports on my setup are not starting from index 0, hence the same radv test cases failed for me due to the hardcoded "eth1". This following change fixed the issue, basically replacing the hardcoded "eth1" with constructed "ethX" with the input port index
X
.diff --git a/ansible/roles/test/files/ptftests/router_adv_mflag_test.py b/ansible/roles/test/files/ptftests/router_adv_mflag_test.py index 3049494e..cfaf77c0 100644 --- a/ansible/roles/test/files/ptftests/router_adv_mflag_test.py +++ b/ansible/roles/test/files/ptftests/router_adv_mflag_test.py @@ -53,15 +53,16 @@ class DataplaneBaseTest(BaseTest): """ - def create_icmpv6_router_advertisement_packet_send(self, dst_mac, dst_ip, src_mac, src_ip): + def create_icmpv6_router_advertisement_packet_send(self, dst_mac, dst_ip, src_mac, src_ip, port_index): ether = Ether(dst=dst_mac, src=src_mac) ip6 = IPv6(src=src_ip, dst=dst_ip, fl=0, tc=0, hlim=255) icmp6 = RA(code=0, M=1, O=0) # NOTE: Test expects RA packet to contain route prefix as the first option icmp6 /= PrefixInfo(type=3, len=4) rapkt = ether / ip6 / icmp6 - scapy2.sendp(rapkt, iface="eth1") - logging.info(scapy2.sniff(iface='eth1', timeout=10)) + iface = "eth" + str(port_index) + scapy2.sendp(rapkt, iface=iface) + logging.info(scapy2.sniff(iface=iface, timeout=10)) return rapkt """ @@ -136,7 +137,8 @@ class RadvUnSolicitedRATest(DataplaneBaseTest): src_mac=self.downlink_vlan_mac, dst_mac=ALL_NODES_MULTICAST_MAC_ADDRESS, src_ip=self.downlink_vlan_ip6, - dst_ip=ALL_NODES_IPV6_MULTICAST_ADDRESS) + dst_ip=ALL_NODES_IPV6_MULTICAST_ADDRESS, + port_index=self.ptf_port_index) self.masked_rapkt = self.mask_off_dont_care_ra_packet_fields(rapkt) def tearDown(self): @@ -188,7 +190,8 @@ class RadvSolicitedRATest(DataplaneBaseTest): src_mac=self.downlink_vlan_mac, dst_mac=self.ptf_port_mac, src_ip=self.downlink_vlan_ip6, - dst_ip=self.ptf_port_ip6) + dst_ip=self.ptf_port_ip6, + port_index=self.ptf_port_index) self.masked_rapkt = self.mask_off_dont_care_ra_packet_fields(rapkt) self.rs_packet = self.create_icmpv6_router_solicitation_packet()
Thank you @Stephenxf !
Could you associate the fix PR with this issue?
from sonic-mgmt.
@echuawu can you take the patch and verify if it fixes the problem on your dualtor setup by any chance? If it works, I can create a PR. I don't know much about the dualtor layout, so just want the confirmation.
from sonic-mgmt.
@echuawu can you take the patch and verify if it fixes the problem on your dualtor setup by any chance? If it works, I can create a PR. I don't know much about the dualtor layout, so just want the confirmation.
Hi @Stephenxf , currently I don't have time on it, but I had already added a task about it. I will update the validate result then.
from sonic-mgmt.
Hi @Stephenxf, could you push the fix directly? If there is new issue, we could update it by a new PR.
from sonic-mgmt.
Related Issues (20)
- [Bug]: DECAP test cases failing with "Did not receive expected packet on any of ports [48, 49, 50, 51] for device 0" on 202405 image
- [Bug]: snappi: ECN multidut fails due to capture failures HOT 3
- [Bug]: test_reserved_dmac_drop always skipped
- [Test Gap][pfc][t0/t1]: Test case to check pfc counters are accurate after a pfc storm followed by a link flap
- [Bug]: “Syncd crashes when some attr is not supported by the ASIC in GET operation”
- Snappi tests : Merge tests into single code base (single and multi-dut folders) HOT 1
- [Bug]: test_bgp_stress_link_flap case sometime hung HOT 4
- [Bug]: dualtor.test_switchover_failure.py has a high failure rate in KVM test
- [Bug]: Wrong usage of duthost.get_facts().get("modular_chassis") HOT 1
- [Bug]: Vnet route mismatch in `vxlan/test_vxlan_crm.py` for KVM platform HOT 1
- [Bug]: golden config infra test fails due to sanity checks after load_minigraph HOT 12
- unimported fixture used in script: tests/snappi_tests/multidut/pfc/test_multidut_pfc_pause_lossy_with_snappi.py HOT 1
- [Test Gap][ T2 chassis] System port generation and validation
- [Test Gap][conntrack][T0]:Need test cases to make sure that conntrack table in kernel doesn't grow excessively large
- [Bug]: test_bgp_suppress_fib failures in 202405
- [Test Gap][PFCWD][T0&T1][Mellanox] PFC watchdog test on testbed with Non-Mellanox leaf-fanout HOT 2
- [Bug]: snappi-multidut: MultiDUTParams doesn't have an attribute: duthost3
- [Snappi][Broadcom-DNX] Need to modify ECN config_wred function to configure red-profile Kmin, Kmax and Pmax parameters
- [Bug]: telemetry/test_telemetry.py::test_telemetry_ouput and /test_mgmt_ipv6_only.py::test_telemetry_output_ipv6_only failed at internal PR test HOT 2
- [Bug]: bgp/test_bgp_suppress_fib.py::test_bgp_route_with_suppres failed at internal PR test
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sonic-mgmt.