search ns3 library and ns3 bindings in the environment variables
authorAlina Quereilhac <alina.quereilhac@inria.fr>
Thu, 31 Mar 2011 20:11:37 +0000 (22:11 +0200)
committerAlina Quereilhac <alina.quereilhac@inria.fr>
Thu, 31 Mar 2011 20:11:37 +0000 (22:11 +0200)
src/nepi/testbeds/ns3/execute.py
src/nepi/testbeds/ns3/metadata_v3_9_RC3.py

index 2a8cc0a..470f638 100644 (file)
@@ -150,12 +150,15 @@ class TestbedInstance(testbed_impl.TestbedInstance):
         import ctypes
         import imp
 
-        bindings = self._attributes.get_attribute_value("ns3Bindings")
-        libfile = self._attributes.get_attribute_value("ns3Library")
         simu_impl_type = self._attributes.get_attribute_value(
                 "SimulatorImplementationType")
         checksum = self._attributes.get_attribute_value("ChecksumEnabled")
 
+        bindings = os.environ["NEPI_NS3BINDINGS"] \
+                if "NEPI_NS3BINDINGS" in os.environ else None
+        libfile = os.environ["NEPI_NS3LIBRARY"] \
+                if "NEPI_NS3LIBRARY" in os.environ else None
+
         if libfile:
             ctypes.CDLL(libfile, ctypes.RTLD_GLOBAL)
 
index bb51495..8371b0b 100644 (file)
@@ -632,44 +632,30 @@ factories_order = ["ns3::BasicEnergySource",
  ]
 
 testbed_attributes = dict({
-        "ns3_bindings": dict({
-                "name": "ns3Bindings",
-                "help": "Location of the ns-3 python binding",
-                "type": Attribute.STRING,
-                "flags": Attribute.DesignOnly,
-                "validation_function": validation.is_string # TODO: validation.is_path
-            }),
-         "ns3_library": dict({
-                "name": "ns3Library",
-                "help": "Location of the ns-3 library .so file",
-                "type": Attribute.STRING,
-                "flags": Attribute.DesignOnly,
-                "validation_function": validation.is_string # TODO: validation.is_path
-            }),
-         "simu_impl_type": dict({
-                "name": "SimulatorImplementationType",
-                "help": "The object class to use as the simulator implementation",
-                "type": Attribute.STRING,
-                "flags": Attribute.DesignOnly,
-                "validation_function": validation.is_string
-            }),
-          "checksum": dict({
-                "name": "ChecksumEnabled",
-                "help": "A global switch to enable all checksums for all protocols",
-                "type": Attribute.BOOL,
-                "value": False,
-                "flags": Attribute.DesignOnly,
-                "validation_function": validation.is_bool
-            }),
-          "home_directory": dict({
-                "name": "homeDirectory",
-                "help": "Path to the directory where traces and other files \
-                        will be stored",
-                "type": Attribute.STRING,
-                "value": "",
-                "flags": Attribute.DesignOnly,
-                "validation_function": validation.is_string
-            })
+     "simu_impl_type": dict({
+            "name": "SimulatorImplementationType",
+            "help": "The object class to use as the simulator implementation",
+            "type": Attribute.STRING,
+            "flags": Attribute.DesignOnly,
+            "validation_function": validation.is_string
+        }),
+      "checksum": dict({
+            "name": "ChecksumEnabled",
+            "help": "A global switch to enable all checksums for all protocols",
+            "type": Attribute.BOOL,
+            "value": False,
+            "flags": Attribute.DesignOnly,
+            "validation_function": validation.is_bool
+        }),
+      "home_directory": dict({
+            "name": "homeDirectory",
+            "help": "Path to the directory where traces and other files \
+                    will be stored",
+            "type": Attribute.STRING,
+            "value": "",
+            "flags": Attribute.DesignOnly,
+            "validation_function": validation.is_string
+        })
 })
 
 class VersionedMetadataInfo(metadata.VersionedMetadataInfo):