Adding +x to unti test files
[nepi.git] / test / resources / linux / ns3 / ns3client.py
old mode 100644 (file)
new mode 100755 (executable)
index 404fc5d..8fad928
@@ -38,9 +38,20 @@ import threading
 import time
 import unittest
 
+class DummySimulation(object):
+    def __init__(self, socket_name):
+        self.socket_name = socket_name
+        self.node = dict({'hostname': 'localhost'})
+
+    @property
+    def remote_socket(self):
+        return self.socket_name
+
 class LinuxNS3ClientTest(unittest.TestCase):
     def setUp(self):
         self.socket_name = os.path.join("/", "tmp", "NS3WrapperServer.sock")
+        if os.path.exists(self.socket_name):
+            os.remove(self.socket_name) 
 
     def tearDown(self):
         os.remove(self.socket_name) 
@@ -57,8 +68,11 @@ class LinuxNS3ClientTest(unittest.TestCase):
         # Verify that the communication socket was created
         self.assertTrue(os.path.exists(self.socket_name))
 
+        # Create a dummy simulation object
+        simulation = DummySimulation(self.socket_name) 
+
         # Instantiate the NS3 client
-        client = LinuxNS3Client(self.socket_name)
+        client = LinuxNS3Client(simulation)
  
         # Define a real time simulation 
         stype = client.create("StringValue", "ns3::RealtimeSimulatorImpl")
@@ -179,6 +193,7 @@ class LinuxNS3ClientTest(unittest.TestCase):
         # wait until simulation is over
         client.shutdown()
 
+        ## TODO: Add assertions !!
 
 if __name__ == '__main__':
     unittest.main()