X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fnepi%2Fresources%2Fns3%2Fns3wrapper.py;h=4c9b9db232cb6320091dcd5a62879d9177f0c503;hb=42e05bfedb59dffb39b71faf2e781b86184e2017;hp=d8fa96fec566b575dedac21fce8d621cb6a5cc4c;hpb=aa88e26ae289dd86610141b6d9f9103b53494f4d;p=nepi.git diff --git a/src/nepi/resources/ns3/ns3wrapper.py b/src/nepi/resources/ns3/ns3wrapper.py index d8fa96fe..4c9b9db2 100644 --- a/src/nepi/resources/ns3/ns3wrapper.py +++ b/src/nepi/resources/ns3/ns3wrapper.py @@ -281,6 +281,9 @@ class NS3Wrapper(object): elif operation == "isAppRunning": result = self._is_app_running(uuid) + elif operation == "isAppStarted": + result = self._is_app_started(uuid) + elif operation == "recvFD": ### passFD operation binds to a different random socket ### en every execution, so the socket name that could be @@ -598,10 +601,14 @@ class NS3Wrapper(object): app.GetAttribute("StartTime", start_time_value) start_time = start_time_value.Get() - if now.Compare(start_time) >= 0 and now.Compare(stop_time) < 0: - return True + if now.Compare(start_time) >= 0: + if stop_time.IsZero() or now.Compare(stop_time) < 0: + return True return False + + def _is_app_started(self, uuid): + return self._is_app_running(uuid) or self.is_finished() def _add_static_route(self, ipv4_uuid, network, prefix, nexthop): ipv4 = self.get_object(ipv4_uuid)