[LTP] [PATCH] containers/netns/netns_sysfs.sh:load dummy module before collecting sysfs interface

Cyril Hrubis chrubis@suse.cz
Wed Nov 4 13:49:27 CET 2015


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?

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.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the Ltp mailing list