From 546800f14d6a0670e5a25f4b94a4f4a90388c368 Mon Sep 17 00:00:00 2001 From: Julien Tribino Date: Thu, 3 Oct 2013 19:11:52 +0200 Subject: [PATCH] update OMF RM to pass the test. Change status of the rm to fnish after it stops --- src/nepi/resources/omf/application.py | 1 + src/nepi/resources/omf/channel.py | 1 + src/nepi/resources/omf/interface.py | 17 +++++++++++++++++ src/nepi/resources/omf/node.py | 1 + test/resources/omf/vlc.py | 4 ++-- 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/nepi/resources/omf/application.py b/src/nepi/resources/omf/application.py index a65c7756..da8f64fa 100644 --- a/src/nepi/resources/omf/application.py +++ b/src/nepi/resources/omf/application.py @@ -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. diff --git a/src/nepi/resources/omf/channel.py b/src/nepi/resources/omf/channel.py index e02593e7..2a44b0d9 100644 --- a/src/nepi/resources/omf/channel.py +++ b/src/nepi/resources/omf/channel.py @@ -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 diff --git a/src/nepi/resources/omf/interface.py b/src/nepi/resources/omf/interface.py index 08d39ec9..4e1a66da 100644 --- a/src/nepi/resources/omf/interface.py +++ b/src/nepi/resources/omf/interface.py @@ -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 diff --git a/src/nepi/resources/omf/node.py b/src/nepi/resources/omf/node.py index 840cfe18..99bedf67 100644 --- a/src/nepi/resources/omf/node.py +++ b/src/nepi/resources/omf/node.py @@ -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 diff --git a/test/resources/omf/vlc.py b/test/resources/omf/vlc.py index a42f5669..a3053f57 100755 --- a/test/resources/omf/vlc.py +++ b/test/resources/omf/vlc.py @@ -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): -- 2.43.0