From d418391ce6a722eda106aeb924e24ba8efddd50c Mon Sep 17 00:00:00 2001 From: David Gibson Date: Wed, 22 May 2024 17:36:33 +1000 Subject: [PATCH] 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 --- test/system/helpers.network.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/system/helpers.network.bash b/test/system/helpers.network.bash index f42c274e97..955da500cd 100644 --- a/test/system/helpers.network.bash +++ b/test/system/helpers.network.bash @@ -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}" }