From: Alina Quereilhac Date: Sun, 19 May 2013 20:21:28 +0000 (+0200) Subject: Clean up of repo X-Git-Tag: nepi-3.0.0~123 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=476134e26e61b5b8522b45cbc4c379b6ffa8e0b5;hp=70c33a3b0fe396cce12d3d1c0eb6cf40ce537a95;p=nepi.git Clean up of repo --- diff --git a/examples/streaming/vlc_broadcast.py b/examples/streaming/vlc_broadcast.py index c976160e..7d1d19fe 100644 --- a/examples/streaming/vlc_broadcast.py +++ b/examples/streaming/vlc_broadcast.py @@ -309,7 +309,7 @@ if __name__ == '__main__': cli_apps = [] cli_ifaces = [] - hostnames = ["planetlab1.rd.tut.fi", + hostnames = [#"planetlab1.rd.tut.fi", "planetlab-2.research.netlab.hut.fi", "planetlab2.willab.fi", "planetlab3.hiit.fi", @@ -318,15 +318,15 @@ if __name__ == '__main__': "planetlab1.s3.kth.se", "itchy.comlab.bth.se", "planetlab-1.ida.liu.se", - "scratchy.comlab.bth.se", + #"scratchy.comlab.bth.se", "planetlab2.s3.kth.se", "planetlab1.sics.se", "planetlab1.tlm.unavarra.es", - "planetlab2.uc3m.es", + #"planetlab2.uc3m.es", "planetlab2.upc.es", - "ait21.us.es", + #"ait21.us.es", "planetlab3.upc.es", - "planetlab1.uc3m.es", + #"planetlab1.uc3m.es", "planetlab2.dit.upm.es", "planetlab1.upc.es", "planetlab2.um.es", @@ -341,7 +341,7 @@ if __name__ == '__main__': "planetlab1.ci.pwr.wroc.pl", "planetlab1.pjwstk.edu.pl", "ple2.tu.koszalin.pl", - "planetlab2.ci.pwr.wroc.pl", + #"planetlab2.ci.pwr.wroc.pl", "planetlab2.cyfronet.pl", "plab2.ple.silweb.pl", "planetlab1.cyfronet.pl", @@ -351,8 +351,8 @@ if __name__ == '__main__': "ple1.dmcs.p.lodz.pl", "pandora.we.po.opole.pl", "gschembra3.diit.unict.it", - "onelab6.iet.unipi.it", - "planetlab1.science.unitn.it", + #"onelab6.iet.unipi.it", + #"planetlab1.science.unitn.it", "planetlab-1.ing.unimo.it", "gschembra4.diit.unict.it", "iraplab1.iralab.uni-karlsruhe.de", @@ -376,8 +376,8 @@ if __name__ == '__main__': "inriarennes1.irisa.fr", "inriarennes2.irisa.fr", "peeramide.irisa.fr", - "pl1.bell-labs.fr", - "pl2.bell-labs.fr", + #"pl1.bell-labs.fr", + #"pl2.bell-labs.fr", "host4-plb.loria.fr", "planetlab-1.imag.fr", "planetlab-2.imag.fr", @@ -408,7 +408,7 @@ if __name__ == '__main__': "chimay.infonet.fundp.ac.be", "orval.infonet.fundp.ac.be", "rochefort.infonet.fundp.ac.be", - "planck227ple.test.ibbt.be", + #"planck227ple.test.ibbt.be", ] diff --git a/misc/nepi_fdnetdev.patch b/misc/nepi_fdnetdev.patch deleted file mode 100644 index d236a380..00000000 --- a/misc/nepi_fdnetdev.patch +++ /dev/null @@ -1,111 +0,0 @@ -diff -r f860e2eac903 src/nepi/testbeds/ns3/connection_metadata.py ---- a/src/nepi/testbeds/ns3/connection_metadata.py Wed Aug 15 18:22:33 2012 +0200 -+++ b/src/nepi/testbeds/ns3/connection_metadata.py Thu Aug 16 19:02:36 2012 +0200 -@@ -121,7 +121,34 @@ - (fd, msg) = passfd.recvfd(sock) - # Store a reference to the endpoint to keep the socket alive - fdnd.SetFileDescriptor(fd) -- -+ -+ try: -+ import fcntl -+ import struct -+ TUNGETIFF = 0x800454d2 -+ IFF_NO_PI = 0x00001000 -+ IFF_TUN = 0x00000001 -+ IFF_TAP = 0x00000002 -+ struct_ifreq = "x"*16+"H"+"x"*22 -+ -+ (flags, ) = struct.unpack(struct_ifreq, -+ fcntl.ioctl(fd, TUNGETIFF, struct.pack(struct_ifreq, 0))) -+ -+ with_pi = (0 == (flags & IFF_NO_PI)) -+ is_tap = (0 == (flags & IFF_TUN)) -+ -+ if is_tap and with_pi: -+ fdnd.SetEncapsulationMode(fdnd.DIXPI) -+ elif not is_tap and with_pi: -+ fdnd.SetEncapsulationMode(fdnd.PI) -+ except: -+ # maybe the kernel doesn't support the IOCTL, -+ # in which case, we assume it uses PI headers (as is usual) -+ pass -+ -+ #import traceback -+ #err = traceback.format_exc() -+ - import threading - import passfd - import socket -diff -r f860e2eac903 src/nepi/testbeds/ns3/ns3_bindings_import.py ---- a/src/nepi/testbeds/ns3/ns3_bindings_import.py Wed Aug 15 18:22:33 2012 +0200 -+++ b/src/nepi/testbeds/ns3/ns3_bindings_import.py Thu Aug 16 19:02:36 2012 +0200 -@@ -16,7 +16,7 @@ - #from ns.click import * - from ns.mobility import * - from ns.wifi import * --from ns.netanim import * -+#from ns.netanim import * - from ns.stats import * - from ns.uan import * - from ns.spectrum import * -diff -r f860e2eac903 src/nepi/testbeds/planetlab/application.py ---- a/src/nepi/testbeds/planetlab/application.py Wed Aug 15 18:22:33 2012 +0200 -+++ b/src/nepi/testbeds/planetlab/application.py Thu Aug 16 19:02:36 2012 +0200 -@@ -907,10 +907,12 @@ - # We have to download the sources, untar, build... - #pygccxml_source_url = "http://leaseweb.dl.sourceforge.net/project/pygccxml/pygccxml/pygccxml-1.0/pygccxml-1.0.0.zip" - pygccxml_source_url = "http://yans.pl.sophia.inria.fr/libs/pygccxml-1.0.0.zip" -- ns3_source_url = "http://nepi.inria.fr/code/nepi-ns3.13/archive/tip.tar.gz" -+ #ns3_source_url = "http://nepi.inria.fr/code/nepi-ns3.13/archive/tip.tar.gz" -+ ns3_source_url = "http://nepi.inria.fr/code/nepi-ns3.fdnetdev/archive/tip.tar.gz" - passfd_source_url = "http://nepi.inria.fr/code/python-passfd/archive/tip.tar.gz" - -- pybindgen_version = "797" -+ #pybindgen_version = "797" -+ pybindgen_version = "809" - - self.build =( - " ( " -@@ -927,21 +929,21 @@ - "echo '7158877faff2254e6c094bf18e6b4283cac19137 pygccxml-1.0.0.zip' > archive_sums.txt && " - " ( " # check existing files - " sha1sum -c archive_sums.txt && " -- " test -f passfd-src.tar.gz && " -+ " test -f passfd.tar.gz && " - " test -f ns3-src.tar.gz " - " ) || ( " # nope? re-download -- " rm -rf pybindgen pygccxml-1.0.0.zip passfd-src.tar.gz ns3-src.tar.gz && " -+ " rm -rf pybindgen pygccxml-1.0.0.zip passfd.tar.gz ns3-src.tar.gz && " - " bzr checkout lp:pybindgen -r %(pybindgen_version)s && " # continue, to exploit the case when it has already been dl'ed - " wget -q -c -O pygccxml-1.0.0.zip %(pygccxml_source_url)s && " -- " wget -q -c -O passfd-src.tar.gz %(passfd_source_url)s && " -+ " wget -q -c -O passfd.tar.gz %(passfd_source_url)s && " - " wget -q -c -O ns3-src.tar.gz %(ns3_source_url)s && " - " sha1sum -c archive_sums.txt " # Check SHA1 sums when applicable - " ) && " - "unzip -n pygccxml-1.0.0.zip && " - "mkdir -p ns3-src && " -- "mkdir -p passfd-src && " -+ "mkdir -p passfd && " - "tar xzf ns3-src.tar.gz --strip-components=1 -C ns3-src && " -- "tar xzf passfd-src.tar.gz --strip-components=1 -C passfd-src && " -+ "tar xzf passfd.tar.gz --strip-components=1 -C passfd && " - "rm -rf target && " # mv doesn't like unclean targets - "mkdir -p target && " - "cd pygccxml-1.0.0 && " -@@ -957,12 +959,12 @@ - "./waf clean && " - "mv -f ${BUILD}/target/lib/python*/site-packages/pybindgen ${BUILD}/target/. && " - "rm -rf ${BUILD}/target/lib && " -- "cd ../passfd-src && " -+ "cd ../passfd && " - "python setup.py build && " - "python setup.py install --install-lib ${BUILD}/target && " - "python setup.py clean && " - "cd ../ns3-src && " -- "./waf configure --prefix=${BUILD}/target --with-pybindgen=../pybindgen-src -d release --disable-examples --disable-tests && " -+ "./waf configure --prefix=${BUILD}/target --with-pybindgen=../pybindgen -d release --disable-examples --disable-tests && " - "./waf &&" - "./waf install && " - "rm -f ${BUILD}/target/lib/*.so && " diff --git a/misc/planetlab_sfa.py b/misc/planetlab_sfa.py deleted file mode 100644 index 7a0912d3..00000000 --- a/misc/planetlab_sfa.py +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import getpass -from nepi.core.design import ExperimentDescription, FactoriesProvider -from nepi.core.execute import ExperimentController -from nepi.util import proxy -from nepi.util.constants import DeploymentConfiguration as DC -import os -import shutil -import tempfile -import time - -root_dir = tempfile.mkdtemp() -netns_root_dir = os.path.join(root_dir, "netns") -os.makedirs(netns_root_dir) -user = getpass.getuser() -slicename = os.environ["PL_SLICE"] -slicehrn = os.environ["PL_SLICE_HRN"] -plchost = os.environ["PL_HOST"] -port_base = 2000 + (os.getpid() % 1000) * 13 -pl_ssh_key = os.environ.get( - "PL_SSH_KEY", - "%s/.ssh/id_rsa_planetlab" % (os.environ['HOME'],) ) -pl_user = os.environ.get('PL_USER') -pl_pwd = os.environ.get('PL_PASS') - -exp_desc = ExperimentDescription() - -pl_provider = FactoriesProvider("planetlab") -pl_desc = exp_desc.add_testbed_description(pl_provider) -pl_desc.set_attribute_value("homeDirectory", root_dir) -pl_desc.set_attribute_value("slice", slicename) -pl_desc.set_attribute_value("sliceHrn", slicehrn) -pl_desc.set_attribute_value("sfa", True) -pl_desc.set_attribute_value("sliceSSHKey", pl_ssh_key) -pl_desc.set_attribute_value("authUser", pl_user) -pl_desc.set_attribute_value("authPass", pl_pwd) -pl_desc.set_attribute_value("plcHost", plchost) -pl_desc.set_attribute_value("tapPortBase", port_base) -pl_desc.set_attribute_value("p2pDeployment", False) # it's interactive, we don't want it in tests -pl_desc.set_attribute_value("cleanProc", True) -pl_desc.set_attribute_value("plLogLevel", "DEBUG") - -pl_inet = pl_desc.create("Internet") - -pl_node = pl_desc.create("Node") -pl_iface = pl_desc.create("NodeInterface") -pl_iface.connector("inet").connect(pl_inet.connector("devs")) -pl_node.connector("devs").connect(pl_iface.connector("node")) - -app = pl_desc.create("Application") -app.set_attribute_value("command", "ping -qc1 173.194.34.51") -app.enable_trace("stdout") -app.connector("node").connect(pl_node.connector("apps")) - -xml = exp_desc.to_xml() - -controller = ExperimentController(xml, root_dir) -controller.start() -while not controller.is_finished(app.guid): - time.sleep(0.5) - -ping_result = controller.trace(app.guid, "stdout") -print ping_result - -controller.stop() -controller.shutdown() - diff --git a/src/nepi/testbeds/planetlab/node.py b/src/nepi/testbeds/planetlab/node.py index a924e125..a73f6ab7 100644 --- a/src/nepi/testbeds/planetlab/node.py +++ b/src/nepi/testbeds/planetlab/node.py @@ -619,9 +619,7 @@ class Node(object): for cmd in cmds: (out,err),proc = server.popen_ssh_command( # Some apps need two kills - cmd % { - 'slicename' : self.slicename , - }, + cmd, host = self.hostip, port = None, user = self.slicename, @@ -820,8 +818,9 @@ class Node(object): def check_bad_host(self, out, err): badre = re.compile(r'(?:' - r"curl: [(]\d+[)] Couldn't resolve host 'download1[.]rpmfusion[.]org'" + #r"curl: [(]\d+[)] Couldn't resolve host 'download1[.]rpmfusion[.]org'" r'|Error: disk I/O error' r')', re.I) return badre.search(out) or badre.search(err) + diff --git a/src/nepi/util/server.py b/src/nepi/util/server.py index ed9bccd3..1c09874b 100644 --- a/src/nepi/util/server.py +++ b/src/nepi/util/server.py @@ -662,11 +662,6 @@ def popen_ssh_command(command, host, port, user, agent, if err.strip().startswith('ssh: ') or err.strip().startswith('mux_client_hello_exchange: '): # SSH error, can safely retry continue - elif : - ControlSocket /tmp/nepi_ssh-inria_alina@planetlab04.cnds.unibe.ch:22 already exists, disabling multiplexing - # SSH error, can safely retry (but need to delete controlpath file) - # TODO: delete file - continue elif retry: # Probably timed out or plain failed but can retry continue diff --git a/util_scripts/pl_maintenance.py b/util_scripts/pl_maintenance.py deleted file mode 100644 index a01558c3..00000000 --- a/util_scripts/pl_maintenance.py +++ /dev/null @@ -1,62 +0,0 @@ -import nepi.testbeds.planetlab.plcapi -from optparse import OptionParser, SUPPRESS_HELP -import os -import subprocess - -def do_maintenance(slicename, hostnames): - for hostname in hostnames: - login = "%s@%s" % (slicename, hostname) - command = 'sudo yum reinstall -y --nogpgcheck fedora-release' - proc = subprocess.Popen(['ssh', '-t', '-o', 'StrictHostKeyChecking=no', login, command], - stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell = False) - retcode = proc.wait() - print hostname - print retcode - if retcode > 0: - print proc.stdout.read() - print proc.stderr.read() - -def run(slicename, plc_host, pl_user, pl_pwd, pl_ssh_key): - api = nepi.testbeds.planetlab.plcapi.plcapi(pl_user, pl_pwd, plc_host, - "https://%(hostname)s:443/PLCAPI/") - node_ids = api.GetSliceNodes(slicename) - hostnames = [d['hostname'] for d in api.GetNodes(node_ids, ['hostname'])] - - do_maintenance(slicename, hostnames) - - -if __name__ == '__main__': - slicename = os.environ.get("PL_SLICE") - pl_host = os.environ.get("PL_HOST", "www.planet-lab.eu") - pl_ssh_key = os.environ.get( - "PL_SSH_KEY", - "%s/.ssh/id_rsa_planetlab" % (os.environ['HOME'],) ) - pl_user = os.environ.get('PL_USER') - pl_pwd = os.environ.get('PL_PASS') - - usage = "usage: %prog -s -H -k -u -p " - - parser = OptionParser(usage=usage) - parser.add_option("-s", "--slicename", dest="slicename", - help="PlanetLab slicename", default=slicename, type="str") - parser.add_option("-H", "--pl-host", dest="pl_host", - help="PlanetLab site (e.g. www.planet-lab.eu)", - default=pl_host, type="str") - parser.add_option("-k", "--ssh-key", dest="pl_ssh_key", - help="Path to private ssh key used for PlanetLab authentication", - default=pl_ssh_key, type="str") - parser.add_option("-u", "--pl-user", dest="pl_user", - help="PlanetLab account user (i.e. Registration email address)", - default=pl_user, type="str") - parser.add_option("-p", "--pl-pwd", dest="pl_pwd", - help="PlanetLab account password", default=pl_pwd, type="str") - (options, args) = parser.parse_args() - - slicename = options.slicename - pl_host = options.pl_host - pl_user= options.pl_user - pl_pwd = options.pl_pwd - pl_ssh_key = options.pl_ssh_key - - run(slicename, pl_host, pl_user, pl_pwd, pl_ssh_key) - diff --git a/util_scripts/tunbench.py b/util_scripts/tunbench.py deleted file mode 100644 index 63d842f1..00000000 --- a/util_scripts/tunbench.py +++ /dev/null @@ -1,90 +0,0 @@ -import os -import sys -import threading -import time -import cProfile -import pstats - -from nepi.util import tunchannel - -remote = open("/dev/zero","r+b") -tun = open("/dev/zero","r+b") - -def rwrite(remote, packet, remote_fd = remote.fileno(), os_write=os.write, len=len): - global bytes - bytes += len(packet) - return os_write(remote_fd, packet) - -def rread(remote, maxlen, remote_fd = remote.fileno(), os_read=os.read): - global bytes - rv = os_read(remote_fd, maxlen) - bytes += len(rv) - return rv - -def test(cipher, passphrase, plr=None, queuemodule=None): - if plr: - import random - def accept(packet, direction, rng=random.random): - return rng() > 0.5 - else: - accept = None - if queuemodule: - import os, os.path - sys.path.append(os.path.join( - os.path.dirname(__file__), - 'src','nepi','testbeds','planetlab','scripts')) - queuemodule = __import__(queuemodule) - queueclass = queuemodule.queueclass - else: - queueclass = None - TERMINATE = [] - SUSPEND = [] - - def stopme(): - time.sleep(100) - TERMINATE.append(None) - - t = threading.Thread(target=stopme) - t.start() - tunchannel.tun_fwd(tun, remote, True, True, passphrase, True, TERMINATE, - SUSPEND, None, tunkqueue=500, rwrite = rwrite, rread = rread, - cipher=cipher, queueclass=queueclass, accept_local = accept, - accept_remote = accept) - -# Swallow exceptions on decryption -def decrypt(packet, crypter, super=tunchannel.decrypt): - try: - return super(packet, crypter) - except: - return packet -tunchannel.decrypt = decrypt - -for cipher in (None, 'AES', 'Blowfish', 'DES', 'DES3'): - if cipher is None: - passphrase = None - else: - passphrase = 'Abracadabra' - bytes = 0 - cProfile.runctx('test(%r,%r)' % (cipher, passphrase),globals(),locals(),'tunchannel.%s.profile' % (cipher,)) - - print "Profile (%s):" % ( cipher, ) - pstats.Stats('tunchannel.%s.profile' % cipher).strip_dirs().sort_stats('time').print_stats() - - print "Bandwidth (%s): %.4fMb/s" % ( cipher, bytes / 200.0 * 8 / 2**20, ) - -bytes = 0 -cProfile.runctx('test(None,None,0.5)',globals(),locals(),'tunchannel.plr.profile') - -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') - -print "Profile (TOS):" -pstats.Stats('tunchannel.tos.profile').strip_dirs().sort_stats('time').print_stats() - -print "Bandwidth (TOS): %.4fMb/s" % ( bytes / 200.0 * 8 / 2**20, ) -