oops
authorLucia Guevgeozian Odizzio <lucia.guevgeozian_odizzio@inria.fr>
Fri, 21 Mar 2014 11:08:00 +0000 (12:08 +0100)
committerLucia Guevgeozian Odizzio <lucia.guevgeozian_odizzio@inria.fr>
Fri, 21 Mar 2014 11:08:00 +0000 (12:08 +0100)
Makefile
examples/linux/ccn/two_nodes_file_retrieval.py
src/nepi/resources/linux/ccn/ccnd.py
src/nepi/resources/linux/ccn/ccnr.py
src/nepi/resources/linux/node.py
test/resources/linux/node.py

index 039820b..24e5b15 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,11 @@ SUBBUILDDIR = $(shell python -c 'import distutils.util, sys; \
 PYTHON25 := $(shell python -c 'import sys; v = sys.version_info; \
     print (1 if v[0] <= 2 and v[1] <= 5 else 0)')
 
+ifeq ($(PYTHON25),0)
+BUILDDIR := $(BUILDDIR)/$(SUBBUILDDIR)
+else
 BUILDDIR := $(BUILDDIR)/lib
+endif
 
 PYPATH = $(BUILDDIR):$(TESTLIB):$(PYTHONPATH)
 COVERAGE = $(or $(shell which coverage), $(shell which python-coverage), \
index 1d406d2..8e40c3b 100755 (executable)
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 #
 #    NEPI, a framework to manage network experiments
 #    Copyright (C) 2014 INRIA
@@ -32,9 +31,8 @@ from nepi.execution.ec import ExperimentController
 
 import os
 
-#ssh_key = ####### <<< ASSING the absolute path to the private SSH key to login into the remote host >>>
-#ssh_user = ####### <<< ASSING the SSH username >>>
-ssh_user = "icnuser"
+ssh_key = ####### <<< ASSING the absolute path to the private SSH key to login into the remote host >>>
+ssh_user = ####### <<< ASSING the SSH username >>>
 
 ## Create the experiment controller
 ec = ExperimentController(exp_id = "demo_CCN")
@@ -42,32 +40,28 @@ ec = ExperimentController(exp_id = "demo_CCN")
 ## Register node 1
 node1 = ec.register_resource("LinuxNode")
 # Set the hostname of the first node to use for the experiment
-#hostname1 = "peeramidion.irisa.fr" ##### <<< ASSIGN the hostname of a host you have SSSH access to >>>
-hostname1 = "133.69.33.148"
+hostname1 = "peeramidion.irisa.fr" ##### <<< ASSIGN the hostname of a host you have SSSH access to >>>
 ec.set(node1, "hostname", hostname1)
 # username should be your SSH user 
 ec.set(node1, "username", ssh_user)
 # Absolute path to the SSH private key
-#ec.set(node1, "identity", ssh_key)
+ec.set(node1, "identity", ssh_key)
 # Clean all files, results, etc, from previous experiments wit the same exp_id
-#ec.set(node1, "cleanExperiment", True)
-ec.set(node1, "cleanHome", True)
+ec.set(node1, "cleanExperiment", True)
 # Kill all running processes in the node before running the experiment
 ec.set(node1, "cleanProcesses", True)
 
 ## Register node 2 
 node2 = ec.register_resource("LinuxNode")
 # Set the hostname of the first node to use for the experiment
-#hostname2 = "planetlab2.upc.es" ##### <<< ASSIGN the hostname of a host you have SSSH access to >>>
-hostname2 = "133.69.33.149"
+hostname2 = "planetlab2.upc.es" ##### <<< ASSIGN the hostname of a host you have SSSH access to >>>
 ec.set(node2, "hostname", hostname2)
 # username should be your SSH user 
 ec.set(node2, "username", ssh_user)
 # Absolute path to the SSH private key
-#ec.set(node2, "identity", ssh_key)
+ec.set(node2, "identity", ssh_key)
 # Clean all files, results, etc, from previous experiments wit the same exp_id
-#ec.set(node2, "cleanExperiment", True)
-ec.set(node2, "cleanHome", True)
+ec.set(node2, "cleanExperiment", True)
 # Kill all running processes in the node before running the experiment
 ec.set(node2, "cleanProcesses", True)
 
@@ -75,14 +69,12 @@ ec.set(node2, "cleanProcesses", True)
 ccnd1 = ec.register_resource("LinuxCCND")
 # Set ccnd log level to 7
 ec.set(ccnd1, "debug", 7)
-ec.set(ccnd1, "port", 9597)
 ec.register_connection(ccnd1, node1)
 
 ## Register a CCN daemon in node 2
 ccnd2 = ec.register_resource("LinuxCCND")
 # Set ccnd log level to 7
 ec.set(ccnd2, "debug", 7)
-ec.set(ccnd2, "port", 9597)
 ec.register_connection(ccnd2, node2)
 
 ## Register a repository in node 1
@@ -105,14 +97,12 @@ ec.register_connection(co, ccnr1)
 
 # Register a FIB entry from node 1 to node 2
 entry1 = ec.register_resource("LinuxFIBEntry")
-ec.set(entry1, "host", "10.0.32.2")
-ec.set(entry1, "port", 9597)
+ec.set(entry1, "host", hostname2)
 ec.register_connection(entry1, ccnd1)
 
 # Register a FIB entry from node 2 to node 1
 entry2 = ec.register_resource("LinuxFIBEntry")
-ec.set(entry2, "host", "10.0.0.2")
-ec.set(entry2, "port", 9597)
+ec.set(entry2, "host", hostname1)
 ec.register_connection(entry2, ccnd2)
 
 ## Retrieve the file stored in node 1 from node 2
index 44bc276..ffaee50 100644 (file)
@@ -136,10 +136,6 @@ class LinuxCCND(LinuxApplication):
     def path(self):
         return "PATH=$PATH:${BIN}/%s/" % self.version 
 
-    @property
-    def environment(self):
-        return self._environment()
-
     def do_deploy(self):
         if not self.node or self.node.state < ResourceState.READY:
             self.debug("---- RESCHEDULING DEPLOY ---- node state %s " % self.node.state )
index e839a56..9ac5cce 100644 (file)
@@ -296,7 +296,6 @@ class LinuxCCNR(LinuxApplication):
             })
 
         env = self.ccnd.path
-        #env = self.ccnd.path + self.ccnd.environment
         env += " ".join(map(lambda k: "%s=%s" % (envs.get(k), self.get(k)) \
             if self.get(k) else "", envs.keys()))
        
index 13cf076..8ad69f3 100644 (file)
@@ -681,7 +681,7 @@ class LinuxNode(ResourceManager):
         # If dst files should not be overwritten, check that the files do not
         # exits already
         if isinstance(src, str):
-            src = map(os.path.expanduser, map(str.strip, src.split(";")))
+            src = map(str.strip, src.split(";"))
     
         if overwrite == False:
             src = self.filter_existing_files(src, dst)
index 27b7817..e46f667 100755 (executable)
@@ -298,7 +298,7 @@ main (void)
         dirpath = tempfile.mkdtemp()
         f = tempfile.NamedTemporaryFile(dir=dirpath, delete=False)
         f.close()
-     
+      
         f1 = tempfile.NamedTemporaryFile(delete=False)
         f1.close()
         f1.name
@@ -310,8 +310,7 @@ main (void)
         node.copy(source, dest)
 
         command = "ls %s" % destdir
-       
-        import pdb;pdb.set_trace() 
+        
         (out, err), proc = node.execute(command)
 
         os.remove(f1.name)