Skip to content

Commit 91cd396

Browse files
..
1 parent 8167280 commit 91cd396

File tree

1 file changed

+11
-15
lines changed
  • dpd-client/tests/integration_tests

1 file changed

+11
-15
lines changed

dpd-client/tests/integration_tests/mcast.rs

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -500,10 +500,10 @@ async fn test_internal_ipv6_validation() {
500500

501501
let (port_id, link_id) = switch.link_id(PhysPort(26)).unwrap();
502502

503-
// Test 1: IPv4 groups should be rejected from internal API
504-
let ipv4_internal = types::MulticastGroupCreateEntry {
505-
group_ip: "::ffff:224.1.1.1".parse().unwrap(), // IPv4-mapped IPv6 to test rejection
506-
tag: Some("test_ipv4_internal".to_string()),
503+
// Test 1: IPv4-mapped IPv6 addresses should be rejected as invalid multicast
504+
let ipv4_mapped_internal = types::MulticastGroupCreateEntry {
505+
group_ip: "::ffff:224.1.1.1".parse().unwrap(), // IPv4-mapped IPv6
506+
tag: Some("test_ipv4_mapped_internal".to_string()),
507507
sources: None,
508508
members: vec![types::MulticastGroupMember {
509509
port_id: port_id.clone(),
@@ -512,18 +512,17 @@ async fn test_internal_ipv6_validation() {
512512
}],
513513
};
514514

515-
let ipv4_res = switch.client.multicast_group_create(&ipv4_internal).await;
515+
let ipv4_mapped_res = switch.client.multicast_group_create(&ipv4_mapped_internal).await;
516516

517517
assert!(
518-
ipv4_res.is_err(),
519-
"Should reject IPv4 groups from internal API"
518+
ipv4_mapped_res.is_err(),
519+
"Should reject IPv4-mapped IPv6 addresses"
520520
);
521-
let ipv4_error_msg = format!("{:?}", ipv4_res.unwrap_err());
521+
let ipv4_mapped_error_msg = format!("{:?}", ipv4_mapped_res.unwrap_err());
522522
assert!(
523-
ipv4_error_msg
524-
.contains("IPv4 multicast groups must use the external API"),
525-
"Error message should direct to external API: {}",
526-
ipv4_error_msg
523+
ipv4_mapped_error_msg.contains("is not a multicast address"),
524+
"Error message should indicate invalid multicast address: {}",
525+
ipv4_mapped_error_msg
527526
);
528527

529528
// Test 2: Non-admin-scoped IPv6 groups should be rejected from internal API
@@ -3584,7 +3583,6 @@ async fn test_multicast_reset_all_tables() -> TestResult {
35843583
.await;
35853584

35863585
// 2b. Admin-scoped IPv6 group to test internal API with custom replication parameters
3587-
let admin_scoped_ip = IpAddr::V6(Ipv6Addr::new(0xff04, 0, 0, 0, 0, 0, 0, 2));
35883586
let group_entry2b = types::MulticastGroupCreateEntry {
35893587
group_ip: Ipv6Addr::new(0xff04, 0, 0, 0, 0, 0, 0, 2),
35903588
tag: Some("test_reset_all_2b".to_string()),
@@ -4150,8 +4148,6 @@ async fn test_multicast_level1_exclusion_group_pruned() -> TestResult {
41504148
let egress1 = PhysPort(15);
41514149
let egress2 = PhysPort(22);
41524150

4153-
let egress2_asic_id = switch.tofino_port(egress2);
4154-
41554151
let src_mac = switch.get_port_mac(ingress).unwrap();
41564152

41574153
let multicast_ip = IpAddr::V4(MULTICAST_TEST_IPV4);

0 commit comments

Comments
 (0)