All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [RFC PATCH v7 01/11] network/dhcp: Fix removing veth kernel module
Date: Fri, 21 Jul 2017 06:03:57 +0200	[thread overview]
Message-ID: <20170721040407.868-2-pvorel@suse.cz> (raw)
In-Reply-To: <20170721040407.868-1-pvorel@suse.cz>

From: Alexey Kodanev <alexey.kodanev@oracle.com>

This patch fixes problems with dhcp based tests run via netns when they
call TCONF:

$ /opt/ltp/testscripts/network.sh -6
dhcpd 1 TCONF: 'dhcpd' not found
...
cat: /sys/class/net/ltp_ns_veth2/address: No such file or directory

This also fixes other tests run after dhcp tests which are broken as
netns setup got broken.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
Tested-by: Petr Vorel <pvorel@suse.cz>
---
Alexey, this is your proposed patch from mailing list [1]. I've tested it.

[1]: http://lists.linux.it/pipermail/ltp/2017-June/004850.html
---
 testcases/network/dhcp/dhcp_lib.sh | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/testcases/network/dhcp/dhcp_lib.sh b/testcases/network/dhcp/dhcp_lib.sh
index 85f9b88bf..500123284 100755
--- a/testcases/network/dhcp/dhcp_lib.sh
+++ b/testcases/network/dhcp/dhcp_lib.sh
@@ -40,8 +40,7 @@ init()
 	tst_require_root
 	tst_check_cmds cat $dhcp_name awk ip pgrep pkill dhclient
 
-	veth_loaded=
-	lsmod | grep -q '^veth ' && veth_loaded=1
+	lsmod | grep -q '^veth ' && veth_loaded=yes || veth_loaded=no
 
 	tst_resm TINFO "create veth interfaces"
 	ip li add $iface0 type veth peer name $iface1 || \
@@ -68,6 +67,8 @@ init()
 
 cleanup()
 {
+	[ -z "$veth_loaded" ] && return
+
 	stop_dhcp
 
 	pkill -f "dhclient -$ipv $iface1"
@@ -81,9 +82,7 @@ cleanup()
 
 	[ $veth_added ] && ip li del $iface0
 
-	if [ -z $veth_loaded ]; then
-		lsmod | grep -q '^veth ' && rmmod veth
-	fi
+	[ "$veth_loaded" = "no" ] && lsmod | grep -q '^veth ' && rmmod veth
 
 	tst_rmdir
 }
-- 
2.13.2


  reply	other threads:[~2017-07-21  4:03 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-21  4:03 [LTP] [RFC PATCH v7 0/7] Simplify network setup + fix some network stress tests Petr Vorel
2017-07-21  4:03 ` Petr Vorel [this message]
2017-08-03 11:45   ` [LTP] [RFC PATCH v7 01/11] network/dhcp: Fix removing veth kernel module Alexey Kodanev
2017-07-21  4:03 ` [LTP] [RFC PATCH v7 02/11] network/stress: Add library test_net_stress.sh Petr Vorel
2017-07-24 15:54   ` Alexey Kodanev
2017-07-25  9:57     ` Petr Vorel
2017-07-25 10:48       ` Alexey Kodanev
2017-07-25 14:52         ` Petr Vorel
2017-07-25 16:01           ` Alexey Kodanev
2017-07-25 16:37             ` Petr Vorel
2017-07-21  4:03 ` [LTP] [RFC PATCH v7 03/11] network/stress: Simplify make_background_tcp_traffic usage Petr Vorel
2017-07-24 15:57   ` Alexey Kodanev
2017-07-25 10:12     ` Petr Vorel
2017-07-21  4:04 ` [LTP] [RFC PATCH v7 04/11] network/stress: Reduce the default number of cycles for various tests Petr Vorel
2017-07-21  4:04 ` [LTP] [RFC PATCH v7 05/11] lib/test_net.sh: tst_rhost_run: Add testcases/bin into PATH for SSH/RSH Petr Vorel
2017-07-25 12:50   ` Alexey Kodanev
2017-07-25 14:28     ` Petr Vorel
2017-07-21  4:04 ` [LTP] [RFC PATCH v7 06/11] network/stress: Fix and cleanup part of multicast IPv4 tests Petr Vorel
2017-07-25 15:21   ` Alexey Kodanev
2017-07-25 16:19     ` Petr Vorel
2017-07-21  4:04 ` [LTP] [RFC PATCH v7 07/11] lib/test_net.sh: Add function reset_ltp_netspace() Petr Vorel
2017-07-26 14:44   ` Alexey Kodanev
2017-07-26 14:55     ` Petr Vorel
2017-07-26 15:00       ` Alexey Kodanev
2017-07-21  4:04 ` [LTP] [RFC PATCH v7 08/11] network/stress: Fix and cleanup route IPv4 tests Petr Vorel
2017-07-26 14:58   ` Alexey Kodanev
2017-07-26 23:29     ` Petr Vorel
2017-07-21  4:04 ` [LTP] [RFC PATCH v7 09/11] network/stress: Further enhancements for route4-rmmod Petr Vorel
2017-07-21  4:04 ` [LTP] [RFC PATCH v7 10/11] network: Add tools for setup IP related environment variables Petr Vorel
2017-07-26 15:17   ` Alexey Kodanev
2017-07-27  8:35     ` Petr Vorel
2017-07-21  4:04 ` [LTP] [RFC PATCH v7 11/11] network: Use tools to set up IPv4 and IPv6 related variables Petr Vorel
2017-07-26 15:32   ` Alexey Kodanev
2017-07-27  9:03     ` Petr Vorel
2017-07-31 16:53       ` Alexey Kodanev
2017-08-14  9:55         ` 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=20170721040407.868-2-pvorel@suse.cz \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.