Hi! > mounting sysfs in a separate (net + mnt) namespace will cause that > inside that namespace in /sys/class/net/ we will see only network > devices local to the separated namespace including dummy device > created by the test (without mounting sysfs we would see all the devices > from main namespace). Now back in the main namespace we check that this > mount had no influence on the main namespace (ls /sys/class/net >sysfs_after). > I thought that test description says it clear.
So we are testing that mounting the /sys in new mount namespace does no propagate to the main namespace? In this case it makes sense. Also do we want to assert that the dummy0 device is listed in the /sys inside the namespace? > To the namespace destroying: as NS_HANDLE is a pid of a process, which keeps > namespace alive (see ns_create.c for details), we can destroy namespace > by killing this process. I pretty much know that allready (I've spend quite some time reading the code you wrote). And if I understand it correctly removing the namespace will also remove the dummy device that has been created in that namespace, right? So that the sysfs_after will be same regardless if the dummy device was propagated or not. Which is the reason I wanted to sample the directory before we remove it. > Anyway, one thing you can do before pushing the patch is to remove > kill -9 $NS_HANDLE > command from the test code, as this is done inside cleanup function. Killing it twice once in the test and once in the cleanup is mistake as well. Since the NS_HANDLE is pid and it may have been reused if there was a lot of forking done on the system meanwhile. Which is unlikely but still possible. -- Cyril Hrubis chru...@suse.cz ------------------------------------------------------------------------------ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list