Fixing UdpTunnel unit tests for PlanetLab
[nepi.git] / src / nepi / resources / linux / udptunnel.py
index ba96788..01f6898 100644 (file)
@@ -34,7 +34,6 @@ class UdpTunnel(LinuxApplication):
     _help = "Constructs a tunnel between two Linux endpoints using a UDP connection "
     _backend = "linux"
 
-
     @classmethod
     def _register_attributes(cls):
         cipher = Attribute("cipher",
@@ -225,7 +224,7 @@ class UdpTunnel(LinuxApplication):
                 (out2, err2), proc2 = self.endpoint2.node.kill(self._pid2, 
                         self._ppid2, sudo = True) 
 
-                if err1 or err2 or proc1.poll() or proc2.poll():
+                if (proc1.poll() and err1) or (proc2.poll() and err2):
                     # check if execution errors occurred
                     msg = " Failed to STOP tunnel"
                     self.error(msg, err1, err2)
@@ -289,7 +288,7 @@ class UdpTunnel(LinuxApplication):
         result = None
         delay = 1.0
 
-        for i in xrange(4):
+        for i in xrange(20):
             (out, err), proc = endpoint.node.check_output(
                     self.run_home(endpoint), filename)