Added attribute MaxAddresses for interface factories to design nepi_v2_1
authorAlina Quereilhac <alina.quereilhac@inria.fr>
Mon, 4 Jul 2011 17:21:25 +0000 (19:21 +0200)
committerAlina Quereilhac <alina.quereilhac@inria.fr>
Mon, 4 Jul 2011 17:21:25 +0000 (19:21 +0200)
20 files changed:
src/nepi/core/design.py
src/nepi/core/execute.py
src/nepi/core/metadata.py
src/nepi/core/testbed_impl.py
src/nepi/testbeds/netns/metadata_v01.py
src/nepi/testbeds/ns3/execute.py
src/nepi/testbeds/ns3/factories_metadata_v3_9.py
src/nepi/testbeds/planetlab/application.py
src/nepi/testbeds/planetlab/execute.py
src/nepi/testbeds/planetlab/metadata_v01.py
src/nepi/util/constants.py
test/core/design.py
test/core/execute.py
test/core/integration.py
test/lib/mock/metadata_v01.py
test/lib/mock2/metadata_v01.py
test/testbeds/netns/execute.py
test/testbeds/ns3/execute.py
test/testbeds/ns3/execute2.py
test/testbeds/planetlab/execute.py

index 9a23ad2..03d6319 100644 (file)
@@ -217,7 +217,7 @@ class Box(AttributesMap):
                     attr.range, attr.allowed, attr.flags, 
                     attr.validation_function, attr.category)
         for attr in factory.attributes:
-            if attr.modified:
+            if attr.modified or attr.invisible:
                 self._factory_attributes[attr.name] = attr.value
 
     def __str__(self):
@@ -286,7 +286,9 @@ class AddressableMixin(object):
     def __init__(self, guid, factory, testbed_guid, container = None):
         super(AddressableMixin, self).__init__(guid, factory, testbed_guid, 
                 container)
-        self._max_addresses = 1 # TODO: How to make this configurable!
+        max_addr =  self._factory_attributes["MaxAddresses"] \
+                if "MaxAddresses" in self._factory_attributes else 1
+        self._max_addresses = max_addr
         self._addresses = list()
 
     @property
index 398a718..5a191ae 100644 (file)
@@ -4,7 +4,7 @@
 from nepi.core.attributes import Attribute, AttributesMap
 from nepi.core.connector import ConnectorTypeBase
 from nepi.util import validation
-from nepi.util.constants import STATUS_FINISHED, TIME_NOW
+from nepi.util.constants import ApplicationStatus as AS, TIME_NOW
 from nepi.util.parser._xml import XmlExperimentParser
 import sys
 import re
@@ -596,7 +596,7 @@ class ExperimentController(object):
     def is_finished(self, guid):
         testbed = self._testbed_for_guid(guid)
         if testbed != None:
-            return testbed.status(guid) == STATUS_FINISHED
+            return testbed.status(guid) == AS.STATUS_FINISHED
         raise RuntimeError("No element exists with guid %d" % guid)    
 
     def set(self, guid, name, value, time = TIME_NOW):
index b344d5a..ca1be8d 100644 (file)
@@ -5,10 +5,9 @@ from nepi.core.attributes import Attribute, AttributesMap
 import sys
 import getpass
 from nepi.util import validation
-from nepi.util.constants import ATTR_NEPI_TESTBED_ENVIRONMENT_SETUP, DeploymentConfiguration
-
-# Attribute categories
-CATEGORY_DEPLOYMENT = "Deployment"
+from nepi.util.constants import ATTR_NEPI_TESTBED_ENVIRONMENT_SETUP, \
+        DeploymentConfiguration as DC, \
+        AttributeCategories as AC
 
 class VersionedMetadataInfo(object):
     @property
@@ -169,10 +168,6 @@ class Metadata(object):
         )),
     )
     
-    # Shorthand for DeploymentConfiguration
-    # Syntactic sugar to shorten stuff
-    DC = DeploymentConfiguration
-
     STANDARD_TESTBED_ATTRIBUTES = (
         ("home_directory", dict(
             name = "homeDirectory",
@@ -199,7 +194,7 @@ class Metadata(object):
                 help = "Shell commands to run before spawning TestbedController processes",
                 type = Attribute.STRING,
                 flags = Attribute.DesignOnly,
-                category = CATEGORY_DEPLOYMENT,
+                category = AC.CATEGORY_DEPLOYMENT,
         )),
         (DC.DEPLOYMENT_MODE, dict(name = DC.DEPLOYMENT_MODE,
                 help = "Instance execution mode",
@@ -211,7 +206,7 @@ class Metadata(object):
                 ],
                 flags = Attribute.DesignOnly,
                 validation_function = validation.is_enum,
-                category = CATEGORY_DEPLOYMENT,
+                category = AC.CATEGORY_DEPLOYMENT,
         )),
         (DC.DEPLOYMENT_COMMUNICATION, dict(name = DC.DEPLOYMENT_COMMUNICATION,
                 help = "Instance communication mode",
@@ -223,7 +218,7 @@ class Metadata(object):
                 ],
                 flags = Attribute.DesignOnly,
                 validation_function = validation.is_enum,
-                category = CATEGORY_DEPLOYMENT,
+                category = AC.CATEGORY_DEPLOYMENT,
         )),
         (DC.DEPLOYMENT_HOST, dict(name = DC.DEPLOYMENT_HOST,
                 help = "Host where the testbed will be executed",
@@ -231,7 +226,7 @@ class Metadata(object):
                 value = "localhost",
                 flags = Attribute.DesignOnly,
                 validation_function = validation.is_string,
-                category = CATEGORY_DEPLOYMENT,
+                category = AC.CATEGORY_DEPLOYMENT,
         )),
         (DC.DEPLOYMENT_USER, dict(name = DC.DEPLOYMENT_USER,
                 help = "User on the Host to execute the testbed",
@@ -239,14 +234,14 @@ class Metadata(object):
                 value = getpass.getuser(),
                 flags = Attribute.DesignOnly,
                 validation_function = validation.is_string,
-                category = CATEGORY_DEPLOYMENT,
+                category = AC.CATEGORY_DEPLOYMENT,
         )),
         (DC.DEPLOYMENT_KEY, dict(name = DC.DEPLOYMENT_KEY,
                 help = "Path to SSH key to use for connecting",
                 type = Attribute.STRING,
                 flags = Attribute.DesignOnly,
                 validation_function = validation.is_string,
-                category = CATEGORY_DEPLOYMENT,
+                category = AC.CATEGORY_DEPLOYMENT,
         )),
         (DC.DEPLOYMENT_PORT, dict(name = DC.DEPLOYMENT_PORT,
                 help = "Port on the Host",
@@ -254,7 +249,7 @@ class Metadata(object):
                 value = 22,
                 flags = Attribute.DesignOnly,
                 validation_function = validation.is_integer,
-                category = CATEGORY_DEPLOYMENT,
+                category = AC.CATEGORY_DEPLOYMENT,
         )),
         (DC.ROOT_DIRECTORY, dict(name = DC.ROOT_DIRECTORY,
                 help = "Root directory for storing process files",
@@ -262,7 +257,7 @@ class Metadata(object):
                 value = ".",
                 flags = Attribute.DesignOnly,
                 validation_function = validation.is_string, # TODO: validation.is_path
-                category = CATEGORY_DEPLOYMENT,
+                category = AC.CATEGORY_DEPLOYMENT,
         )),
         (DC.USE_AGENT, dict(name = DC.USE_AGENT,
                 help = "Use -A option for forwarding of the authentication agent, if ssh access is used", 
@@ -270,7 +265,7 @@ class Metadata(object):
                 value = False,
                 flags = Attribute.DesignOnly,
                 validation_function = validation.is_bool,
-                category = CATEGORY_DEPLOYMENT,
+                category = AC.CATEGORY_DEPLOYMENT,
         )),
         (DC.LOG_LEVEL, dict(name = DC.LOG_LEVEL,
                 help = "Log level for instance",
@@ -282,7 +277,7 @@ class Metadata(object):
                 ],
                 flags = Attribute.DesignOnly,
                 validation_function = validation.is_enum,
-                category = CATEGORY_DEPLOYMENT,
+                category = AC.CATEGORY_DEPLOYMENT,
         )),
         (DC.RECOVER, dict(name = DC.RECOVER,
                 help = "Do not intantiate testbeds, rather, reconnect to already-running instances. Used to recover from a dead controller.", 
@@ -290,15 +285,12 @@ class Metadata(object):
                 value = False,
                 flags = Attribute.DesignOnly,
                 validation_function = validation.is_bool,
-                category = CATEGORY_DEPLOYMENT,
+                category = AC.CATEGORY_DEPLOYMENT,
         )),
     )
     
     STANDARD_TESTBED_ATTRIBUTES += DEPLOYMENT_ATTRIBUTES
     
-    del DC
-    
-    
     STANDARD_ATTRIBUTE_BUNDLES = {
             "tun_proto" : dict({
                 "name": "tun_proto", 
index ec324b1..291a24b 100644 (file)
@@ -4,16 +4,10 @@
 from nepi.core import execute
 from nepi.core.metadata import Metadata
 from nepi.util import validation
-from nepi.util.constants import STATUS_UNDETERMINED, TIME_NOW, \
-    TESTBED_STATUS_ZERO, \
-    TESTBED_STATUS_SETUP, \
-    TESTBED_STATUS_CREATED, \
-    TESTBED_STATUS_CONNECTED, \
-    TESTBED_STATUS_CROSS_CONNECTED, \
-    TESTBED_STATUS_CONFIGURED, \
-    TESTBED_STATUS_STARTED, \
-    TESTBED_STATUS_STOPPED,\
-    CONNECTION_DELAY
+from nepi.util.constants import TIME_NOW, \
+        ApplicationStatus as AS, \
+        TestbedStatus as TS, \
+        CONNECTION_DELAY
 
 import collections
 import copy
@@ -21,7 +15,7 @@ import copy
 class TestbedController(execute.TestbedController):
     def __init__(self, testbed_id, testbed_version):
         super(TestbedController, self).__init__(testbed_id, testbed_version)
-        self._status = TESTBED_STATUS_ZERO
+        self._status = TS.STATUS_ZERO
         # testbed attributes for validation
         self._attributes = None
         # element factories for validation
@@ -191,7 +185,7 @@ class TestbedController(execute.TestbedController):
     def do_setup(self):
         self._root_directory = self._attributes.\
             get_attribute_value("rootDirectory")
-        self._status = TESTBED_STATUS_SETUP
+        self._status = TS.STATUS_SETUP
 
     def do_create(self):
         def set_params(self, guid):
@@ -203,7 +197,7 @@ class TestbedController(execute.TestbedController):
             'create_function',
             self._metadata.create_order,
             postaction = set_params )
-        self._status = TESTBED_STATUS_CREATED
+        self._status = TS.STATUS_CREATED
 
     def _do_connect(self, init = True):
         unconnected = copy.deepcopy(self._connect)
@@ -244,7 +238,7 @@ class TestbedController(execute.TestbedController):
 
     def do_connect_compl(self):
         self._do_connect(init = False)
-        self._status = TESTBED_STATUS_CONNECTED
+        self._status = TS.STATUS_CONNECTED
 
     def _do_in_factory_order(self, action, order, postaction = None, poststep = None):
         guids = collections.defaultdict(list)
@@ -290,7 +284,7 @@ class TestbedController(execute.TestbedController):
             'configure_function',
             self._metadata.configure_order,
             poststep = self.do_poststep_configure )
-        self._status = TESTBED_STATUS_CONFIGURED
+        self._status = TS.STATUS_CONFIGURED
 
     def do_prestart(self):
         self._do_in_factory_order(
@@ -324,7 +318,7 @@ class TestbedController(execute.TestbedController):
 
     def do_cross_connect_compl(self, cross_data):
         self._do_cross_connect(cross_data, init = False)
-        self._status = TESTBED_STATUS_CROSS_CONNECTED
+        self._status = TS.STATUS_CROSS_CONNECTED
 
     def set(self, guid, name, value, time = TIME_NOW):
         if not guid in self._create:
@@ -333,7 +327,7 @@ class TestbedController(execute.TestbedController):
         if not factory.box_attributes.has_attribute(name):
             raise AttributeError("Invalid attribute %s for element type %s" %
                     (name, factory.factory_id))
-        if self._status > TESTBED_STATUS_STARTED and \
+        if self._status > TS.STATUS_STARTED and \
                 factory.box_attributes.is_attribute_design_only(name):
             raise AttributeError("Attribute %s can only be modified during experiment design" % name)
         if not factory.box_attributes.is_attribute_value_valid(name, value):
@@ -435,7 +429,7 @@ class TestbedController(execute.TestbedController):
         self._do_in_factory_order(
             'start_function',
             self._metadata.start_order )
-        self._status = TESTBED_STATUS_STARTED
+        self._status = TS.STATUS_STARTED
 
     #action: NotImplementedError
 
@@ -443,7 +437,7 @@ class TestbedController(execute.TestbedController):
         self._do_in_factory_order(
             'stop_function',
             reversed(self._metadata.start_order) )
-        self._status = TESTBED_STATUS_STOPPED
+        self._status = TS.STATUS_STOPPED
 
     def status(self, guid = None):
         if not guid:
@@ -454,7 +448,7 @@ class TestbedController(execute.TestbedController):
         status_function = factory.status_function
         if status_function:
             return status_function(self, guid)
-        return STATUS_UNDETERMINED
+        return AS.STATUS_UNDETERMINED
 
     def trace(self, guid, trace_id, attribute='value'):
         if attribute == 'value':
index aa3a805..801f91b 100644 (file)
@@ -5,8 +5,8 @@ from constants import TESTBED_ID
 from nepi.core import metadata
 from nepi.core.attributes import Attribute
 from nepi.util import validation
-from nepi.util.constants import STATUS_NOT_STARTED, STATUS_RUNNING, \
-        STATUS_FINISHED
+from nepi.util.constants import ApplicationStatus as AS, \
+        FactoryCategories as FC
 
 from nepi.util.tunchannel_impl import \
     preconfigure_tunchannel, postconfigure_tunchannel, \
@@ -16,6 +16,7 @@ from nepi.util.tunchannel_impl import \
 
 import functools
 
+# Factories
 NODE = "Node"
 P2PIFACE = "P2PNodeInterface"
 TAPIFACE = "TapNodeInterface"
@@ -198,11 +199,11 @@ def stop_application(testbed_instance, guid):
 
 def status_application(testbed_instance, guid):
     if guid not in testbed_instance.elements.keys():
-        return STATUS_NOT_STARTED
+        return AS.STATUS_NOT_STARTED
     app = testbed_instance.elements[guid]
     if app.poll() == None:
-        return STATUS_RUNNING
-    return STATUS_FINISHED
+        return AS.STATUS_RUNNING
+    return AS.STATUS_FINISHED
 
 ### Configure functions ###
 
@@ -461,7 +462,7 @@ factories_info = dict({
     NODE: dict({
             "allow_routes": True,
             "help": "Emulated Node with virtualized network stack",
-            "category": "topology",
+            "category": FC.CATEGORY_NODES,
             "create_function": create_node,
             "configure_function": configure_node,
             "box_attributes": ["forward_X11"],
@@ -471,7 +472,7 @@ factories_info = dict({
     P2PIFACE: dict({
             "allow_addresses": True,
             "help": "Point to point network interface",
-            "category": "devices",
+            "category": FC.CATEGORY_DEVICES,
             "create_function": create_p2piface,
             "configure_function": configure_device,
             "box_attributes": ["lladdr", "up", "device_name", "mtu", 
@@ -481,7 +482,7 @@ factories_info = dict({
     TAPIFACE: dict({
             "allow_addresses": True,
             "help": "Tap device network interface",
-            "category": "devices",
+            "category": FC.CATEGORY_DEVICES,
             "create_function": create_tapiface,
             "configure_function": configure_device,
             "box_attributes": ["lladdr", "up", "device_name", "mtu", 
@@ -491,7 +492,7 @@ factories_info = dict({
     NODEIFACE: dict({
             "allow_addresses": True,
             "help": "Node network interface",
-            "category": "devices",
+            "category": FC.CATEGORY_DEVICES,
             "create_function": create_nodeiface,
             "configure_function": configure_device,
             "box_attributes": ["lladdr", "up", "device_name", "mtu", 
@@ -501,7 +502,7 @@ factories_info = dict({
     SWITCH: dict({
             "display_name": "Switch",
             "help": "Switch interface",
-            "category": "devices",
+            "category": FC.CATEGORY_DEVICES,
             "create_function": create_switch,
             "box_attributes": ["up", "device_name", "mtu", "multicast"],
              #TODO: Add attribute ("Stp", help, type, value, range, allowed, readonly, validation_function),
@@ -513,7 +514,7 @@ factories_info = dict({
         }),
     APPLICATION: dict({
             "help": "Generic executable command line application",
-            "category": "applications",
+            "category": FC.CATEGORY_APPLICATIONS,
             "create_function": create_application,
             "start_function": start_application,
             "stop_function": stop_application,
@@ -523,7 +524,7 @@ factories_info = dict({
             "traces": ["stdout", "stderr"]
         }),
      TUNCHANNEL : dict({
-        "category": "Channel",
+        "category": FC.CATEGORY_TUNNELS,
         "create_function": create_tunchannel,
         "preconfigure_function": preconfigure_tunchannel,
         "configure_function": postconfigure_tunchannel,
index 4c2bca1..0f0b29f 100644 (file)
@@ -4,8 +4,7 @@
 from nepi.core import testbed_impl
 from nepi.core.attributes import Attribute
 from constants import TESTBED_ID
-from nepi.util.constants import TIME_NOW, \
-    TESTBED_STATUS_STARTED
+from nepi.util.constants import TIME_NOW, TestbedStatus as TS
 import os
 import sys
 import threading
@@ -226,7 +225,7 @@ class TestbedController(testbed_impl.TestbedController):
                 condition.release()
 
     def _set_attribute(self, name, ns3_value, element):
-        if self.status() == TESTBED_STATUS_STARTED:
+        if self.status() == TS.STATUS_STARTED:
             # schedule the event in the Simulator
             self._schedule_event(self._condition, self._set_ns3_attribute, 
                     name, ns3_value, element)
@@ -234,7 +233,7 @@ class TestbedController(testbed_impl.TestbedController):
             self._set_ns3_attribute(name, ns3_value, element)
 
     def _get_attribute(self, name, ns3_value, element):
-        if self.status() == TESTBED_STATUS_STARTED:
+        if self.status() == TS.STATUS_STARTED:
             # schedule the event in the Simulator
             self._schedule_event(self._condition, self._get_ns3_attribute, 
                     name, ns3_value, element)
@@ -248,7 +247,7 @@ class TestbedController(testbed_impl.TestbedController):
         element.GetAttribute(name, ns3_value)
 
     def _stop_simulation(self, time):
-        if self.status() == TESTBED_STATUS_STARTED:
+        if self.status() == TS.STATUS_STARTED:
             # schedule the event in the Simulator
             self._schedule_event(self._condition, self._stop_ns3_simulation, 
                     time)
index cddabc2..6333437 100644 (file)
@@ -2,8 +2,8 @@
 # -*- coding: utf-8 -*-
 
 from nepi.util import tags
-from nepi.util.constants import AF_INET, STATUS_NOT_STARTED, STATUS_RUNNING, \
-        STATUS_FINISHED, STATUS_UNDETERMINED
+from nepi.util.constants import AF_INET, ApplicationStatus as AS, \
+        FactoryCategories as FC
 from nepi.util.tunchannel_impl import \
     preconfigure_tunchannel, postconfigure_tunchannel, \
     wait_tunchannel, create_tunchannel
@@ -367,22 +367,22 @@ def status_application(testbed_instance, guid):
         raise RuntimeError("Can't get status on guid %d" % guid )
     now = testbed_instance.ns3.Simulator.Now()
     if now.IsZero():
-        return STATUS_NOT_STARTED
+        return AS.STATUS_NOT_STARTED
     app = testbed_instance.elements[guid]
     parameters = testbed_instance._get_parameters(guid)
     start_value = parameters.get("StartTime")
     if start_value != None:
         start_time = testbed_instance.ns3.Time(start_value)
         if now.Compare(start_time) < 0:
-            return STATUS_NOT_STARTED
+            return AS.STATUS_NOT_STARTED
     stop_value = parameters.get("StopTime")
     if stop_value != None:
         stop_time = testbed_instance.ns3.Time(stop_value)
         if now.Compare(stop_time) < 0:
-            return STATUS_RUNNING
+            return AS.STATUS_RUNNING
         else:
-            return STATUS_FINISHED
-    return STATUS_UNDETERMINED
+            return AS.STATUS_FINISHED
+    return AS.STATUS_UNDETERMINED
 
 ### Configure functions ###
 
@@ -683,7 +683,7 @@ factories_order = ["ns3::BasicEnergySource",
 
 factories_info = dict({
     "ns3::Ping6": dict({
-        "category": "Application",
+        "category": FC.CATEGORY_APPLICATIONS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -700,7 +700,7 @@ factories_info = dict({
             "StopTime"],
     }),
      "ns3::UdpL4Protocol": dict({
-        "category": "Protocol",
+        "category": FC.CATEGORY_PROTOCOLS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -708,7 +708,7 @@ factories_info = dict({
         "box_attributes": ["ProtocolNumber"],
     }),
      "ns3::RandomDiscPositionAllocator": dict({
-        "category": "Mobility",
+        "category": FC.CATEGORY_MOBILITY_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -720,7 +720,7 @@ factories_info = dict({
         "tags": [tags.MOBILE],
     }),
      "ns3::Node": dict({
-        "category": "Node",
+        "category": FC.CATEGORY_NODES,
         "create_function": create_node,
         "configure_function": configure_node,
         "help": "",
@@ -729,7 +729,7 @@ factories_info = dict({
         "box_attributes": [],
     }),
      "ns3::GridPositionAllocator": dict({
-        "category": "Mobility",
+        "category": FC.CATEGORY_MOBILITY_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -743,7 +743,7 @@ factories_info = dict({
         "tags": [tags.MOBILE],
     }),
      "ns3::TapBridge": dict({
-        "category": "Device",
+        "category": FC.CATEGORY_DEVICES,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -772,7 +772,7 @@ factories_info = dict({
             "FlowInterruptionsMinTime"],
     }),
      "ns3::ConstantVelocityMobilityModel": dict({
-        "category": "Mobility",
+        "category": FC.CATEGORY_MOBILITY_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -782,7 +782,7 @@ factories_info = dict({
         "tags": [tags.MOBILE],
     }),
      "ns3::V4Ping": dict({
-        "category": "Application",
+        "category": FC.CATEGORY_APPLICATIONS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -812,7 +812,7 @@ factories_info = dict({
             "MaxPacketFailure"],
     }),
      "ns3::PointToPointNetDevice": dict({
-        "category": "Device",
+        "category": FC.CATEGORY_DEVICES,
         "create_function": create_element,
         "configure_function": configure_device,
         "help": "",
@@ -825,7 +825,7 @@ factories_info = dict({
         "traces": ["p2ppcap", "p2pascii"]
     }),
      "ns3::NakagamiPropagationLossModel": dict({
-        "category": "Loss",
+        "category": FC.CATEGORY_LOSS_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -837,7 +837,7 @@ factories_info = dict({
             "m2"],
     }),
      "ns3::AarfWifiManager": dict({
-        "category": "Manager",
+        "category": FC.CATEGORY_MANAGERS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -863,7 +863,7 @@ factories_info = dict({
         "box_attributes": ["OptionNumber"],
     }),
      "ns3::TwoRayGroundPropagationLossModel": dict({
-        "category": "Loss",
+        "category": FC.CATEGORY_LOSS_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -874,7 +874,7 @@ factories_info = dict({
             "HeightAboveZ"],
     }),
      "ns3::OnOffApplication": dict({
-        "category": "Application",
+        "category": FC.CATEGORY_APPLICATIONS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -893,7 +893,7 @@ factories_info = dict({
             "StopTime"],
     }),
      "ns3::AdhocWifiMac": dict({
-        "category": "Mac",
+        "category": FC.CATEGORY_MAC_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -910,7 +910,7 @@ factories_info = dict({
             "Ssid"],
     }),
      "ns3::ConstantAccelerationMobilityModel": dict({
-        "category": "Mobility",
+        "category": FC.CATEGORY_MOBILITY_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -920,7 +920,7 @@ factories_info = dict({
         "tags": [tags.MOBILE],
     }),
      "ns3::GaussMarkovMobilityModel": dict({
-        "category": "Mobility",
+        "category": FC.CATEGORY_MOBILITY_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -939,7 +939,7 @@ factories_info = dict({
         "tags": [tags.MOBILE],
     }),
      "ns3::dot11s::HwmpProtocol": dict({
-        "category": "Protocol",
+        "category": FC.CATEGORY_PROTOCOLS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -962,7 +962,7 @@ factories_info = dict({
             "RfFlag"],
     }),
      "ns3::NscTcpL4Protocol": dict({
-        "category": "Protocol",
+        "category": FC.CATEGORY_PROTOCOLS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1020,7 +1020,7 @@ factories_info = dict({
             "MaxPropDelay"],
     }),
      "ns3::WaypointMobilityModel": dict({
-        "category": "Mobility",
+        "category": FC.CATEGORY_MOBILITY_MODELS,
         "create_function": create_waypoint_mobility,
         "configure_function": configure_element,
         "help": "Waypoint-based mobility model.",
@@ -1032,7 +1032,7 @@ factories_info = dict({
         "tags": [tags.MOBILE],
     }),
      "ns3::FileDescriptorNetDevice": dict({
-        "category": "Device",
+        "category": FC.CATEGORY_DEVICES,
         "create_function": create_element,
         "configure_function": configure_device,
         "help": "Network interface associated to a file descriptor",
@@ -1044,7 +1044,7 @@ factories_info = dict({
         "traces": ["fdpcap"]
     }),
      "ns3::Nepi::TunChannel": dict({
-        "category": "Channel",
+        "category": FC.CATEGORY_TUNNELS,
         "create_function": create_tunchannel,
         "preconfigure_function": preconfigure_tunchannel,
         "configure_function": postconfigure_tunchannel,
@@ -1056,7 +1056,7 @@ factories_info = dict({
         "box_attributes": ["tun_proto", "tun_addr", "tun_port", "tun_key"]
     }),
      "ns3::CsmaNetDevice": dict({
-        "category": "Device",
+        "category": FC.CATEGORY_DEVICES,
         "create_function": create_element,
         "configure_function": configure_device,
         "help": "CSMA (carrier sense, multiple access) interface",
@@ -1077,7 +1077,7 @@ factories_info = dict({
         "box_attributes": ["SpreadCoef"],
     }),
      "ns3::NqstaWifiMac": dict({
-        "category": "Mac",
+        "category": FC.CATEGORY_MAC_MODELS,
         "create_function": create_wifi_standard_model,
         "configure_function": configure_element,
         "help": "",
@@ -1097,7 +1097,7 @@ factories_info = dict({
             "Ssid"],
     }),
      "ns3::Icmpv6L4Protocol": dict({
-        "category": "Protocol",
+        "category": FC.CATEGORY_PROTOCOLS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1106,7 +1106,7 @@ factories_info = dict({
             "ProtocolNumber"],
     }),
      "ns3::SimpleNetDevice": dict({
-        "category": "Device",
+        "category": FC.CATEGORY_DEVICES,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1115,7 +1115,7 @@ factories_info = dict({
         "box_attributes": [],
     }),
      "ns3::FriisPropagationLossModel": dict({
-        "category": "Loss",
+        "category": FC.CATEGORY_LOSS_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1133,7 +1133,7 @@ factories_info = dict({
         "box_attributes": ["OptionNumber"],
     }),
      "ns3::UniformDiscPositionAllocator": dict({
-        "category": "Mobility",
+        "category": FC.CATEGORY_MOBILITY_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1144,7 +1144,7 @@ factories_info = dict({
         "tags": [tags.MOBILE],
     }),
      "ns3::RandomBoxPositionAllocator": dict({
-        "category": "Mobility",
+        "category": FC.CATEGORY_MOBILITY_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1163,7 +1163,7 @@ factories_info = dict({
         "box_attributes": ["ExtensionNumber"],
     }),
      "ns3::LoopbackNetDevice": dict({
-        "category": "Device",
+        "category": FC.CATEGORY_DEVICES,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1171,7 +1171,7 @@ factories_info = dict({
         "box_attributes": [],
     }),
      "ns3::ConstantSpeedPropagationDelayModel": dict({
-        "category": "Delay",
+        "category": FC.CATEGORY_DELAY_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1187,7 +1187,7 @@ factories_info = dict({
         "box_attributes": ["ExtensionNumber"],
     }),
      "ns3::BridgeChannel": dict({
-        "category": "Channel",
+        "category": FC.CATEGORY_CHANNELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1212,7 +1212,7 @@ factories_info = dict({
         "box_attributes": ["RcvBufSize"],
     }),
      "ns3::flame::FlameProtocol": dict({
-        "category": "Protocol",
+        "category": FC.CATEGORY_PROTOCOLS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1221,7 +1221,7 @@ factories_info = dict({
             "MaxCost"],
     }),
      "ns3::Cost231PropagationLossModel": dict({
-        "category": "Loss",
+        "category": FC.CATEGORY_LOSS_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1241,7 +1241,7 @@ factories_info = dict({
         "box_attributes": ["ExtensionNumber"],
     }),
      "ns3::CaraWifiManager": dict({
-        "category": "Manager",
+        "category": FC.CATEGORY_MANAGERS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1270,7 +1270,7 @@ factories_info = dict({
             "MinRTO"],
     }),
      "ns3::Icmpv4L4Protocol": dict({
-        "category": "Protocol",
+        "category": FC.CATEGORY_PROTOCOLS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1287,7 +1287,7 @@ factories_info = dict({
             "DutyCycle"],
     }),
      "ns3::YansWifiChannel": dict({
-        "category": "Channel",
+        "category": FC.CATEGORY_CHANNELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1295,7 +1295,7 @@ factories_info = dict({
         "box_attributes": [],
     }),
      "ns3::SimpleChannel": dict({
-        "category": "Channel",
+        "category": FC.CATEGORY_CHANNELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1319,7 +1319,7 @@ factories_info = dict({
         "box_attributes": ["Root"],
     }),
      "ns3::FriisSpectrumPropagationLossModel": dict({
-        "category": "Loss",
+        "category": FC.CATEGORY_LOSS_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1327,7 +1327,7 @@ factories_info = dict({
         "box_attributes": [],
     }),
      "ns3::RandomRectanglePositionAllocator": dict({
-        "category": "Mobility",
+        "category": FC.CATEGORY_MOBILITY_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1337,7 +1337,7 @@ factories_info = dict({
         "tags": [tags.MOBILE],
     }),
      "ns3::NqapWifiMac": dict({
-        "category": "Mac",
+        "category": FC.CATEGORY_MAC_MODELS,
         "create_function": create_wifi_standard_model,
         "configure_function": configure_element,
         "help": "",
@@ -1356,7 +1356,7 @@ factories_info = dict({
             "Ssid"],
     }),
      "ns3::HierarchicalMobilityModel": dict({
-        "category": "Mobility",
+        "category": FC.CATEGORY_MOBILITY_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1366,7 +1366,7 @@ factories_info = dict({
         "tags": [tags.MOBILE],
     }),
      "ns3::ThreeLogDistancePropagationLossModel": dict({
-        "category": "Loss",
+        "category": FC.CATEGORY_LOSS_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1405,7 +1405,7 @@ factories_info = dict({
         "box_attributes": [],
     }),
      "ns3::RandomPropagationDelayModel": dict({
-        "category": "Delay",
+        "category": FC.CATEGORY_DELAY_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1413,7 +1413,7 @@ factories_info = dict({
         "box_attributes": ["Variable"],
     }),
      "ns3::ArpL3Protocol": dict({
-        "category": "Protocol",
+        "category": FC.CATEGORY_PROTOCOLS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1421,7 +1421,7 @@ factories_info = dict({
         "box_attributes": [],
     }),
      "ns3::SteadyStateRandomWaypointMobilityModel": dict({
-        "category": "Mobility",
+        "category": FC.CATEGORY_MOBILITY_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1439,7 +1439,7 @@ factories_info = dict({
         "tags": [tags.MOBILE],
     }),
      "ns3::BaseStationNetDevice": dict({
-        "category": "Device",
+        "category": FC.CATEGORY_DEVICES,
         "create_function": create_base_station,
         "configure_function": configure_station,
         "help": "Base station for wireless mobile network",
@@ -1458,7 +1458,7 @@ factories_info = dict({
         "traces": ["wimaxpcap", "wimaxascii"],
     }),
      "ns3::UdpServer": dict({
-        "category": "Application",
+        "category": FC.CATEGORY_APPLICATIONS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1472,7 +1472,7 @@ factories_info = dict({
             "StopTime"],
     }),
      "ns3::AarfcdWifiManager": dict({
-        "category": "Manager",
+        "category": FC.CATEGORY_MANAGERS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1502,7 +1502,7 @@ factories_info = dict({
         "box_attributes": [],
     }),
      "ns3::LogDistancePropagationLossModel": dict({
-        "category": "Loss",
+        "category": FC.CATEGORY_LOSS_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1512,7 +1512,7 @@ factories_info = dict({
             "ReferenceLoss"],
     }),
      "ns3::EmuNetDevice": dict({
-        "category": "Device",
+        "category": FC.CATEGORY_DEVICES,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1525,7 +1525,7 @@ factories_info = dict({
             "RxQueueSize"],
     }),
      "ns3::Ipv6ExtensionLooseRouting": dict({
-        "category": "Routing",
+        "category": FC.CATEGORY_ROUTING,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1533,7 +1533,7 @@ factories_info = dict({
         "box_attributes": ["ExtensionNumber"],
     }),
      "ns3::RandomWaypointMobilityModel": dict({
-        "category": "Mobility",
+        "category": FC.CATEGORY_MOBILITY_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1545,7 +1545,7 @@ factories_info = dict({
         "tags": [tags.MOBILE],
     }),
      "ns3::RangePropagationLossModel": dict({
-        "category": "Loss",
+        "category": FC.CATEGORY_LOSS_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1553,7 +1553,7 @@ factories_info = dict({
         "box_attributes": ["MaxRange"],
     }),
      "ns3::AlohaNoackNetDevice": dict({
-        "category": "Device",
+        "category": FC.CATEGORY_DEVICES,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1562,7 +1562,7 @@ factories_info = dict({
             "Mtu"],
     }),
      "ns3::MatrixPropagationLossModel": dict({
-        "category": "Loss",
+        "category": FC.CATEGORY_LOSS_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1570,7 +1570,7 @@ factories_info = dict({
         "box_attributes": ["DefaultLoss"],
     }),
      "ns3::WifiNetDevice": dict({
-        "category": "Device",
+        "category": FC.CATEGORY_DEVICES,
         "create_function": create_element,
         "configure_function": configure_device,
         "help": "",
@@ -1579,7 +1579,7 @@ factories_info = dict({
         "box_attributes": ["Mtu"],
     }),
      "ns3::CsmaChannel": dict({
-        "category": "Channel",
+        "category": FC.CATEGORY_CHANNELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1588,7 +1588,7 @@ factories_info = dict({
             "Delay"],
     }),
      "ns3::BridgeNetDevice": dict({
-        "category": "Device",
+        "category": FC.CATEGORY_DEVICES,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1599,7 +1599,7 @@ factories_info = dict({
            "ExpirationTime"],
     }),
      "ns3::Ipv6ExtensionRouting": dict({
-        "category": "Routing",
+        "category": FC.CATEGORY_ROUTING,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1607,7 +1607,7 @@ factories_info = dict({
         "box_attributes": ["ExtensionNumber"],
     }),
      "ns3::QstaWifiMac": dict({
-        "category": "Mac",
+        "category": FC.CATEGORY_MAC_MODELS,
         "create_function": create_wifi_standard_model,
         "configure_function": configure_element,
         "help": "Station Wifi MAC Model",
@@ -1628,7 +1628,7 @@ factories_info = dict({
             "Standard"],
     }),
      "ns3::UdpEchoClient": dict({
-        "category": "Application",
+        "category": FC.CATEGORY_APPLICATIONS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1645,7 +1645,7 @@ factories_info = dict({
             "StopTime"],
     }),
      "ns3::UdpClient": dict({
-        "category": "Application",
+        "category": FC.CATEGORY_APPLICATIONS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1662,7 +1662,7 @@ factories_info = dict({
             "StopTime"],
     }),
      "ns3::PointToPointChannel": dict({
-        "category": "Channel",
+        "category": FC.CATEGORY_CHANNELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1670,7 +1670,7 @@ factories_info = dict({
         "box_attributes": ["Delay"],
     }),
      "ns3::Ipv6StaticRouting": dict({
-        "category": "Routing",
+        "category": FC.CATEGORY_ROUTING,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1678,7 +1678,7 @@ factories_info = dict({
         "box_attributes": [],
     }),
      "ns3::DropTailQueue": dict({
-        "category": "Queue",
+        "category": FC.CATEGORY_QUEUES,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1687,7 +1687,7 @@ factories_info = dict({
            "MaxBytes"],
     }),
      "ns3::ConstantPositionMobilityModel": dict({
-        "category": "Mobility",
+        "category": FC.CATEGORY_MOBILITY_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1697,7 +1697,7 @@ factories_info = dict({
         "tags": [tags.MOBILE],
     }),
      "ns3::FixedRssLossModel": dict({
-        "category": "Loss",
+        "category": FC.CATEGORY_LOSS_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1705,7 +1705,7 @@ factories_info = dict({
         "box_attributes": ["Rss"],
     }),
      "ns3::EnergySourceContainer": dict({
-        "category": "Energy",
+        "category": FC.CATEGORY_ENERGY_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1713,7 +1713,7 @@ factories_info = dict({
         "box_attributes": [],
     }),
      "ns3::RandomWalk2dMobilityModel": dict({
-        "category": "Mobility",
+        "category": FC.CATEGORY_MOBILITY_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1737,7 +1737,7 @@ factories_info = dict({
         "box_attributes": [],
     }),
      "ns3::dot11s::PeerManagementProtocol": dict({
-        "category": "Protocol",
+        "category": FC.CATEGORY_PROTOCOLS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1747,7 +1747,7 @@ factories_info = dict({
             "EnableBeaconCollisionAvoidance"],
     }),
      "ns3::MeshPointDevice": dict({
-        "category": "Device",
+        "category": FC.CATEGORY_DEVICES,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1756,7 +1756,7 @@ factories_info = dict({
         "box_attributes": ["Mtu"],
     }),
      "ns3::BasicEnergySource": dict({
-        "category": "Energy",
+        "category": FC.CATEGORY_ENERGY_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1774,7 +1774,7 @@ factories_info = dict({
         "box_attributes": ["OptionNumber"],
     }),
      "ns3::QapWifiMac": dict({
-        "category": "Mac",
+        "category": FC.CATEGORY_MAC_MODELS,
         "create_function": create_wifi_standard_model,
         "configure_function": configure_element,
         "help": "Access point Wifi MAC Model",
@@ -1794,7 +1794,7 @@ factories_info = dict({
             "Standard"],
     }),
      "ns3::YansErrorRateModel": dict({
-        "category": "Error",
+        "category": FC.CATEGORY_ERROR_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1802,7 +1802,7 @@ factories_info = dict({
         "box_attributes": [],
     }),
      "ns3::WifiMacQueue": dict({
-        "category": "Queue",
+        "category": FC.CATEGORY_QUEUES,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1811,7 +1811,7 @@ factories_info = dict({
            "MaxDelay"],
     }),
      "ns3::NonCommunicatingNetDevice": dict({
-        "category": "Device",
+        "category": FC.CATEGORY_DEVICES,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1820,7 +1820,7 @@ factories_info = dict({
         "box_attributes": [],
     }),
      "ns3::RateErrorModel": dict({
-        "category": "Error",
+        "category": FC.CATEGORY_ERROR_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1831,7 +1831,7 @@ factories_info = dict({
             "IsEnabled"],
     }),
      "ns3::MeshWifiInterfaceMac": dict({
-        "category": "Mac",
+        "category": FC.CATEGORY_MAC_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1867,7 +1867,7 @@ factories_info = dict({
         "box_attributes": ["ExtensionNumber"],
     }),
      "ns3::SingleModelSpectrumChannel": dict({
-        "category": "Channel",
+        "category": FC.CATEGORY_CHANNELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1875,7 +1875,7 @@ factories_info = dict({
         "box_attributes": [],
     }),
      "ns3::YansWifiPhy": dict({
-        "category": "Phy",
+        "category": FC.CATEGORY_PHY_MODELS,
         "create_function": create_wifi_standard_model,
         "configure_function": configure_element,
         "help": "",
@@ -1894,7 +1894,7 @@ factories_info = dict({
         "traces": ["yanswifipcap"]
     }),
      "ns3::WifiRadioEnergyModel": dict({
-        "category": "Energy",
+        "category": FC.CATEGORY_ENERGY_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1924,7 +1924,7 @@ factories_info = dict({
         "box_attributes": ["Threshold"],
     }),
      "ns3::IdealWifiManager": dict({
-        "category": "Manager",
+        "category": FC.CATEGORY_MANAGERS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1938,7 +1938,7 @@ factories_info = dict({
             "NonUnicastMode"],
     }),
      "ns3::MultiModelSpectrumChannel": dict({
-        "category": "Channel",
+        "category": FC.CATEGORY_CHANNELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1946,7 +1946,7 @@ factories_info = dict({
         "box_attributes": [],
     }),
      "ns3::HalfDuplexIdealPhy": dict({
-        "category": "Phy",
+        "category": FC.CATEGORY_PHY_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1954,7 +1954,7 @@ factories_info = dict({
         "box_attributes": ["Rate"],
     }),
      "ns3::UanPhyCalcSinrDefault": dict({
-        "category": "Phy",
+        "category": FC.CATEGORY_PHY_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1962,7 +1962,7 @@ factories_info = dict({
         "box_attributes": [],
     }),
      "ns3::ReceiveListErrorModel": dict({
-        "category": "Error",
+        "category": FC.CATEGORY_ERROR_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -1979,7 +1979,7 @@ factories_info = dict({
         "NoisePowerSpectralDensity"],
     }),
      "ns3::ConstantRateWifiManager": dict({
-        "category": "Manager",
+        "category": FC.CATEGORY_MANAGERS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -2014,7 +2014,7 @@ factories_info = dict({
             "StopTime"],
     }),
      "ns3::RraaWifiManager": dict({
-        "category": "Manager",
+        "category": FC.CATEGORY_MANAGERS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -2051,7 +2051,7 @@ factories_info = dict({
             "NonUnicastMode"],
     }),
      "ns3::RandomPropagationLossModel": dict({
-        "category": "Loss",
+        "category": FC.CATEGORY_LOSS_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -2059,7 +2059,7 @@ factories_info = dict({
         "box_attributes": ["Variable"],
     }),
      "ns3::UanChannel": dict({
-        "category": "Channel",
+        "category": FC.CATEGORY_CHANNELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -2067,7 +2067,7 @@ factories_info = dict({
         "box_attributes": [],
     }),
      "ns3::MinstrelWifiManager": dict({
-        "category": "Manager",
+        "category": FC.CATEGORY_MANAGERS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -2086,7 +2086,7 @@ factories_info = dict({
             "NonUnicastMode"],
     }),
      "ns3::UanPhyDual": dict({
-        "category": "Phy",
+        "category": FC.CATEGORY_PHY_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -2101,7 +2101,7 @@ factories_info = dict({
             "SupportedModesPhy2"],
     }),
      "ns3::ListErrorModel": dict({
-        "category": "Error",
+        "category": FC.CATEGORY_ERROR_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -2109,7 +2109,7 @@ factories_info = dict({
         "box_attributes": ["IsEnabled"],
     }),
      "ns3::VirtualNetDevice": dict({
-        "category": "Device",
+        "category": FC.CATEGORY_DEVICES,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -2118,7 +2118,7 @@ factories_info = dict({
         "box_attributes": ["Mtu"],
     }),
      "ns3::UanPhyGen": dict({
-        "category": "Phy",
+        "category": FC.CATEGORY_PHY_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -2130,7 +2130,7 @@ factories_info = dict({
             "SupportedModes"],
     }),
      "ns3::Ipv6L3Protocol": dict({
-        "category": "Protocol",
+        "category": FC.CATEGORY_PROTOCOLS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -2139,7 +2139,7 @@ factories_info = dict({
             "IpForward"],
     }),
      "ns3::PointToPointRemoteChannel": dict({
-        "category": "Channel",
+        "category": FC.CATEGORY_CHANNELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -2147,7 +2147,7 @@ factories_info = dict({
         "box_attributes": ["Delay"],
     }),
      "ns3::UanPhyPerUmodem": dict({
-        "category": "Phy",
+        "category": FC.CATEGORY_PHY_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -2155,7 +2155,7 @@ factories_info = dict({
         "box_attributes": [],
     }),
      "ns3::OnoeWifiManager": dict({
-        "category": "Manager",
+        "category": FC.CATEGORY_MANAGERS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -2171,7 +2171,7 @@ factories_info = dict({
             "NonUnicastMode"],
     }),
      "ns3::QadhocWifiMac": dict({
-        "category": "Mac",
+        "category": FC.CATEGORY_MAC_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -2188,7 +2188,7 @@ factories_info = dict({
             "Ssid"],
     }),
      "ns3::JakesPropagationLossModel": dict({
-        "category": "Loss",
+        "category": FC.CATEGORY_LOSS_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -2199,7 +2199,7 @@ factories_info = dict({
             "Distribution"],
     }),
      "ns3::PacketSink": dict({
-        "category": "Application",
+        "category": FC.CATEGORY_APPLICATIONS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -2213,7 +2213,7 @@ factories_info = dict({
             "StopTime"],
     }),
      "ns3::RandomDirection2dMobilityModel": dict({
-        "category": "Mobility",
+        "category": FC.CATEGORY_MOBILITY_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -2252,7 +2252,7 @@ factories_info = dict({
             "Aifsn"],
     }),
      "ns3::UanPhyCalcSinrFhFsk": dict({
-        "category": "Phy",
+        "category": FC.CATEGORY_PHY_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -2287,7 +2287,7 @@ factories_info = dict({
             "FrameSize"],
     }),
      "ns3::NistErrorRateModel": dict({
-        "category": "Error",
+        "category": FC.CATEGORY_ERROR_MODELS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -2295,7 +2295,7 @@ factories_info = dict({
         "box_attributes": [],
     }),
      "ns3::Ipv4L3Protocol": dict({
-        "category": "Protocol",
+        "category": FC.CATEGORY_PROTOCOLS,
         "create_function": create_ipv4protocol,
         "configure_function": configure_element,
         "help": "",
@@ -2305,7 +2305,7 @@ factories_info = dict({
             "WeakEsModel"],
     }),
      "ns3::aodv::RoutingProtocol": dict({
-        "category": "Protocol",
+        "category": FC.CATEGORY_PROTOCOLS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -2332,7 +2332,7 @@ factories_info = dict({
             "EnableBroadcast"],
     }),
      "ns3::TcpL4Protocol": dict({
-        "category": "Protocol",
+        "category": FC.CATEGORY_PROTOCOLS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -2341,7 +2341,7 @@ factories_info = dict({
             "ProtocolNumber"],
     }),
      "ns3::olsr::RoutingProtocol": dict({
-        "category": "Protocol",
+        "category": FC.CATEGORY_PROTOCOLS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -2353,7 +2353,7 @@ factories_info = dict({
             "Willingness"],
     }),
      "ns3::UdpEchoServer": dict({
-        "category": "Application",
+        "category": FC.CATEGORY_APPLICATIONS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -2366,7 +2366,7 @@ factories_info = dict({
            "StopTime"],
     }),
      "ns3::AmrrWifiManager": dict({
-        "category": "Manager",
+        "category": FC.CATEGORY_MANAGERS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -2384,7 +2384,7 @@ factories_info = dict({
             "NonUnicastMode"],
     }),
      "ns3::ArfWifiManager": dict({
-        "category": "Manager",
+        "category": FC.CATEGORY_MANAGERS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "",
@@ -2399,7 +2399,7 @@ factories_info = dict({
             "NonUnicastMode"],
     }),
      "ns3::SubscriberStationNetDevice": dict({
-        "category": "Device",
+        "category": FC.CATEGORY_DEVICES,
         "create_function": create_subscriber_station,
         "configure_function": configure_station,
         "help": "Subscriber station for mobile wireless network",
@@ -2431,7 +2431,7 @@ factories_info = dict({
         "box_attributes": ["Lifetime"],
     }),
     "ns3::BSSchedulerRtps": dict({
-        "category": "Service Flow",
+        "category": FC.CATEGORY_SERVICE_FLOWS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "Simple downlink scheduler for rtPS flows",
@@ -2439,7 +2439,7 @@ factories_info = dict({
         "box_attributes": [],
     }),
     "ns3::BSSchedulerSimple": dict({
-        "category": "Service Flow",
+        "category": FC.CATEGORY_SERVICE_FLOWS,
         "create_function": create_element,
         "configure_function": configure_element,
         "help": "simple downlink scheduler for service flows",
@@ -2447,7 +2447,7 @@ factories_info = dict({
         "box_attributes": [],
     }),
     "ns3::SimpleOfdmWimaxChannel": dict({
-        "category": "Channel",
+        "category": FC.CATEGORY_CHANNELS,
         "create_function": create_wimax_channel,
         "configure_function": configure_element,
         "help": "Wimax channel",
@@ -2455,7 +2455,7 @@ factories_info = dict({
         "box_attributes": [],
     }),
     "ns3::SimpleOfdmWimaxPhy": dict({
-        "category": "Phy",
+        "category": FC.CATEGORY_PHY_MODELS,
         "create_function": create_wimax_phy,
         "configure_function": configure_element,
         "help": "Wimax Phy",
@@ -2463,7 +2463,7 @@ factories_info = dict({
         "box_attributes": [],
     }),
     "ns3::UplinkSchedulerSimple": dict({
-        "category": "Service Flow",
+        "category": FC.CATEGORY_SERVICE_FLOWS,
         "create_function": create_element_no_constructor,
         "configure_function": configure_element,
         "help": "Simple uplink scheduler for service flows",
@@ -2471,7 +2471,7 @@ factories_info = dict({
         "box_attributes": [],
     }),
     "ns3::UplinkSchedulerRtps": dict({
-        "category": "Service Flow",
+        "category": FC.CATEGORY_SERVICE_FLOWS,
         "create_function": create_element_no_constructor,
         "configure_function": configure_element,
         "help": "Simple uplink scheduler for rtPS flows",
@@ -2479,7 +2479,7 @@ factories_info = dict({
         "box_attributes": [],
     }),
     "ns3::IpcsClassifierRecord": dict({
-        "category": "Service Flow",
+        "category": FC.CATEGORY_SERVICE_FLOWS,
         "create_function": create_ipcs_classifier_record,
         "configure_function": configure_element,
         "help": "Classifier record for service flow",
@@ -2496,7 +2496,7 @@ factories_info = dict({
             "ClassifierPriority"],
     }),   
     "ns3::ServiceFlow": dict({
-        "category": "Service Flow",
+        "category": FC.CATEGORY_SERVICE_FLOWS,
         "create_function": create_service_flow,
         "configure_function": configure_element,
         "help": "Service flow for QoS",
index 7a42c20..b5b85b8 100644 (file)
@@ -16,8 +16,7 @@ import time
 import socket
 import threading
 
-from nepi.util.constants import STATUS_NOT_STARTED, STATUS_RUNNING, \
-        STATUS_FINISHED
+from nepi.util.constants import ApplicationStatus as AS
 
 class Dependency(object):
     """
@@ -681,9 +680,9 @@ class Application(Dependency):
     def status(self):
         self.checkpid()
         if not self._started:
-            return STATUS_NOT_STARTED
+            return AS.STATUS_NOT_STARTED
         elif not self._pid or not self._ppid:
-            return STATUS_NOT_STARTED
+            return AS.STATUS_NOT_STARTED
         else:
             status = rspawn.remote_status(
                 self._pid, self._ppid,
@@ -696,18 +695,18 @@ class Application(Dependency):
                 )
             
             if status is rspawn.NOT_STARTED:
-                return STATUS_NOT_STARTED
+                return AS.STATUS_NOT_STARTED
             elif status is rspawn.RUNNING:
-                return STATUS_RUNNING
+                return AS.STATUS_RUNNING
             elif status is rspawn.FINISHED:
-                return STATUS_FINISHED
+                return AS.STATUS_FINISHED
             else:
                 # WTF?
-                return STATUS_NOT_STARTED
+                return AS.STATUS_NOT_STARTED
     
     def kill(self):
         status = self.status()
-        if status == STATUS_RUNNING:
+        if status == AS.STATUS_RUNNING:
             # kill by ppid+pid - SIGTERM first, then try SIGKILL
             rspawn.remote_kill(
                 self._pid, self._ppid,
index f2d9eb2..746e1f9 100644 (file)
@@ -22,8 +22,6 @@ import subprocess
 import random
 import shutil
 
-from nepi.util.constants import TESTBED_STATUS_CONFIGURED
-
 class TempKeyError(Exception):
     pass
 
index e8ea963..6fcc07d 100644 (file)
@@ -7,8 +7,9 @@ from constants import TESTBED_ID
 from nepi.core import metadata
 from nepi.core.attributes import Attribute
 from nepi.util import validation
-from nepi.util.constants import STATUS_NOT_STARTED, STATUS_RUNNING, \
-        STATUS_FINISHED, ATTR_NEPI_TESTBED_ENVIRONMENT_SETUP
+from nepi.util.constants import ApplicationStatus as AS, \
+        FactoryCategories as FC, \
+        ATTR_NEPI_TESTBED_ENVIRONMENT_SETUP
 
 import functools
 import os
@@ -282,7 +283,7 @@ def stop_application(testbed_instance, guid):
 
 def status_application(testbed_instance, guid):
     if guid not in testbed_instance.elements.keys():
-        return STATUS_NOT_STARTED
+        return AS.STATUS_NOT_STARTED
     
     app = testbed_instance.elements[guid]
     return app.status()
@@ -946,7 +947,7 @@ factories_info = dict({
     NODE: dict({
             "allow_routes": True,
             "help": "Virtualized Node (V-Server style)",
-            "category": "topology",
+            "category": FC.CATEGORY_NODES,
             "create_function": create_node,
             "preconfigure_function": configure_node,
             "prestart_function": configure_node_routes,
@@ -970,7 +971,7 @@ factories_info = dict({
     NODEIFACE: dict({
             "has_addresses": True,
             "help": "External network interface - they cannot be brought up or down, and they MUST be connected to the internet.",
-            "category": "devices",
+            "category": FC.CATEGORY_DEVICES,
             "create_function": create_nodeiface,
             "preconfigure_function": configure_nodeiface,
             "box_attributes": [ ],
@@ -979,7 +980,7 @@ factories_info = dict({
     TUNIFACE: dict({
             "allow_addresses": True,
             "help": "Virtual TUN network interface (layer 3)",
-            "category": "devices",
+            "category": FC.CATEGORY_DEVICES,
             "create_function": create_tuniface,
             "preconfigure_function": preconfigure_tuniface,
             "configure_function": postconfigure_tuniface,
@@ -995,7 +996,7 @@ factories_info = dict({
     TAPIFACE: dict({
             "allow_addresses": True,
             "help": "Virtual TAP network interface (layer 2)",
-            "category": "devices",
+            "category": FC.CATEGORY_DEVICES,
             "create_function": create_tapiface,
             "preconfigure_function": preconfigure_tuniface,
             "configure_function": postconfigure_tuniface,
@@ -1010,7 +1011,7 @@ factories_info = dict({
         }),
     APPLICATION: dict({
             "help": "Generic executable command line application",
-            "category": "applications",
+            "category": FC.CATEGORY_APPLICATIONS,
             "create_function": create_application,
             "start_function": start_application,
             "status_function": status_application,
@@ -1024,7 +1025,7 @@ factories_info = dict({
         }),
     DEPENDENCY: dict({
             "help": "Requirement for package or application to be installed on some node",
-            "category": "applications",
+            "category": FC.CATEGORY_APPLICATIONS,
             "create_function": create_dependency,
             "preconfigure_function": configure_dependency,
             "box_attributes": ["depends", "build-depends", "build", "install",
@@ -1034,7 +1035,7 @@ factories_info = dict({
         }),
     NEPIDEPENDENCY: dict({
             "help": "Requirement for NEPI inside NEPI - required to run testbed instances inside a node",
-            "category": "applications",
+            "category": FC.CATEGORY_APPLICATIONS,
             "create_function": create_nepi_dependency,
             "preconfigure_function": configure_dependency,
             "box_attributes": [ ],
@@ -1043,7 +1044,7 @@ factories_info = dict({
         }),
     NS3DEPENDENCY: dict({
             "help": "Requirement for NS3 inside NEPI - required to run NS3 testbed instances inside a node. It also needs NepiDependency.",
-            "category": "applications",
+            "category": FC.CATEGORY_APPLICATIONS,
             "create_function": create_ns3_dependency,
             "preconfigure_function": configure_dependency,
             "box_attributes": [ ],
@@ -1052,13 +1053,13 @@ factories_info = dict({
         }),
     INTERNET: dict({
             "help": "Internet routing",
-            "category": "topology",
+            "category": FC.CATEGORY_CHANNELS,
             "create_function": create_internet,
             "connector_types": ["devs"],
         }),
     NETPIPE: dict({
             "help": "Link emulation",
-            "category": "topology",
+            "category": FC.CATEGORY_CHANNELS,
             "create_function": create_netpipe,
             "configure_function": configure_netpipe,
             "box_attributes": ["netpipe_mode",
index f5cfa11..2a0ade0 100644 (file)
@@ -4,26 +4,49 @@
 AF_INET = 0
 AF_INET6 = 1
 
-STATUS_NOT_STARTED = 0
-STATUS_RUNNING = 1
-STATUS_FINISHED = 2
-STATUS_UNDETERMINED = 3
-
-TESTBED_STATUS_ZERO = 0
-TESTBED_STATUS_SETUP = 1
-TESTBED_STATUS_CREATED = 2
-TESTBED_STATUS_CONNECTED = 3
-TESTBED_STATUS_CROSS_CONNECTED = 4
-TESTBED_STATUS_CONFIGURED = 5
-TESTBED_STATUS_STARTED = 6
-TESTBED_STATUS_STOPPED = 7
-
 TIME_NOW = "0s"
 
 CONNECTION_DELAY = 0
 
 ATTR_NEPI_TESTBED_ENVIRONMENT_SETUP = "_nepi_testbed_environment_setup"
 
+class AttributeCategories:
+    CATEGORY_DEPLOYMENT = "Deployment"
+   
+class FactoryCategories:
+    CATEGORY_APPLICATIONS = "Applications"
+    CATEGORY_CHANNELS = "Channels"
+    CATEGORY_DEVICES = "Devices"
+    CATEGORY_DELAY_MODELS = "Delay models"
+    CATEGORY_ENERGY_MODELS = "Energy models"
+    CATEGORY_ERROR_MODELS = "Error models"
+    CATEGORY_MAC_MODELS = "Mac models"
+    CATEGORY_MANAGERS = "Managers"
+    CATEGORY_MOBILITY_MODELS = "Mobility models"
+    CATEGORY_NODES = "Nodes"
+    CATEGORY_LOSS_MODELS = "Loss models"
+    CATEGORY_PHY_MODELS = "Phy models"
+    CATEGORY_PROTOCOLS = "Protocols"
+    CATEGORY_ROUTING = "Routing"
+    CATEGORY_QUEUES = "Queues"
+    CATEGORY_SERVICE_FLOWS = "Service Flows"
+    CATEGORY_TUNNELS = "Tunnels"
+
+class ApplicationStatus:
+    STATUS_NOT_STARTED = 0
+    STATUS_RUNNING = 1
+    STATUS_FINISHED = 2
+    STATUS_UNDETERMINED = 3
+
+class TestbedStatus:
+    STATUS_ZERO = 0
+    STATUS_SETUP = 1
+    STATUS_CREATED = 2
+    STATUS_CONNECTED = 3
+    STATUS_CROSS_CONNECTED = 4
+    STATUS_CONFIGURED = 5
+    STATUS_STARTED = 6
+    STATUS_STOPPED = 7
 
 class DeploymentConfiguration:
     MODE_SINGLE_PROCESS = "SINGLE"
index 8401533..e9a67c1 100755 (executable)
@@ -22,6 +22,10 @@ class DesignTestCase(unittest.TestCase):
         node2 = desc.create("Node")
         iface1 = desc.create("Interface")
         iface1.set_attribute_value("fake", True)
+        addr1 = iface1.add_address()
+        addr2 = iface1.add_address()
+        addr3 = iface1.add_address()
+        self.assertRaises(RuntimeError, iface1.add_address)
         node1.connector("devs").connect(iface1.connector("node"))
         iface2 = desc.create("Interface")
         iface2.set_attribute_value("fake", True)
index 5e0b04e..f20b9a2 100755 (executable)
@@ -2,7 +2,7 @@
 # -*- coding: utf-8 -*-
 
 from nepi.util import tags
-from nepi.util.constants import STATUS_FINISHED
+from nepi.util.constants import ApplicationStatus as AS
 import getpass
 import mock
 import mock.metadata_v01 
@@ -41,7 +41,7 @@ class ExecuteTestCase(unittest.TestCase):
         instance.start()
         attr_list = instance.get_attribute_list(5)
         self.assertEquals(attr_list, ["test", "fake", "cross", "label"])
-        while instance.status(7) != STATUS_FINISHED:
+        while instance.status(7) != AS.STATUS_FINISHED:
             time.sleep(0.5)
         app_result = instance.trace(7, "fake")
         comp_result = """PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
index aee5acf..a2f0b1f 100755 (executable)
@@ -3,7 +3,7 @@
 
 from nepi.core.design import ExperimentDescription, FactoriesProvider
 from nepi.util import proxy
-from nepi.util.constants import STATUS_FINISHED, DeploymentConfiguration as DC
+from nepi.util.constants import DeploymentConfiguration as DC
 import getpass
 import mock
 import mock.metadata_v01
index 2b7d37c..88d5410 100644 (file)
@@ -5,7 +5,7 @@ from constants import TESTBED_ID
 from nepi.core import metadata
 from nepi.core.attributes import Attribute
 from nepi.util import validation, tags
-from nepi.util.constants import STATUS_FINISHED
+from nepi.util.constants import ApplicationStatus as AS
 
 NODE = "Node"
 IFACE = "Interface"
@@ -33,7 +33,7 @@ def create_application(testbed_instance, guid):
 ### Status functions ###
 
 def status_application(testbed_instance, guid):
-    return STATUS_FINISHED
+    return AS.STATUS_FINISHED
 
 ### Factory information ###
 
@@ -113,7 +113,15 @@ attributes = dict({
                 "type": Attribute.BOOL,
                 "value": False,
                 "validation_function": validation.is_bool
-        })
+        }),
+    "MaxAddresses": dict({
+                "name": "MaxAddresses",
+                "help": "Attribute that indicates the maximum number of addresses for an interface",
+                "type": Attribute.INTEGER,
+                "value": 3,
+                "flags": Attribute.Invisible,
+                "validation_function": validation.is_integer
+       })
     })
 
 traces = dict({
@@ -145,7 +153,7 @@ factories_info = dict({
             "stop_function": None,
             "status_function": None,
             "allow_addresses": True,
-            "factory_attributes": ["fake"],
+            "factory_attributes": ["fake", "MaxAddresses"],
             "box_attributes": ["fake", "test", "cross"],
             "connector_types": ["node", "iface", "cross"]
        }),
index 39757bd..44fc8fb 100644 (file)
@@ -5,7 +5,7 @@ from constants import TESTBED_ID
 from nepi.core import metadata
 from nepi.core.attributes import Attribute
 from nepi.util import validation
-from nepi.util.constants import STATUS_FINISHED
+from nepi.util.constants import ApplicationStatus as AS
 
 NODE = "Node"
 IFACE = "Interface"
@@ -33,7 +33,7 @@ def create_application(testbed_instance, guid):
 ### Status functions ###
 
 def status_application(testbed_instance, guid):
-    return STATUS_FINISHED
+    return AS.STATUS_FINISHED
 
 ### Factory information ###
 
index 178d773..e9591f3 100755 (executable)
@@ -2,7 +2,7 @@
 # -*- coding: utf-8 -*-
 
 import getpass
-from nepi.util.constants import STATUS_FINISHED
+from nepi.util.constants import ApplicationStatus as AS
 from nepi.testbeds import netns
 import os
 import shutil
@@ -49,7 +49,7 @@ class NetnsExecuteTestCase(unittest.TestCase):
         instance.do_configure()
         instance.do_prestart()
         instance.start()
-        while instance.status(7) != STATUS_FINISHED:
+        while instance.status(7) != AS.STATUS_FINISHED:
             time.sleep(0.5)
         ping_result = instance.trace(7, "stdout")
         comp_result = """PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
@@ -92,7 +92,7 @@ class NetnsExecuteTestCase(unittest.TestCase):
         instance.do_configure()
         instance.do_prestart()
         instance.start()
-        while instance.status(6) != STATUS_FINISHED:
+        while instance.status(6) != AS.STATUS_FINISHED:
             time.sleep(0.5)
         ping_result = instance.trace(6, "stdout")
         comp_result = """PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
@@ -154,7 +154,7 @@ class NetnsExecuteTestCase(unittest.TestCase):
         instance.do_configure()
         instance.do_prestart()
         instance.start()
-        while instance.status(11) != STATUS_FINISHED:
+        while instance.status(11) != AS.STATUS_FINISHED:
             time.sleep(0.5)
         ping_result = instance.trace(11, "stdout")
         comp_result = """PING 10.0.1.2 (10.0.1.2) 56(84) bytes of data.
@@ -198,7 +198,7 @@ class NetnsExecuteTestCase(unittest.TestCase):
         instance.do_configure()
         instance.do_prestart()
         instance.start()
-        while instance.status(6) != STATUS_FINISHED:
+        while instance.status(6) != AS.STATUS_FINISHED:
             time.sleep(0.5)
         pcap_result = instance.trace(2, "pcap")
         self.assertEquals(len(pcap_result), 1024)
index be983db..c67e777 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
-from nepi.util.constants import STATUS_FINISHED
+from nepi.util.constants import ApplicationStatus as AS
 from nepi.testbeds import ns3
 import os
 import shutil
@@ -71,7 +71,7 @@ class Ns3ExecuteTestCase(unittest.TestCase):
         instance.do_configure()
         instance.do_prestart()
         instance.start()
-        while instance.status(17) != STATUS_FINISHED:
+        while instance.status(17) != AS.STATUS_FINISHED:
             time.sleep(0.1)
         ping_result = instance.trace(14, "P2PAsciiTrace")
         ping_rtt = instance.trace(17, "Rtt")
index 3072097..554151f 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
-from nepi.util.constants import STATUS_FINISHED
+from nepi.util.constants import ApplicationStatus as AS
 from nepi.testbeds import ns3
 import os
 import shutil
@@ -106,7 +106,7 @@ class Ns3ExecuteTestCase(unittest.TestCase):
         instance.do_configure()
         instance.do_prestart()
         instance.start()
-        while instance.status(27) != STATUS_FINISHED:
+        while instance.status(27) != AS.STATUS_FINISHED:
             time.sleep(0.1)
         ping_result = instance.trace(24, "P2PAsciiTrace")
         comp_result = "- 9.04199 /NodeList/2/DeviceList/0/$ns3::PointToPointNetDevice/TxQueue/Dequeue ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 ttl 64 id 9 protocol 1 offset 0 flags [none] length: 84 10.0.1.2 > 10.0.0.1) ns3::Icmpv4Header (type=0, code=0) ns3::Icmpv4Echo (identifier=0, sequence=9)"
index ecff9e6..7170d15 100755 (executable)
@@ -2,7 +2,7 @@
 # -*- coding: utf-8 -*-
 
 import getpass
-from nepi.util.constants import STATUS_FINISHED
+from nepi.util.constants import ApplicationStatus as AS
 from nepi.testbeds import planetlab
 import os
 import shutil
@@ -99,7 +99,7 @@ class PlanetLabExecuteTestCase(unittest.TestCase):
             
             instance.do_prestart()
             instance.start()
-            while instance.status(7) != STATUS_FINISHED:
+            while instance.status(7) != AS.STATUS_FINISHED:
                 time.sleep(0.5)
             ping_result = instance.trace(7, "stdout") or ""
             instance.stop()
@@ -137,7 +137,7 @@ class PlanetLabExecuteTestCase(unittest.TestCase):
             
             instance.do_prestart()
             instance.start()
-            while instance.status(5) != STATUS_FINISHED:
+            while instance.status(5) != AS.STATUS_FINISHED:
                 time.sleep(0.5)
             ping_result = instance.trace(5, "stdout") or ""
             comp_result = r".*GNU Fortran \(GCC\).*"
@@ -195,7 +195,7 @@ FIONREAD = 0x[0-9a-fA-F]{8}.*
             
             instance.do_prestart()
             instance.start()
-            while instance.status(10) != STATUS_FINISHED:
+            while instance.status(10) != AS.STATUS_FINISHED:
                 time.sleep(0.5)
             ping_result = instance.trace(10, "stdout") or ""
             instance.stop()
@@ -244,7 +244,7 @@ echo 'OKIDOKI'
             
             instance.do_prestart()
             instance.start()
-            while instance.status(6) != STATUS_FINISHED:
+            while instance.status(6) != AS.STATUS_FINISHED:
                 time.sleep(0.5)
             test_result = (instance.trace(6, "stdout") or "").strip()
             comp_result = "OKIDOKI"
@@ -293,7 +293,7 @@ echo 'OKIDOKI'
             
             instance.do_prestart()
             instance.start()
-            while instance.status(8) != STATUS_FINISHED:
+            while instance.status(8) != AS.STATUS_FINISHED:
                 time.sleep(0.5)
             test_result = (instance.trace(8, "stderr") or "").strip()
             comp_result = r".*real\s*(?P<min>[0-9]+)m(?P<sec>[0-9]+[.][0-9]+)s.*"
@@ -399,7 +399,7 @@ echo 'OKIDOKI'
             
             instance.do_prestart()
             instance.start()
-            while instance.status(9) != STATUS_FINISHED:
+            while instance.status(9) != AS.STATUS_FINISHED:
                 time.sleep(0.5)
             ping_result = instance.trace(9, "stdout") or ""
             packets1 = instance.trace(7, "packets") or ""
@@ -458,7 +458,7 @@ echo 'OKIDOKI'
             
             instance.do_prestart()
             instance.start()
-            while instance.status(12) != STATUS_FINISHED:
+            while instance.status(12) != AS.STATUS_FINISHED:
                 time.sleep(0.5)
             ping_result = (instance.trace(12, "stderr") or "").strip()
             instance.stop()
@@ -500,7 +500,7 @@ echo 'OKIDOKI'
             
             instance.do_prestart()
             instance.start()
-            while instance.status(12) != STATUS_FINISHED:
+            while instance.status(12) != AS.STATUS_FINISHED:
                 time.sleep(0.5)
             ping_result = (instance.trace(12, "stderr") or "").strip()
             instance.stop()
@@ -555,7 +555,7 @@ echo 'OKIDOKI'
             
             instance.do_prestart()
             instance.start()
-            while instance.status(7) != STATUS_FINISHED:
+            while instance.status(7) != AS.STATUS_FINISHED:
                 time.sleep(0.5)
             ping_result = instance.trace(7, "stdout") or ""
             instance.stop()