Skip to contentSkip to conversation

host01.sh: Allow to overwrite the default hostname

PATCH New Petr Vorel 2 participants 3 messages Dec 11, 2020 – Dec 14, 2020

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH 1/1 host01.sh: Allow to overwrite the default hostname

Using hostname for test requires DNS setup.
Allow to set hostname (e.g. github.com) via $HOSTNAME in case host not set. This restores the old behavior (the legacy API version used $RHOST).

---
 testcases/network/tcp_cmds/host/host01.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/network/tcp_cmds/host/host01.sh +1 -1
index 662afe8b4..e6d8d4d06 100755
@@ -12,7 +12,7 @@ TST_NEEDS_CMDS="awk host hostname"
 
 do_test()
 {
-	local lhost="$(hostname)"
+	local lhost="${HOSTNAME:-$(hostname)}"
 	local addr
 
 	tst_res TINFO "test basic functionality of the host command"
Signature · 1 line
2.29.2
#1 lore raw

PATCH 1/1 host01.sh: Allow to overwrite the default hostname

Quoted 9 lines · Petr Vorel

Using hostname for test requires DNS setup.
Allow to set hostname (e.g. github.com) via $HOSTNAME in case host not set. This restores the old behavior (the legacy API version used $RHOST).

---
 testcases/network/tcp_cmds/host/host01.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
author
#2 lore raw

PATCH 1/1 host01.sh: Allow to overwrite the default hostname

Hi Alexey,

Quoted 5 lines · Petr Vorel
Quoted 3 lines

Using hostname for test requires DNS setup.
Allow to set hostname (e.g. github.com) via $HOSTNAME in case host not set. This restores the old behavior (the legacy API version used $RHOST).

Quoted 7 lines
Quoted 5 lines
---
 testcases/network/tcp_cmds/host/host01.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks! Merged.

Kind regards,
Petr