TOS test, and a fix or two to custom queues
authorClaudio-Daniel Freire <claudio-daniel.freire@inria.fr>
Wed, 17 Aug 2011 17:45:00 +0000 (19:45 +0200)
committerClaudio-Daniel Freire <claudio-daniel.freire@inria.fr>
Wed, 17 Aug 2011 17:45:00 +0000 (19:45 +0200)
src/nepi/util/tunchannel.py
test/testbeds/planetlab/execute.py
tunbench.py

index 5ccba6d..af18de5 100644 (file)
@@ -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()
index 4790c3f..54330f9 100755 (executable)
@@ -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()
index 46bb767..9a3e6e7 100644 (file)
@@ -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')