On Wed, Oct 05, 2016 at 03:44:34PM +0200, Jan Tluka wrote:
On RHEL6 the netns can't be deleted if there are processes
referencing it.
The fix is to move the namespace deletion after the kill of the process.
I tested this with the LNST regression test suite both on RHEL7 and RHEL6.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Slave/NetTestSlave.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/lnst/Slave/NetTestSlave.py b/lnst/Slave/NetTestSlave.py
index 956ce1d..8e26b4b 100644
--- a/lnst/Slave/NetTestSlave.py
+++ b/lnst/Slave/NetTestSlave.py
@@ -737,6 +737,10 @@ class SlaveMethods:
libc = ctypes.CDLL(libc_name)
netns_path = "/var/run/netns/" + netns
+ netns_pid = self._net_namespaces[netns]["pid"]
+ os.kill(netns_pid, signal.SIGUSR1)
+ os.waitpid(netns_pid, 0)
+
# Remove named namespace
try:
libc.umount2(netns_path, MNT_DETACH)
@@ -744,9 +748,6 @@ class SlaveMethods:
except:
logging.warning("Unable to remove named namespace %s." %
netns_path)
- netns_pid = self._net_namespaces[netns]["pid"]
- os.kill(netns_pid, signal.SIGUSR1)
- os.waitpid(netns_pid, 0)
logging.debug("Network namespace %s removed." % netns)
self._net_namespaces[netns]["pipe"].close()
--
2.4.11
_______________________________________________
LNST-developers mailing list -- lnst-developers(a)lists.fedorahosted.org
To unsubscribe send an email to lnst-developers-leave(a)lists.fedorahosted.org
pushed, thanks
-Ondrej