[LTP] [PATCH] net/host: update to new api

Petr Vorel pvorel@suse.cz
Tue Nov 17 12:30:41 CET 2020


Hi Alexey,

> > do_test()
> > {
> > 	local rhost=${RHOST:-$(hostname)}

> Hi Petr, Kory

> For new API we shouldn't use RHOST. Also the naming is misleading,
> it can be a local host name.

Thanks for catching it. Suppose this version is ok.

Kind regards,
Petr

TST_TESTFUNC="do_test"
TST_NEEDS_CMDS="awk host hostname"

. tst_net.sh

do_test()
{
	local lhost="$(hostname)"
	local addr

	tst_res TINFO "test basic functionality of the host command"

	if addr=$(host $lhost); then
		addr=$(echo "$addr" | awk '{print $NF}')
		EXPECT_PASS host $addr \>/dev/null
	else
		tst_brk TFAIL "host $lhost on local machine failed"
	fi
}

tst_run


More information about the ltp mailing list