update OMF RM to pass the test. Change status of the rm to fnish after it stops
authorJulien Tribino <julien.tribino@inria.fr>
Thu, 3 Oct 2013 17:11:52 +0000 (19:11 +0200)
committerJulien Tribino <julien.tribino@inria.fr>
Thu, 3 Oct 2013 17:11:52 +0000 (19:11 +0200)
src/nepi/resources/omf/application.py
src/nepi/resources/omf/channel.py
src/nepi/resources/omf/interface.py
src/nepi/resources/omf/node.py
test/resources/omf/vlc.py

index a65c775..da8f64f 100644 (file)
@@ -206,6 +206,7 @@ class OMFApplication(OMFResource):
             #raise
 
         super(OMFApplication, self).stop()
+        self.set_finished()
 
     def release(self):
         """ Clean the RM at the end of the experiment and release the API.
index e02593e..2a44b0d 100644 (file)
@@ -189,6 +189,7 @@ class OMFChannel(OMFResource):
 
         """
         super(OMFChannel, self).stop()
+        self.set_finished()
 
     def release(self):
         """ Clean the RM at the end of the experiment and release the API
index 08d39ec..4e1a66d 100644 (file)
@@ -212,6 +212,23 @@ class OMFWifiInterface(OMFResource):
         super(OMFWifiInterface, self).deploy()
         return True
 
+
+    def start(self):
+        """ Start the RM. It means nothing special for a channel for now
+        It becomes STARTED as soon as this method starts.
+
+        """
+
+        super(OMFWifiInterface, self).start()
+
+    def stop(self):
+        """ Stop the RM. It means nothing special for a channel for now
+        It becomes STOPPED as soon as this method is called
+
+        """
+        super(OMFWifiInterface, self).stop()
+        self.set_finished()
+
     def release(self):
         """ Clean the RM at the end of the experiment and release the API
 
index 840cfe1..99bedf6 100644 (file)
@@ -157,6 +157,7 @@ class OMFNode(OMFResource):
 
         """
         super(OMFNode, self).stop()
+        self.set_finished()
 
     def release(self):
         """Clean the RM at the end of the experiment
index a42f566..a3053f5 100755 (executable)
@@ -45,7 +45,7 @@ class OMFResourceFactoryTestCase(unittest.TestCase):
     def test_creation_phase(self):
 
         self.assertEquals(OMFNode.rtype(), "OMFNode")
-        self.assertEquals(len(OMFNode._attributes), 11)
+        self.assertEquals(len(OMFNode._attributes), 5)
 
         self.assertEquals(OMFWifiInterface.rtype(), "OMFWifiInterface")
         self.assertEquals(len(OMFWifiInterface._attributes), 9)
@@ -54,7 +54,7 @@ class OMFResourceFactoryTestCase(unittest.TestCase):
         self.assertEquals(len(OMFChannel._attributes), 5)
 
         self.assertEquals(OMFApplication.rtype(), "OMFApplication")
-        self.assertEquals(len(OMFApplication._attributes), 8)
+        self.assertEquals(len(OMFApplication._attributes), 9)
 
 
 class OMFEachTestCase(unittest.TestCase):