update OF code and examples
authorJulien Tribino <julien.tribino@inria.fr>
Mon, 25 Nov 2013 17:26:08 +0000 (18:26 +0100)
committerJulien Tribino <julien.tribino@inria.fr>
Mon, 25 Nov 2013 17:26:08 +0000 (18:26 +0100)
examples/openvswitch/ovs_ping_exp.py
src/nepi/execution/ec.py
src/nepi/resources/linux/application.py
src/nepi/resources/planetlab/openvswitch/ovs.py
src/nepi/resources/planetlab/openvswitch/ovsport.py

index b73e8ae..b07b383 100644 (file)
@@ -80,17 +80,17 @@ def add_app(ec, command, node):
     return app
 
 # Create the EC
-ec = ExperimentController(exp_id = "one")
+ec = ExperimentController(exp_id = "test")
 
 switch1 = "planetlab2.virtues.fi"
 switch2 = "planetlab2.upc.es"
 host1 = "planetlab2.ionio.gr"
-host2 = "planetlab2.diku.dk"
+host2 = "iraplab2.iralab.uni-karlsruhe.de"
 
 slicename = "inria_nepi"
 
 pl_user = os.environ.get("PL_USER")
-pl_password =  os.environ.get("PL_PASS")
+pl_password = os.environ.get("PL_PASS")
 
 s1_node = add_node(ec, switch1, slicename, pl_user, pl_password)
 s2_node = add_node(ec, switch2, slicename, pl_user, pl_password)
index 066e6b4..47110a4 100644 (file)
@@ -250,7 +250,7 @@ class ExperimentController(object):
         have reached a state >= STOPPED (i.e. STOPPED, FAILED or 
         RELEASED ), or until a failure in the experiment occurs 
         (i.e. abort == True) 
-
+        
             :param guids: List of guids
             :type guids: list
 
@@ -266,7 +266,7 @@ class ExperimentController(object):
         """ Blocking method that waits until all RMs in the 'guids' list 
         have reached a state >= STARTED, or until a failure in the 
         experiment occurs (i.e. abort == True) 
-
+        
             :param guids: List of guids
             :type guids: list
 
@@ -281,7 +281,7 @@ class ExperimentController(object):
     def wait_released(self, guids):
         """ Blocking method that waits until all RMs in the 'guids' list 
         have reached a state == RELEASED, or until the EC fails 
-
+        
             :param guids: List of guids
             :type guids: list
 
@@ -297,7 +297,7 @@ class ExperimentController(object):
         """ Blocking method that waits until all RMs in the 'guids' list 
         have reached a state >= READY, or until a failure in the 
         experiment occurs (i.e. abort == True) 
-
+        
             :param guids: List of guids
             :type guids: list
 
index a83393d..5ae8f0b 100644 (file)
@@ -43,25 +43,25 @@ class LinuxApplication(ResourceManager):
 
     .. note::
 
-    A LinuxApplication RM represents a process that can be executed in
-    a remote Linux host using SSH.
+        A LinuxApplication RM represents a process that can be executed in
+        a remote Linux host using SSH.
 
-    The LinuxApplication RM takes care of uploadin sources and any files
-    needed to run the experiment, to the remote host. 
-    It also allows to provide source compilation (build) and installation 
-    instructions, and takes care of automating the sources build and 
-    installation tasks for the user.
+        The LinuxApplication RM takes care of uploadin sources and any files
+        needed to run the experiment, to the remote host. 
+        It also allows to provide source compilation (build) and installation 
+        instructions, and takes care of automating the sources build and 
+        installation tasks for the user.
 
-    It is important to note that files uploaded to the remote host have
-    two possible scopes: single-experiment or multi-experiment.
-    Single experiment files are those that will not be re-used by other 
-    experiments. Multi-experiment files are those that will.
-    Sources and shared files are always made available to all experiments.
+        It is important to note that files uploaded to the remote host have
+        two possible scopes: single-experiment or multi-experiment.
+        Single experiment files are those that will not be re-used by other 
+        experiments. Multi-experiment files are those that will.
+        Sources and shared files are always made available to all experiments.
 
-    Directory structure:
+        Directory structure:
 
-    The directory structure used by LinuxApplication RM at the Linux
-    host is the following:
+        The directory structure used by LinuxApplication RM at the Linux
+        host is the following:
 
         ${HOME}/nepi-usr --> Base directory for multi-experiment files
                       |
index a201329..b3ce59d 100644 (file)
@@ -187,7 +187,7 @@ class OVSWitch(LinuxApplication):
         (out, err), proc = self.node.check_output(self.ovs_checks, 'start_srv_exitcode')
 
         if out != "0\n":
-            self.debug("Servers have not started")
+            self.error("Servers have not started")
             raise RuntimeError, msg    
                                
         cmd = "ps -A | grep ovsdb-server"
@@ -204,7 +204,7 @@ class OVSWitch(LinuxApplication):
         (out, err), proc = self.node.check_output(self.ovs_checks, 'status_srv_exitcode')
         
         if out != "0\n":
-            self.debug("Servers are not running")
+            self.error("Servers are not running")
             raise RuntimeError, msg
         
         self.info("Servers started")  
@@ -293,7 +293,7 @@ class OVSWitch(LinuxApplication):
         from nepi.resources.planetlab.openvswitch.ovsport import OVSPort
         rm = self.get_connected(OVSPort.get_rtype())
 
-        if rm[0].state < ResourceState.FINISHED:
+        if rm[0].state < ResourceState.STOPPED:
             self.ec.schedule(reschedule_delay, self.release)
             return 
             
index bb84af6..57b6f16 100644 (file)
@@ -209,7 +209,7 @@ class OVSPort(LinuxApplication):
         from nepi.resources.planetlab.openvswitch.tunnel import OVSTunnel
         rm = self.get_connected(OVSTunnel.get_rtype())
 
-        if rm and rm[0].state < ResourceState.FINISHED:
+        if rm and rm[0].state < ResourceState.STOPPED:
             self.ec.schedule(reschedule_delay, self.release)
             return