public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v4 1/2] net: Add tst_net_run helper
Date: Fri, 16 Nov 2018 15:24:11 +0100	[thread overview]
Message-ID: <20181116142411.GA24956@dell5510> (raw)
In-Reply-To: <09aff1dd-a89f-479b-49da-c0c776b08b91@oracle.com>

Hi Alexey,

> > Maybe we could signal where error occurred:
> > * return 0: ok on both lhost and rhost
> > * return 1: failure on lhost
> > * return 2: failure on rhost
> > * return 3: failure on both lhost and rhost


> It is only when there is no "safe" option, right?
yes, as safe exit with TCONF and warning.

> when doing cleanup?
IMHO in any "non-safe" run.

> Could we print TWARN message inside tst_net_run() in such case?
I wanted tst_net_run() to behave similarly as tst_rhost_run(), which doesn't
warn about it. So I propose to add warning to both functions, but also add -q
flag (quiet), which suppress this warning.

The reason for quiet mode is, that (I suppose) there are cases when some
features is tested and TWARN isn't wanted. Some examples (looks -s is used often
in cleanup functions):

testcases/network/stress/multicast/grp-operation/mcast-lib.sh:

mcast_cleanup()
{
    [ "$TST_IPV6" ] && mcast_cleanup6 || mcast_cleanup4

    pkill -SIGHUP -f "$MCAST_LCMD"
    tst_sleep 10ms
    pkill -9 -f "$MCAST_LCMD"

    tst_rhost_run -c "pkill -SIGHUP -f '$MCAST_RCMD'"
}

testcases/network/virt/virt_lib.sh
virt_cleanup_rmt()
{
    cleanup_vifaces
    tst_rhost_run -c "ip link delete ltp_v0 2>/dev/null"
    if [ "$virt_tcp_syn" ]; then
        sysctl -q net.ipv4.tcp_syn_retries=$virt_tcp_syn
        virt_tcp_syn=
    fi
}

nfs_setup_server() in testcases/network/nfs/nfs_stress/nfs_lib.sh:

	if ! tst_rhost_run -c "test -d $remote_dir"; then
        tst_rhost_run -s -c "mkdir -p $remote_dir; $export_cmd"
    fi


Kind regards,
Petr

  reply	other threads:[~2018-11-16 14:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-13 16:30 [LTP] [PATCH v4 1/2] net: Add tst_net_run helper Petr Vorel
2018-11-13 16:30 ` [LTP] [PATCH v4 2/2] net/ipsec: Add check for xfrm_user kernel module Petr Vorel
2018-11-16 11:51 ` [LTP] [PATCH v4 1/2] net: Add tst_net_run helper Alexey Kodanev
2018-11-16 14:24   ` Petr Vorel [this message]
2018-11-19 10:44     ` Alexey Kodanev
2018-11-19 15:40       ` Petr Vorel
2018-11-19 17:19         ` Alexey Kodanev
2018-11-19 17:38           ` 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=20181116142411.GA24956@dell5510 \
    --to=pvorel@suse.cz \
    --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