[LTP] [PATCH v3] ssh-stress: Convert to new api

Petr Vorel pvorel@suse.cz
Wed Jun 16 16:36:45 CEST 2021


Hi Joerg, Alexey,

...
> >  cleanup()
> >  {
> > +	local pids
> > +
> >  	# Stop the ssh daemon
> > -	test -s sshd.pid && kill $(cat sshd.pid)
> > -	pkill 'netstress$'
> > -	tst_rmdir
> > -	[ "$rtmpdir" ] && tst_rhost_run -c "rm -rf $rtmpdir"
> > -	TMPDIR=
> > +	[ -s sshd.pid ] && kill $(cat sshd.pid)
> > +	[ -n "$NETSTRESS_PID" ] && kill -2 $NETSTRESS_PID >/dev/null 2>&1
> > +
> > +	tst_rhost_run -c "kill $RHOST_PIDS"  >/dev/null 2>&1
And check also $RHOST_PIDS, right?
[ -n "$RHOST_PIDS" ] && tst_rhost_run -c "kill $RHOST_PIDS" >/dev/null 2>&1

> > +
> > +	# Kill all remaining ssh processes
> > +	tst_rhost_run -c "pkill -f '^ssh $RHOST_SSH_CONF'"

> Perhaps we should check that $RHOST_SSH_CONF is set before running
> pkill.
[ -n "$RHOST_SSH_CONF" ] && tst_rhost_run -c "pkill -f '^ssh $RHOST_SSH_CONF'"

No need to repost, I'll fix it before merge.

> For the rest:
> Reviewed-by: Alexey Kodanev <aleksei.kodanev@bell-sw.com>
Thanks!

Kind regards,
Petr


More information about the ltp mailing list