Whamcloud - gitweb
LU-17667 tests: Handle more than 1 IP returned by 'ip' cmd 47/54547/2
authorArshad Hussain <arshad.hussain@aeoncomputing.com>
Sun, 24 Mar 2024 10:27:22 +0000 (06:27 -0400)
committerOleg Drokin <green@whamcloud.com>
Mon, 15 Apr 2024 16:54:03 +0000 (16:54 +0000)
commit27fe42d294021b1eaf12397a8ca44bf20a7198ad
tree4b43e1a6f4e842014df6523f2b932d2e82638133
parent2f74550e9c9b4dfca2cf78ae1cd86a55be7fd72f
LU-17667 tests: Handle more than 1 IP returned by 'ip' cmd

An interface could have more than one IP address. This may
be not normal and is a corner case. This patch handles case
where 'ip' command returns more than single IP and also adds
new info/debug messages.

Corner Case:
ip -o -4 a s enp0s8 | awk '{print $4}' | sed 's/\/.*//'
192.168.50.188
192.168.1.12

Before patch:
sanity-lnet.sh line 1174: ((: 188 12: syntax error in expression
(error token is "12")

After patch:
...
IP for enp0s8 found [2]
Interface:IP are
enp0s8:192.168.50.188
enp0s8:192.168.1.12
Using GW_NID:192.168.50.189@tcp
...

Test-Parameters: trivial testlist=sanity-lnet
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: I783a6b67508a4497d18db94b5d2bdab616b4ade5
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54547
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity-lnet.sh