from nepi.execution.attribute import Attribute, Flags, Types
from nepi.execution.trace import Trace, TraceAttr
from nepi.execution.resource import ResourceManager, clsinit_copy, \
- ResourceState, ResourceFactory, reschedule_delay
+ ResourceState, ResourceFactory
from nepi.resources.linux.application import LinuxApplication
from nepi.util.timefuncs import tnow, tdiffsec
from nepi.resources.ns3.ns3simulation import NS3Simulation
@clsinit_copy
class LinuxNS3Simulation(LinuxApplication, NS3Simulation):
- _rtype = "LinuxNS3Simulation"
+ _rtype = "linux::ns3::Simulation"
@classmethod
def _register_attributes(cls):
dce_version = Attribute("dceVersion",
"Version of dce to install from nsam repo (tag branch for repo)",
- default = "dce-1.3",
- #default = "dce-dev",
+ #default = "dce-1.3",
+ default = "dce-dev",
flags = Flags.Design)
populate_routing_tables = Attribute("populateRoutingTables",
type = Types.Bool,
flags = Flags.Design)
- stoptime = Attribute("stopTime",
+ stoptime = Attribute("StopTime",
"Time at which the simulation will stop",
flags = Flags.Design)
self._client = None
self._home = "ns3-simu-%s" % self.guid
self._socket_name = "ns3-%s.sock" % os.urandom(4).encode('hex')
- self._dce_manager_helper_uuid = None
- self._dce_application_helper_uuid = None
self._enable_dce = None
@property
self.debug("---- RESCHEDULING DEPLOY ---- node state %s " % self.node.state )
# ccnd needs to wait until node is deployed and running
- self.ec.schedule(reschedule_delay, self.deploy)
+ self.ec.schedule(self.reschedule_delay, self.deploy)
else:
if not self.get("command"):
self.set("command", self._start_command)
if self.get("populateRoutingTables") == True:
self.invoke(IPV4_GLOBAL_ROUTING_HELPER_UUID, "PopulateRoutingTables")
+ time = self.get("StopTime")
+ if time:
+ self._client.stop(time=time)
+
self._client.start()
self.set_started()
"""
if self.state == ResourceState.STARTED:
- time = None
- if self.get("stopTime"):
- time = self.get("stopTime")
-
- self._client.stop(time=time)
+ if not self.get("StopTime"):
+ self._client.stop()
self.set_stopped()
def do_release(self):