From 5beef085978e7ab8edc0f8a2b2a4d91a44ba2a3c Mon Sep 17 00:00:00 2001 From: David Gibson Date: Thu, 18 Aug 2022 16:13:54 +1000 Subject: test: Only select a single interface or gateway in tests The queries we use in the test scripts to locate the external interface or gateway can return multiple results. We get away with this because the way we parse command output only looks at the last line. It's not really correct, though, and improvements to our handling of command output will mean it breaks. Signed-off-by: David Gibson --- test/ndp/pasta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/ndp/pasta') diff --git a/test/ndp/pasta b/test/ndp/pasta index 28fdd72..d776055 100644 --- a/test/ndp/pasta +++ b/test/ndp/pasta @@ -29,5 +29,5 @@ check [ "__PREFIX6__" = "__HOST_PREFIX6__" ] test SLAAC: route nsout GW6 ip -j -6 route show|jq -rM '.[] | select(.dst == "default").gateway' -hout HOST_GW6 ip -j -6 route show|jq -rM '.[] | select(.dst == "default").gateway' +hout HOST_GW6 ip -j -6 route show|jq -rM '[.[] | select(.dst == "default").gateway] | .[0]' check [ __GW6__ = __HOST_GW6__ ] -- cgit v1.2.3