From: Jiri Jaburek <jjaburek@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] containers/netns/netns_sysfs.sh:load dummy module before collecting sysfs interface
Date: Mon, 9 Nov 2015 16:20:23 +0100 [thread overview]
Message-ID: <5640B9B7.9080201@redhat.com> (raw)
In-Reply-To: <20151109141449.GA23375@rei>
On 11/09/2015 03:14 PM, Cyril Hrubis wrote:
> Hi!
>> However - wouldn't it be simply easier to add an exception for dummy0
>> during the comparison check? The test operates with iface names other
>> than dummy0, so a possible namespace bug would be found anyway.
>> (See attached diff.)
>>
>> However the (quite possibly) best solution would be a one which cleans
>> up after itself, so maybe the [ -d /sys/module/dummy ] solution with
>> explicit modprobe / modprobe -r would work better.
>
> Either one works for me.
I would send a patch with the more "clean" solution, but I'm not sure
how to modularize the cleanup function here as I need to add modprobe -r
only if the modprobe was previously done.
Furthermore, doing it that way would make the test impossible to run
multiple times in parallel.
So it boils down to either doing a preemptive modprobe 2>/dev/null or
ignoring dummy[0-9]+, it's up to you. :)
>
>> diff --git a/testcases/kernel/containers/netns/netns_sysfs.sh b/testcases/kernel/containers/netns/netns_sysfs.sh
>> index 7dea52b..e725a50 100755
>> --- a/testcases/kernel/containers/netns/netns_sysfs.sh
>> +++ b/testcases/kernel/containers/netns/netns_sysfs.sh
>> @@ -47,7 +47,10 @@ if [ $? -eq 1 ]; then
>> tst_brkm TBROK "unable to create a new network namespace"
>> fi
>> TST_CLEANUP=cleanup
>> -ls /sys/class/net >sysfs_before
>> +
>> +# exclude dummy0 from comparison as it gets automatically created by the
>> +# dummy device driver upon insmod/modprobe (during ip link add)
>> +ls /sys/class/net | grep -v dummy0 >sysfs_before
>
> Maybe we should do grep -v dummy[0-9].* in order to skipp all dummy
> interfaces if someone changes the number of interfaces created. If we
> decide to go this way.
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-containers-netns-exclude-dummy0-from-before-after-co.patch
Type: text/x-patch
Size: 1338 bytes
Desc: not available
URL: <http://lists.linux.it/pipermail/ltp/attachments/20151109/7f8a8c7c/attachment-0001.bin>
next prev parent reply other threads:[~2015-11-09 15:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-30 8:57 [LTP] [PATCH] containers/netns/netns_sysfs.sh:load dummy module before collecting sysfs interface shuang.qiu
2015-11-04 12:49 ` Cyril Hrubis
2015-11-05 4:46 ` Shuang Qiu
2015-11-05 14:05 ` Cyril Hrubis
2015-11-06 10:28 ` Shuang Qiu
2015-11-06 17:16 ` Jiri Jaburek
2015-11-09 14:14 ` Cyril Hrubis
2015-11-09 15:20 ` Jiri Jaburek [this message]
2015-11-09 15:26 ` Cyril Hrubis
2015-11-10 4:03 ` Shuang Qiu
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=5640B9B7.9080201@redhat.com \
--to=jjaburek@redhat.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