From: Claudio-Daniel Freire Date: Wed, 17 Aug 2011 17:45:00 +0000 (+0200) Subject: TOS test, and a fix or two to custom queues X-Git-Tag: nepi-3.0.0~295 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=11bad1ba9d3dc63ce8edd2734f4756f09fb0f188;p=nepi.git TOS test, and a fix or two to custom queues --- diff --git a/src/nepi/util/tunchannel.py b/src/nepi/util/tunchannel.py index 5ccba6d8..af18de59 100644 --- a/src/nepi/util/tunchannel.py +++ b/src/nepi/util/tunchannel.py @@ -295,6 +295,7 @@ def tun_fwd(tun, remote, with_pi, ether_mode, cipher_key, udp, TERMINATE, stderr if queueclass is None: queueclass = collections.deque + else: maxfwbuf = maxbkbuf = 2000000000 fwbuf = queueclass() diff --git a/test/testbeds/planetlab/execute.py b/test/testbeds/planetlab/execute.py index 4790c3f3..54330f9d 100755 --- a/test/testbeds/planetlab/execute.py +++ b/test/testbeds/planetlab/execute.py @@ -31,6 +31,10 @@ class PlanetLabExecuteTestCase(unittest.TestCase): os.path.dirname(planetlab.__file__), 'scripts', 'plr50.c') + TOS_PY = os.path.join( + os.path.dirname(planetlab.__file__), + 'scripts', + 'tosqueue.py') def setUp(self): self.root_dir = tempfile.mkdtemp() @@ -486,6 +490,10 @@ echo 'OKIDOKI' def test_tap_ping_udp_loss2_c(self): self._pingtest("TapInterface", "udp", "AES", self.PLR50_C, self.PLR50_C, "plr=50", "plr=50") + @test_util.skipUnless(test_util.pl_auth() is not None, "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)") + def test_tap_ping_udp_tos(self): + self._pingtest("TapInterface", "udp", "AES", self.TOS_PY, self.TOS_PY, "size=1000", "size=1000") + @test_util.skipUnless(test_util.pl_auth() is not None, "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)") def test_nepi_depends(self): instance = self.make_instance() diff --git a/tunbench.py b/tunbench.py index 46bb7670..9a3e6e70 100644 --- a/tunbench.py +++ b/tunbench.py @@ -35,6 +35,8 @@ def test(cipher, passphrase, plr=None, queuemodule=None): 'src','nepi','testbeds','planetlab','scripts')) queuemodule = __import__(queuemodule) queueclass = queuemodule.queueclass + else: + queueclass = None TERMINATE = [] def stopme(): time.sleep(100) @@ -52,7 +54,7 @@ def decrypt(packet, crypter, super=tunchannel.decrypt): except: return packet tunchannel.decrypt = decrypt -""" + for cipher in (None, 'AES', 'Blowfish', 'DES', 'DES3'): if cipher is None: passphrase = None @@ -73,7 +75,6 @@ print "Profile (50% PLR):" pstats.Stats('tunchannel.plr.profile').strip_dirs().sort_stats('time').print_stats() print "Bandwidth (50%% PLR): %.4fMb/s" % ( bytes / 200.0 * 8 / 2**20, ) -""" bytes = 0 cProfile.runctx('test(None,None,None,"tosqueue")',globals(),locals(),'tunchannel.tos.profile')