Updated ccnx allowed versions to 0.6.0 and 0.7.1 for PlanetLab CCNxDaemon
authorAlina Quereilhac <alina.quereilhac@inria.fr>
Sat, 13 Apr 2013 10:38:11 +0000 (12:38 +0200)
committerAlina Quereilhac <alina.quereilhac@inria.fr>
Sat, 13 Apr 2013 10:38:11 +0000 (12:38 +0200)
examples/ccnx/planetlab_ccnx_unicast.py
examples/streamming/planetlab_ccn_vlc.py
src/nepi/testbeds/planetlab/application.py
src/nepi/testbeds/planetlab/metadata.py
src/nepi/util/server.py

index ca11e07..d7f5f83 100644 (file)
@@ -68,8 +68,7 @@ def create_node(hostname, pl_inet, slice_desc):
 def create_ccnd(pl_node, port, routes, slice_desc):
     pl_app = slice_desc.create("CCNxDaemon")
     
-    # We can specify a default ccnx version to be either ccnx-0.5.1 or ccnx-0.6.0
-    #pl_app.set_attribute_value("ccnxVersion", "ccnx-0.5.1")
+    # We can specify a default ccnx version to be either 0.6.0 or 0.7.1
     # We can also specify a custom local source and build and install directives
     path_to_source = os.path.join(os.path.dirname(os.path.abspath(__file__)),
         "ccnx-0.6.0rc3.tar.gz")
index 91f004f..95587e2 100644 (file)
@@ -63,7 +63,7 @@ def create_node(hostname, pl_inet, slice_desc):
 
 def create_ccnd(pl_node, slice_desc, pl_ifaces, port):
     pl_app = slice_desc.create("CCNxDaemon")
-    pl_app.set_attribute_value("ccnxVersion", "ccnx-0.5.1")
+    pl_app.set_attribute_value("ccnxVersion", "0.7.1")
     
     # We use a wildcard to replace the public IP address of the node during runtime,
     # once this IP is known
index f4c3b2f..e9a823a 100644 (file)
@@ -600,7 +600,7 @@ class Dependency(object):
             except RuntimeError, e:
                 if self.check_bad_host(e.args[0], e.args[1]):
                     self.node.blacklist()
-                raise RuntimeError, "Failed install build sources on node %s: %s %s. command %s" % (
+                raise RuntimeError, "Failed install build sources on node %s: %s %s. COMMAND %s" % (
                         self.node.hostname, e.args[0], e.args[1], command)
 
     def set_master(self, master):
@@ -1128,65 +1128,33 @@ class CCNxDaemon(Application):
         # Attributes
         self.ccnLocalPort = None
         self.ccnRoutes = None
-        self.ccnxVersion = "ccnx-0.6.0"
+        self.ccnxVersion = "0.7.1"
         
-        #self.ccnx_0_5_1_sources = "http://www.ccnx.org/releases/ccnx-0.5.1.tar.gz"
-        self.ccnx_0_5_1_sources = "http://yans.pl.sophia.inria.fr/libs/ccnx-0.5.1.tar.gz"
-        #self.ccnx_0_6_0_sources = "http://www.ccnx.org/releases/ccnx-0.6.0.tar.gz"
-        self.ccnx_0_6_0_sources = "http://yans.pl.sophia.inria.fr/libs/ccnx-0.6.0.tar.gz"
-        #self.buildDepends = 'make gcc development-tools openssl-devel expat-devel libpcap-devel libxml2-devel'
+        #self.ccnx_0_6_0_sources = "http://yans.pl.sophia.inria.fr/libs/ccnx-0.6.0.tar.gz"
+        self.ccnx_sources = "http://www.ccnx.org/releases/ccnx-%s.tar.gz"
         self.buildDepends = 'make gcc openssl-devel expat-devel libpcap-devel libxml2-devel'
 
-        self.ccnx_0_5_1_build = (
+        self.ccnx_build = (
             " ( "
             "  cd .. && "
-            "  test -d ccnx-0.5.1-src/build/bin "
+            "  test -d ccnx-src/build/bin "
             " ) || ( "
                 # Not working, rebuild
                 "("
-                     " mkdir -p ccnx-0.5.1-src && "
-                     " wget -q -c -O ccnx-0.5.1-src.tar.gz %(ccnx_source_url)s &&"
-                     " tar xf ccnx-0.5.1-src.tar.gz --strip-components=1 -C ccnx-0.5.1-src "
+                     " mkdir -p ccnx-src && "
+                     " wget -q -c -O ccnx-src.tar.gz %(ccnx_source_url)s &&"
+                     " tar xf ccnx-src.tar.gz --strip-components=1 -C ccnx-src "
                 ") && "
-                     "cd ccnx-0.5.1-src && "
-                     "mkdir -p build/include &&"
-                     "mkdir -p build/lib &&"
-                     "mkdir -p build/bin &&"
-                     "I=$PWD/build && "
-                     "INSTALL_BASE=$I ./configure &&"
-                     "make && make install"
-             " )") % dict(
-                     ccnx_source_url = server.shell_escape(self.ccnx_0_5_1_sources),
-                )
-
-        self.ccnx_0_5_1_install = (
-            " ( "
-            "  test -d ${BUILD}/ccnx-0.5.1-src/build/bin && "
-            "  cp -r ${BUILD}/ccnx-0.5.1-src/build/bin ${SOURCES}"
-            " )"
-        )
-
-        self.ccnx_0_6_0_build = (
-            " ( "
-            "  cd .. && "
-            "  test -d ccnx-0.6.0-src/build/bin "
-            " ) || ( "
-                # Not working, rebuild
-                "("
-                     " mkdir -p ccnx-0.6.0-src && "
-                     " wget -q -c -O ccnx-0.6.0-src.tar.gz %(ccnx_source_url)s &&"
-                     " tar xf ccnx-0.6.0-src.tar.gz --strip-components=1 -C ccnx-0.6.0-src "
-                ") && "
-                     "cd ccnx-0.6.0-src && "
+                     "cd ccnx-src && "
                      "./configure && make"
              " )") % dict(
-                     ccnx_source_url = server.shell_escape(self.ccnx_0_6_0_sources),
+                     ccnx_source_url = server.shell_escape(self.ccnx_sources % self.ccnxVersion),
                 )
 
-        self.ccnx_0_6_0_install = (
+        self.ccnx_install = (
             " ( "
-            "  test -d ${BUILD}/ccnx-0.6.0-src/bin && "
-            "  cp -r ${BUILD}/ccnx-0.6.0-src/bin ${SOURCES}"
+            "  test -d ${BUILD}/ccnx-src/bin && "
+            "  cp -r ${BUILD}/ccnx-src/bin ${SOURCES}"
             " )"
         )
 
@@ -1195,16 +1163,10 @@ class CCNxDaemon(Application):
     def setup(self):
         # setting ccn sources
         if not self.build:
-            if self.ccnxVersion == 'ccnx-0.6.0':
-                self.build = self.ccnx_0_6_0_build
-            elif self.ccnxVersion == 'ccnx-0.5.1':
-                self.build = self.ccnx_0_5_1_build
+            self.build = self.ccnx_build
 
         if not self.install:
-            if self.ccnxVersion == 'ccnx-0.6.0':
-                self.install = self.ccnx_0_6_0_install
-            elif self.ccnxVersion == 'ccnx-0.5.1':
-                self.install = self.ccnx_0_5_1_install
+                self.install = self.ccnx_install
 
         super(CCNxDaemon, self).setup()
 
index aae7a84..75b2bd1 100644 (file)
@@ -1211,10 +1211,10 @@ attributes = dict({
                 "name": "ccnxVersion",
                 "help": "Version of ccnx source code to install in the node.",
                 "type": Attribute.ENUM, 
-                "value": "ccnx-0.6.0",
+                "value": "0.6.0",
                 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
-                "allowed": ["ccnx-0.6.0",
-                            "ccnx-0.5.1"],
+                "allowed": ["0.6.0",
+                            "0.7.1"],
                 "validation_function": validation.is_enum,
             }),
      "ccnlocalport" : dict({
index 9ef92b8..128ea45 100644 (file)
@@ -606,21 +606,17 @@ def popen_ssh_command(command, host, port, user, agent,
         timeout = None,
         retry = 0,
         err_on_timeout = True,
-        connect_timeout = 60,
+        connect_timeout = 90,
         persistent = True,
         hostip = None):
     """
     Executes a remote commands, returns ((stdout,stderr),process)
     """
-    if TRACE:
-        print "ssh", host, command
-    
+   
     tmp_known_hosts = None
     args = ['ssh', '-C',
             # Don't bother with localhost. Makes test easier
             '-o', 'NoHostAuthenticationForLocalhost=yes',
-            # XXX: Security vulnerability
-            #'-o', 'StrictHostKeyChecking=no',
             '-o', 'ConnectTimeout=%d' % (int(connect_timeout),),
             '-o', 'ConnectionAttempts=3',
             '-o', 'ServerAliveInterval=30',
@@ -630,7 +626,7 @@ def popen_ssh_command(command, host, port, user, agent,
         args.extend([
             '-o', 'ControlMaster=auto',
             '-o', 'ControlPath=/tmp/nepi_ssh-%r@%h:%p',
-            '-o', 'ControlPersist=60' ])
+            '-o', 'ControlPersist=90' ])
     if agent:
         args.append('-A')
     if port:
@@ -646,7 +642,6 @@ def popen_ssh_command(command, host, port, user, agent,
             server_key, host, port, args)
     args.append(command)
 
-
     for x in xrange(retry or 3):
         # connects to the remote host and starts a remote connection
         proc = subprocess.Popen(args, 
@@ -660,9 +655,10 @@ def popen_ssh_command(command, host, port, user, agent,
     
         try:
             out, err = _communicate(proc, stdin, timeout, err_on_timeout)
+            if TRACE:
+                print "COMMAND host %s, command %s, out %s, error %s" % (host, " ".join(args), out, err)
+
             if proc.poll():
-                if TRACE:
-                    print "COMMAND host %s, command %s, error %s" % (host, " ".join(args), err)
                 if err.strip().startswith('ssh: ') or err.strip().startswith('mux_client_hello_exchange: '):
                     # SSH error, can safely retry
                     continue
@@ -672,15 +668,13 @@ def popen_ssh_command(command, host, port, user, agent,
             break
         except RuntimeError,e:
             if TRACE:
-                print "COMMAND host %s, command %s, error %s" % (host, " ".join(args), err)
-                print " timedout -> ", e.args
+                print "EXCEPTION host %s, command %s, out %s, error %s, exception TIMEOUT ->  %s" % (
+                        host, " ".join(args), out, err, e.args)
+
             if retry <= 0:
                 raise
             retry -= 1
         
-    if TRACE:
-        print " -> ", out, err
-
     return ((out, err), proc)
 
 def popen_scp(source, dest, 
@@ -740,9 +734,7 @@ def popen_scp(source, dest,
         args = ['ssh', '-l', user, '-C',
                 # Don't bother with localhost. Makes test easier
                 '-o', 'NoHostAuthenticationForLocalhost=yes',
-                # XXX: Security vulnerability
-                #'-o', 'StrictHostKeyChecking=no',
-                '-o', 'ConnectTimeout=60',
+                '-o', 'ConnectTimeout=90',
                 '-o', 'ConnectionAttempts=3',
                 '-o', 'ServerAliveInterval=30',
                 '-o', 'TCPKeepAlive=yes',
@@ -876,9 +868,7 @@ def popen_scp(source, dest,
         args = ['scp', '-q', '-p', '-C',
                 # Don't bother with localhost. Makes test easier
                 '-o', 'NoHostAuthenticationForLocalhost=yes',
-                # XXX: Security vulnerability
-                #'-o', 'StrictHostKeyChecking=no',
-                '-o', 'ConnectTimeout=60',
+                '-o', 'ConnectTimeout=90',
                 '-o', 'ConnectionAttempts=3',
                 '-o', 'ServerAliveInterval=30',
                 '-o', 'TCPKeepAlive=yes' ]