From ee5685c772974ebf027e08cfc83f60c3018618af Mon Sep 17 00:00:00 2001 From: David Gibson Date: Fri, 15 Jul 2022 15:21:39 +1000 Subject: tests: No need to retrieve host ifname in ndp/pasta With pasta, the namespace interface name is generally the same as the host interface name. We already rely on this in the dhcp/pasta tests, but for no clear reason ndp/pasta separately determines the host interface name. Remove this unnecessary step. Signed-off-by: David Gibson --- test/ndp/pasta | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'test/ndp/pasta') diff --git a/test/ndp/pasta b/test/ndp/pasta index 2a2dd1a..28fdd72 100644 --- a/test/ndp/pasta +++ b/test/ndp/pasta @@ -16,15 +16,14 @@ htools ip jq sipcalc grep cut test Interface name nsout IFNAME ip -j link show | jq -rM '.[] | select(.link_type == "ether").ifname' +check [ -n "__IFNAME__" ] ns ip link set dev __IFNAME__ up sleep 2 -hout HOST_IFNAME ip -j -4 route show|jq -rM '.[] | select(.dst == "default").dev' -check [ -n "__IFNAME__" ] test SLAAC: prefix nsout ADDR6 ip -j -6 addr show|jq -rM '.[] | select(.ifname == "__IFNAME__").addr_info[] | select(.scope == "global" and .prefixlen == 64).local' nsout PREFIX6 sipcalc __ADDR6__/64 | grep prefix | cut -d' ' -f4 -hout HOST_ADDR6 ip -j -6 addr show|jq -rM '.[] | select(.ifname == "__HOST_IFNAME__").addr_info[] | select(.scope == "global").local' +hout HOST_ADDR6 ip -j -6 addr show|jq -rM '.[] | select(.ifname == "__IFNAME__").addr_info[] | select(.scope == "global").local' hout HOST_PREFIX6 sipcalc __HOST_ADDR6__/64 | grep prefix | cut -d' ' -f4 check [ "__PREFIX6__" = "__HOST_PREFIX6__" ] -- cgit v1.2.3