mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
ci: compare source tuple instead of only port (#10680)
This test is currently flaky on main because it may happen that we first roam from our IPv4 address to the IPv6 one. Therefore, to make the assertion pass we need to check that all flows have a different source tuple and not just a different source port.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user