Message ID | 20201211071545.10209-1-pvorel@suse.cz |
---|---|
State | Accepted |
Headers | show |
Series | [1/1] host01.sh: Allow to overwrite the default hostname | expand |
On 11.12.2020 10:15, Petr Vorel wrote: > 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). > > Suggested-by: Petr Cervinka <pcervinka@suse.com> > Signed-off-by: Petr Vorel <pvorel@suse.cz> > --- > testcases/network/tcp_cmds/host/host01.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Acked-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Hi Alexey, > On 11.12.2020 10:15, Petr Vorel wrote: > > 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). > > Suggested-by: Petr Cervinka <pcervinka@suse.com> > > Signed-off-by: Petr Vorel <pvorel@suse.cz> > > --- > > testcases/network/tcp_cmds/host/host01.sh | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > Acked-by: Alexey Kodanev <alexey.kodanev@oracle.com> Thanks! Merged. Kind regards, Petr
diff --git a/testcases/network/tcp_cmds/host/host01.sh b/testcases/network/tcp_cmds/host/host01.sh index 662afe8b4..e6d8d4d06 100755 --- a/testcases/network/tcp_cmds/host/host01.sh +++ b/testcases/network/tcp_cmds/host/host01.sh @@ -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"
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). Suggested-by: Petr Cervinka <pcervinka@suse.com> Signed-off-by: Petr Vorel <pvorel@suse.cz> --- testcases/network/tcp_cmds/host/host01.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)