diff --git a/scripts/tests/download-roaming-network.sh b/scripts/tests/download-roaming-network.sh index f7af12126..deb00de6c 100755 --- a/scripts/tests/download-roaming-network.sh +++ b/scripts/tests/download-roaming-network.sh @@ -54,13 +54,14 @@ for flow in "${flows[@]}"; do assert_eq "$(get_flow_field "$flow" "inner_dst_ip")" "172.21.0.101" done -# Verify different outer_src_port after roaming (network change) +# Verify different source tuple after roaming (network change) # The docker-compose setup uses routers and therefore the source IP is always the router. # But conntrack on the router will allocate a new source port because the binding on the old one is still active after roaming. -original_src_port=$(get_flow_field "${flows[0]}" "outer_src_port") +# To handle roaming between IPv4 and IPv6, we need to compare the entire tuple. +original_src_tuple="$(get_flow_field "${flows[0]}" "outer_src_ip") $(get_flow_field "${flows[0]}" "outer_src_port")" for ((i = 1; i < ${#flows[@]}; i++)); do - next_src_port=$(get_flow_field "${flows[i]}" "outer_src_port") + next_src_tuple="$(get_flow_field "${flows[i]}" "outer_src_ip") $(get_flow_field "${flows[i]}" "outer_src_port")" - assert_ne "$original_src_port" "$next_src_port" + assert_ne "$original_src_tuple" "$next_src_tuple" done