public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] containers/netns/netns_sysfs.sh:load dummy module before collecting sysfs interface
Date: Thu, 5 Nov 2015 15:05:28 +0100	[thread overview]
Message-ID: <20151105140528.GE7226@rei> (raw)
In-Reply-To: <563ADF10.2030803@oracle.com>

Hi!
> >> diff --git a/testcases/kernel/containers/netns/netns_sysfs.sh b/testcases/kernel/containers/netns/netns_sysfs.sh
> >> index 7dea52b..b5791bd 100755
> >> --- a/testcases/kernel/containers/netns/netns_sysfs.sh
> >> +++ b/testcases/kernel/containers/netns/netns_sysfs.sh
> >> @@ -47,6 +47,10 @@ if [ $? -eq 1 ]; then
> >>   	tst_brkm TBROK "unable to create a new network namespace"
> >>   fi
> >>   TST_CLEANUP=cleanup
> >> +
> >> +#Load dummy module before collecting sysfs interface
> >> +lsmod | grep dummy || modprobe dummy
> >> +[ $? -eq 0 ] || tst_brkm TBROK "failed to load dummy module"
> > But this will fail when dummy wasn't compiled in the kernel, right?
> Yes,if dummy wasn't compiled in the kernel,it will also fail when adding 
> dummy device in the next step:
> ===cut===
> ns_exec $NS_HANDLE $NS_TYPE ip link add $DUMMYDEV type dummy || \
>      tst_brkm TBROK "failed to add a new dummy device"
> ===cut===

I meaned "wasn't compiled as module" i.e. compiled in kernel, sorry for
the confusion. In that case this would work fine but the modprobe would
fail.

> > Since modprobe will exit with 1 when module couldn't be found. So we
> > should either just call 'modprobe dummy' and ignore the return value or
> > change the code to ignore the default dummy interface.
> I prefer 'modprobe dummy' and ignore the return value,because I'm not 
> sure whether there is any other default dummy interface name except 
> "dummy0".

Sounds good to me.

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2015-11-05 14:05 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 [this message]
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
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=20151105140528.GE7226@rei \
    --to=chrubis@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