Hi!
> +cleanup()
> +{
> +     tst_rmdir
> +     ip link del dummy0 2>/dev/null
> +     kill -9 $NS_HANDLE 2>/dev/null
> +}
> +
> +tst_tmpdir
> +NS_HANDLE=$(ns_create net mnt)
> +if [ $? -eq 1 ]; then
> +     tst_resm TINFO "$NS_HANDLE"
> +     tst_brkm TBROK "unable to create a new network namespace"
> +fi
> +TST_CLEANUP=cleanup
> +ls /sys/class/net >sysfs_before
> +
> +
> +ns_exec $NS_HANDLE ip link add dummy0 type dummy || \
> +     tst_brkm TBROK "failed to add a new dummy device"
> +ns_exec $NS_HANDLE mount -t sysfs none /sys 2>/dev/null
> +kill -9 $NS_HANDLE

I'm a bit puzzled here. Why do we have to mount the sysfs in the
namespace if we aren't doing anything with it?

Also shouldn't we destroy the namespace after we save the sysfs_after?

> +ls /sys/class/net >sysfs_after
> +diff sysfs_before sysfs_after
> +if [ $? -eq 0 ]; then
> +     tst_resm TPASS "sysfs not affected by a separate namespace"
> +else
> +     tst_resm TFAIL "sysfs affected by a separate namespace"
> +fi
> +
> +tst_exit

Otherwise I'm ready to push these two patches (I did minor fixes in the
first one to silence compiler warnings though).

-- 
Cyril Hrubis
chru...@suse.cz

------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to