use print() - import print_function - should be fine for both py2 and py3
[nepi.git] / test / resources / omf / omf5_vlc_normal_case.py
index 14a2ad0..763b026 100755 (executable)
@@ -4,9 +4,8 @@
 #    Copyright (C) 2013 INRIA
 #
 #    This program is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation, either version 3 of the License, or
-#    (at your option) any later version.
+#    it under the terms of the GNU General Public License version 2 as
+#    published by the Free Software Foundation;
 #
 #    This program is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -36,23 +35,23 @@ import unittest
 class OMFResourceFactoryTestCase(unittest.TestCase):
     def test_creation_phase(self):
 
-        self.assertEquals(OMFNode.get_rtype(), "OMFNode")
-        self.assertEquals(len(OMFNode._attributes), 7)
+        self.assertEquals(OMFNode.get_rtype(), "omf::Node")
+        self.assertEquals(len(OMFNode._attributes), 8)
 
-        self.assertEquals(OMFWifiInterface.get_rtype(), "OMFWifiInterface")
-        self.assertEquals(len(OMFWifiInterface._attributes), 11)
+        self.assertEquals(OMFWifiInterface.get_rtype(), "omf::WifiInterface")
+        self.assertEquals(len(OMFWifiInterface._attributes), 12)
 
-        self.assertEquals(OMFChannel.get_rtype(), "OMFChannel")
-        self.assertEquals(len(OMFChannel._attributes), 7)
+        self.assertEquals(OMFChannel.get_rtype(), "omf::Channel")
+        self.assertEquals(len(OMFChannel._attributes), 8)
 
-        self.assertEquals(OMFApplication.get_rtype(), "OMFApplication")
-        self.assertEquals(len(OMFApplication._attributes), 13)
+        self.assertEquals(OMFApplication.get_rtype(), "omf::Application")
+        self.assertEquals(len(OMFApplication._attributes), 14)
 
 class OMFEachTestCase(unittest.TestCase):
     def setUp(self):
         self.ec = ExperimentController(exp_id = "99999")
 
-        self.node1 = self.ec.register_resource("OMFNode")
+        self.node1 = self.ec.register_resource("omf::Node")
         self.ec.set(self.node1, 'hostname', 'omf.plexus.wlab17')
         self.ec.set(self.node1, 'xmppUser', "nepi")
         self.ec.set(self.node1, 'xmppServer', "xmpp-plexus.onelab.eu")
@@ -60,7 +59,7 @@ class OMFEachTestCase(unittest.TestCase):
         self.ec.set(self.node1, 'xmppPassword', "1234")
         self.ec.set(self.node1, 'version', "5")
         
-        self.iface1 = self.ec.register_resource("OMFWifiInterface")
+        self.iface1 = self.ec.register_resource("omf::WifiInterface")
         self.ec.set(self.iface1, 'name', "wlan0")
         self.ec.set(self.iface1, 'mode', "adhoc")
         self.ec.set(self.iface1, 'hw_mode', "g")
@@ -68,7 +67,7 @@ class OMFEachTestCase(unittest.TestCase):
         self.ec.set(self.iface1, 'ip', "10.0.0.17/24")
         self.ec.set(self.iface1, 'version', "5")
         
-        self.channel = self.ec.register_resource("OMFChannel")
+        self.channel = self.ec.register_resource("omf::Channel")
         self.ec.set(self.channel, 'channel', "6")
         self.ec.set(self.channel, 'xmppUser', "nepi")
         self.ec.set(self.channel, 'xmppServer', "xmpp-plexus.onelab.eu")
@@ -76,22 +75,22 @@ class OMFEachTestCase(unittest.TestCase):
         self.ec.set(self.channel, 'xmppPassword', "1234")
         self.ec.set(self.channel, 'version', "5")
         
-        self.app1 = self.ec.register_resource("OMFApplication")
+        self.app1 = self.ec.register_resource("omf::Application")
         self.ec.set(self.app1, 'appid', 'Vlc#1')
         self.ec.set(self.app1, 'command', "/opt/vlc-1.1.13/cvlc /opt/10-by-p0d.avi --sout '#rtp{dst=10.0.0.37,port=1234,mux=ts}'")
         self.ec.set(self.app1, 'env', "DISPLAY=localhost:10.0 XAUTHORITY=/root/.Xauthority")
         self.ec.set(self.app1, 'version', "5")
 
-        self.app2 = self.ec.register_resource("OMFApplication")
+        self.app2 = self.ec.register_resource("omf::Application")
         self.ec.set(self.app2, 'version', "5")
 
-        self.app3 = self.ec.register_resource("OMFApplication")
+        self.app3 = self.ec.register_resource("omf::Application")
         self.ec.set(self.app3, 'version', "5")
 
-        self.app4 = self.ec.register_resource("OMFApplication")
+        self.app4 = self.ec.register_resource("omf::Application")
         self.ec.set(self.app4, 'version', "5")
 
-        self.app5 = self.ec.register_resource("OMFApplication")
+        self.app5 = self.ec.register_resource("omf::Application")
         self.ec.set(self.app5, 'version', "5")
 
         self.ec.register_connection(self.app1, self.node1)
@@ -163,7 +162,7 @@ class OMFVLCNormalCase(unittest.TestCase):
     def test_deploy(self):
         ec = ExperimentController(exp_id = "5421" )
 
-        self.node1 = ec.register_resource("OMFNode")
+        self.node1 = ec.register_resource("omf::Node")
         ec.set(self.node1, 'hostname', 'omf.plexus.wlab17')
         ec.set(self.node1, 'xmppUser', "nepi")
         ec.set(self.node1, 'xmppServer', "xmpp-plexus.onelab.eu")
@@ -171,7 +170,7 @@ class OMFVLCNormalCase(unittest.TestCase):
         ec.set(self.node1, 'xmppPassword', "1234")
         ec.set(self.node1, 'version', "5")
         
-        self.iface1 = ec.register_resource("OMFWifiInterface")
+        self.iface1 = ec.register_resource("omf::WifiInterface")
         ec.set(self.iface1, 'name', "wlan0")
         ec.set(self.iface1, 'mode', "adhoc")
         ec.set(self.iface1, 'hw_mode', "g")
@@ -179,7 +178,7 @@ class OMFVLCNormalCase(unittest.TestCase):
         ec.set(self.iface1, 'ip', "10.0.0.17/24")
         ec.set(self.iface1, 'version', "5")
         
-        self.channel = ec.register_resource("OMFChannel")
+        self.channel = ec.register_resource("omf::Channel")
         ec.set(self.channel, 'channel', "6")
         ec.set(self.channel, 'xmppUser', "nepi")
         ec.set(self.channel, 'xmppServer', "xmpp-plexus.onelab.eu")
@@ -187,31 +186,31 @@ class OMFVLCNormalCase(unittest.TestCase):
         ec.set(self.channel, 'xmppPassword', "1234")
         ec.set(self.channel, 'version', "5")
         
-        self.app1 = ec.register_resource("OMFApplication")
+        self.app1 = ec.register_resource("omf::Application")
         ec.set(self.app1, 'appid', 'Vlc#1')
         ec.set(self.app1, 'command', "/opt/vlc-1.1.13/cvlc /opt/10-by-p0d.avi --sout '#rtp{dst=10.0.0.37,port=1234,mux=ts}'")
         ec.set(self.app1, 'env', "DISPLAY=localhost:10.0 XAUTHORITY=/root/.Xauthority")
         ec.set(self.app1, 'version', "5")
 
-        self.app2 = ec.register_resource("OMFApplication")
+        self.app2 = ec.register_resource("omf::Application")
         ec.set(self.app2, 'appid', 'Test#1')
         ec.set(self.app2, 'command', "/usr/bin/test -1")
         ec.set(self.app2, 'env', " ")
         ec.set(self.app2, 'version', "5")
 
-        self.app3 = ec.register_resource("OMFApplication")
+        self.app3 = ec.register_resource("omf::Application")
         ec.set(self.app3, 'appid', 'Test#2')
         ec.set(self.app3, 'command', "/usr/bin/test -2")
         ec.set(self.app3, 'env', " ")
         ec.set(self.app3, 'version', "5")
 
-        self.app4 = ec.register_resource("OMFApplication")
+        self.app4 = ec.register_resource("omf::Application")
         ec.set(self.app4, 'appid', 'Test#3')
         ec.set(self.app4, 'command', "/usr/bin/test -3")
         ec.set(self.app4, 'env', " ")
         ec.set(self.app4, 'version', "5")
 
-        self.app5 = ec.register_resource("OMFApplication")
+        self.app5 = ec.register_resource("omf::Application")
         ec.set(self.app5, 'appid', 'Kill#2')
         ec.set(self.app5, 'command', "/usr/bin/killall vlc")
         ec.set(self.app5, 'env', " ")