mirror of
https://github.com/containers/podman.git
synced 2025-06-30 07:26:39 +08:00
test, pasta: Ignore deprecated addresses in tests
The default_addr shell function in test/system/helpers.network is used to get the host's default address, which is used in a number of pasta networking tests. However, in certain circumstances it can incorrectly pick a deprecated address as the primary address. Correct it to exclude those. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
@ -427,6 +427,6 @@ function default_addr() {
|
||||
local ip_ver="${1}"
|
||||
local ifname="${2:-$(default_ifname "${ip_ver}")}"
|
||||
|
||||
local expr='.[0] | .addr_info[0].local'
|
||||
local expr='[.[0].addr_info[] | select(.deprecated != true)][0].local'
|
||||
ip -j -"${ip_ver}" addr show "${ifname}" | jq -rM "${expr}"
|
||||
}
|
||||
|
Reference in New Issue
Block a user