public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Alexey Kodanev <alexey.kodanev@oracle.com>
To: ltp@lists.linux.it
Subject: [LTP] [RESENT PATCH 1/5] tst_net.sh: Remove rsh support
Date: Fri, 26 Jun 2020 09:27:25 +0300	[thread overview]
Message-ID: <746f495c-b079-4ead-147a-ab21bb357464@oracle.com> (raw)
In-Reply-To: <3c3327ea-3132-255c-f853-c5c2d3f3c338@oracle.com>

On 25.06.2020 19:42, Alexey Kodanev wrote:
> On 22.06.2020 10:09, Petr Vorel wrote:
>> From: Petr Vorel <pvorel@suse.cz>
>>
> Hi Petr,
> 
>> rsh is not used nowadays. When was the first network library version
>> added in 18739ff06 (2014), it was a default + and ssh replacement was
>> optional. Netns based single machine testing was added in 5f8ca6cf0
>> (2016). After 6 years it's time to drop legacy rsh.
>>
>> ssh based testing setup requires only RHOST variable, TST_USE_SSH has
>> been removed as unneeded. Also check for ssh in tst_rhost_run().
>>
>> We still keep $LTP_RSH for some of the network stress tests, which has
>> not been ported to tst_net.sh yet.
> 
> But tst_net.sh not used in such tests, so why keeping LTP_RSH there?

Ok, tst_net.sh included in testscripts/network.sh, we could change it
to ssh too:

diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
index 41938b1ac..0e10945da 100644
--- a/testcases/lib/tst_net.sh
+++ b/testcases/lib/tst_net.sh
@@ -856,7 +856,7 @@ tst_default_max_pkt()
 export RHOST="$RHOST"
 export PASSWD="${PASSWD:-}"
 # Don't use it in new tests, use tst_rhost_run() from tst_net.sh instead.
-export LTP_RSH="${LTP_RSH:-rsh -n}"
+export LTP_RSH="${LTP_RSH:-ssh -nq -l root}"
 
 # Test Links
 # IPV{4,6}_{L,R}HOST can be set with or without prefix (e.g. IP or IP/prefix),

> 
>>
>> Suggested-by: Alexey Kodanev <alexey.kodanev@oracle.com>
>> Signed-off-by: Petr Vorel <pvorel@suse.cz>
>> ---
>>  testcases/lib/tst_net.sh | 10 ++++------
>>  1 file changed, 4 insertions(+), 6 deletions(-)
>>
>> diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
>> index 806b540cd..1b96b3bf4 100644
>> --- a/testcases/lib/tst_net.sh
>> +++ b/testcases/lib/tst_net.sh
>> @@ -136,7 +136,7 @@ init_ltp_netspace()
>>  # -b run in background
>>  # -c CMD specify command to run (this must be binary, not shell builtin/function)
>>  # -s safe option, if something goes wrong, will exit with TBROK
>> -# -u USER for ssh/rsh (default root)
>> +# -u USER for ssh (default root)
>>  # RETURN: 0 on success, 1 on failure
>>  tst_rhost_run()
>>  {
>> @@ -166,14 +166,12 @@ tst_rhost_run()
>>  		return 1
>>  	fi
>>  
>> -	if [ -n "${TST_USE_SSH:-}" ]; then
>> -		output=`ssh -n -q $user@$RHOST "sh -c \
>> -			'$pre_cmd $cmd $post_cmd'" $out 2>&1 || echo 'RTERR'`
>> -	elif [ -n "${TST_USE_NETNS:-}" ]; then
>> +	if [ -n "${TST_USE_NETNS:-}" ]; then
>>  		output=`$LTP_NETNS sh -c \
>>  			"$pre_cmd $cmd $post_cmd" $out 2>&1 || echo 'RTERR'`
>>  	else
>> -		output=`rsh -n -l $user $RHOST "sh -c \
>> +		tst_require_cmds ssh
>> +		output=`ssh -n -q $user@$RHOST "sh -c \
>>  			'$pre_cmd $cmd $post_cmd'" $out 2>&1 || echo 'RTERR'`
>>  	fi
>>  	echo "$output" | grep -q 'RTERR$' && ret=1
>>
> 
> 


  reply	other threads:[~2020-06-26  6:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-22  7:09 [LTP] [RESENT PATCH 0/5] tst_net.sh: Remove rsh, update docs add debug & test Petr Vorel
2020-06-22  7:09 ` [LTP] [RESENT PATCH 1/5] tst_net.sh: Remove rsh support Petr Vorel
2020-06-25 16:42   ` Alexey Kodanev
2020-06-26  6:27     ` Alexey Kodanev [this message]
2020-06-28  3:36       ` Xiao Yang
2020-06-22  7:09 ` [LTP] [RESENT PATCH 2/5] net: Update README.md Petr Vorel
2020-06-23  5:16   ` Xiao Yang
2020-06-22  7:09 ` [LTP] [RESENT PATCH 3/5] tst_net.sh: Drop 'sh -c' use from ssh in tst_rhost_run Petr Vorel
2020-06-25 16:44   ` Alexey Kodanev
2020-06-22  7:09 ` [LTP] [RESENT PATCH 4/5] net/test: Add basic testing for tst_rhost_run Petr Vorel
2020-06-25 16:52   ` Alexey Kodanev
2020-06-22  7:09 ` [LTP] [RESENT RFC PATCH 5/5] st_net.sh: tst_rhost_run: Add -d option (debug) Petr Vorel
2020-06-23  5:52   ` Xiao Yang
  -- strict thread matches above, loose matches on Subject: below --
2020-06-22  4:56 [LTP] [RESENT PATCH 0/5] tst_net.sh: Remove rsh, update docs add debug & test Petr Vorel
2020-06-22  4:56 ` [LTP] [RESENT PATCH 1/5] tst_net.sh: Remove rsh support Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=746f495c-b079-4ead-147a-ab21bb357464@oracle.com \
    --to=alexey.kodanev@oracle.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox