pybindgen_version = Attribute("pybindgenVersion",
"Version of pybindgen to install from bazar repo",
+ #default = "864",
default = "868",
flags = Flags.Design)
self._socket_name = "ns3-%s.sock" % os.urandom(4).encode('hex')
self._dce_manager_helper_uuid = None
self._dce_application_helper_uuid = None
-
- # Lock used to synchronize usage of DceManagerHelper
- self.dce_manager_lock = threading.Lock()
- # Lock used to synchronize usage of DceApplicationHelper
- self.dce_application_lock = threading.Lock()
@property
def socket_name(self):
def remote_socket(self):
return os.path.join(self.run_home, self.socket_name)
- @property
- def dce_manager_helper_uuid(self):
- return self._dce_manager_helper_uuid
-
- @property
- def dce_application_helper_uuid(self):
- return self._dce_application_helper_uuid
-
@property
def ns3_build_home(self):
return os.path.join(self.node.bin_dir, "ns-3", self.get("ns3Version"),
stype = self.create("StringValue", sched_type)
self.invoke(GLOBAL_VALUE_UUID, "Bind", "SchedulerType", btrue)
- if self.get("enableDCE"):
- self._dce_manager_helper_uuid = self.create("DceManagerHelper")
- self._dce_application_helper_uuid = self.create("DceApplicationHelper")
-
def do_deploy(self):
if not self.node or self.node.state < ResourceState.READY:
self.debug("---- RESCHEDULING DEPLOY ---- node state %s " % self.node.state )
if self.get("populateRoutingTables") == True:
self.invoke(IPV4_GLOBAL_ROUTING_HELPER_UUID, "PopulateRoutingTables")
- self._client.start()
+ self._client.start()
+
+ # Wait until the Simulation starts...
+ is_running = False
+ for i in xrange(100):
+ is_running = self.invoke(SIMULATOR_UUID, "isRunning")
+
+ if is_running:
+ break
+ else:
+ time.sleep(1)
+ else:
+ if not is_running:
+ msg = " Simulation did not start"
+ self.error(msg)
+ raise RuntimeError
self.set_started()
else:
@property
def dce_repo(self):
- #return "http://code.nsnam.org/ns-3-dce"
- return "http://code.nsnam.org/epmancini/ns-3-dce"
+ return "http://code.nsnam.org/ns-3-dce"
+ #eturn "http://code.nsnam.org/epmancini/ns-3-dce"
@property
def _build(self):
'dce_repo': self.dce_repo
}
-
return (
# NS3 installation
"( "
" ( "
# If not, copy ns-3 build to bin
" cd ${SRC}/dce/ns-3-dce && "
+ " rm -rf ${SRC}/dce/ns-3-dce/build && "
" ./waf configure %(enable_opt)s --with-pybindgen=${SRC}/pybindgen/%(pybindgen_version)s "
" --prefix=%(ns3_build_home)s --with-ns3=%(ns3_build_home)s && "
" ./waf build && "
# If not, copy ns-3 build to bin
" mkdir -p %(ns3_build_home)s && "
" cd ${SRC}/ns-3/%(ns3_version)s && "
+ " rm -rf ${SRC}/ns-3/%(ns3_version)s/build && "
" ./waf configure -d %(build_mode)s --with-pybindgen=${SRC}/pybindgen/%(pybindgen_version)s "
" --prefix=%(ns3_build_home)s && "
" ./waf build && "
.replace("${HOME}", self.node.home_dir)
# If NS3LIBRARIES is defined and not empty, use that value,
# if not use ns3_build_home/lib/
- .replace("${BIN_DCE}", "${NS3LIBRARIES-%s/lib/}../bin_dce" % \
+ .replace("${BIN_DCE}", "${NS3LIBRARIES-%s/lib}/../bin_dce" % \
self.ns3_build_home)
)