are going to be manipulated by the end-user in a script or GUI.
"""
def __init__(self):
+ super(AttributesMap, self).__init__()
self._attributes = dict()
@property
from nepi.util.guid import GuidGenerator
from nepi.util.graphical_info import GraphicalInfo
from nepi.util.parser._xml import XmlExperimentParser
+from nepi.util.tags import Taggable
import sys
class Connector(object):
flags = Attribute.HasNoDefaultValue,
validation_function = validation.is_integer)
-class Box(AttributesMap):
+class Box(AttributesMap, Taggable):
def __init__(self, guid, factory, testbed_guid, container = None):
super(Box, self).__init__()
# guid -- global unique identifier
self._container = container
# traces -- list of available traces for the box
self._traces = dict()
- # tags -- list of tags for the box
- self._tags = list()
# connectors -- list of available connectors for the box
self._connectors = dict()
# factory_attributes -- factory attributes for box construction
trace = Trace(name, help, enabled)
self._traces[name] = trace
for tag_id in factory.tags:
- self._tags.append(tag_id)
+ self.add_tag(tag_id)
for attr in factory.box_attributes.attributes:
self.add_attribute(attr.name, attr.help, attr.type, attr.value,
attr.range, attr.allowed, attr.flags,
def factory_attributes(self):
return self._factory_attributes
- @property
- def tags(self):
- return self._tags
-
def trace_help(self, trace_id):
return self._traces[trace_id].help
# -*- coding: utf-8 -*-
from nepi.core.attributes import AttributesMap, Attribute
+from nepi.util import tags
+from nepi.util.tags import Taggable
class AddressableMixin(object):
def __init__(self, guid, factory, testbed_guid, container = None):
MixIn.__name__.replace('MixIn','')+'Box',
1)
-class Factory(AttributesMap):
+class Factory(AttributesMap, Taggable):
_box_class_cache = {}
def __init__(self, factory_id,
preconfigure_function,
prestart_function,
help = None,
- category = None,
- allow_addresses = False,
- has_addresses = False,
- allow_routes = False,
- has_routes = False):
+ category = None):
super(Factory, self).__init__()
self._factory_id = factory_id
- self._allow_addresses = bool(allow_addresses)
- self._allow_routes = bool(allow_routes)
- self._has_addresses = bool(has_addresses) or self._allow_addresses
- self._has_routes = bool(has_routes) or self._allow_routes
self._create_function = create_function
self._start_function = start_function
self._stop_function = stop_function
self._category = category
self._connector_types = dict()
self._traces = dict()
- self._tags = list()
self._box_attributes = AttributesMap()
+ self._factory = None
+
+ @property
+ def factory(self):
+ if self._factory:
+ return self._factory
from nepi.core.design import Box
- if not self._has_addresses and not self._has_routes:
+
+ if not self.has_addresses and not self.has_routes:
self._factory = Box
else:
- addresses = 'w' if self._allow_addresses else ('r' if self._has_addresses else '-')
- routes = 'w' if self._allow_routes else ('r' if self._has_routes else '-')
+ addresses = 'w' if self.allow_addresses else ('r' if self.has_addresses else '-')
+ routes = 'w' if self.allow_routes else ('r' if self.has_routes else '-')
key = addresses+routes
if key in self._box_class_cache:
super(_factory, self).__init__(guid, factory, testbed_guid, container)
# Add mixins, one by one
- if allow_addresses:
+ if self.allow_addresses:
MixIn(_factory, UserAddressableMixin)
- elif has_addresses:
+ elif self.has_addresses:
MixIn(_factory, AddressableMixin)
- if allow_routes:
+ if self.allow_routes:
MixIn(_factory, UserRoutableMixin)
- elif has_routes:
+ elif self.has_routes:
MixIn(_factory, RoutableMixin)
# Put into cache
self._box_class_cache[key] = self._factory = _factory
+ return self._factory
@property
def factory_id(self):
@property
def allow_addresses(self):
- return self._allow_addresses
+ return self.has_tag(tags.ALLOW_ADDRESSES)
@property
def allow_routes(self):
- return self._allow_routes
+ return self.has_tag(tags.ALLOW_ROUTES)
@property
def has_addresses(self):
- return self._has_addresses
+ return self.has_tag(tags.HAS_ADDRESSES) or \
+ self.allow_addresses
@property
def has_routes(self):
- return self._has_routes
+ return self.has_tag(tags.HAS_ROUTES) or \
+ self.allow_routes
@property
def help(self):
def traces_list(self):
return self._traces.keys()
- @property
- def tags(self):
- return self._tags
-
@property
def box_attributes(self):
return self._box_attributes
def add_trace(self, name, help, enabled = False):
self._traces[name] = (name, help, enabled)
- def add_tag(self, tag_id):
- self._tags.append(tag_id)
-
def add_box_attribute(self, name, help, type, value = None, range = None,
allowed = None, flags = Attribute.NoFlags, validation_function = None,
category = None):
allowed, flags, validation_function, category)
def create(self, guid, testbed_description):
- return self._factory(guid, self, testbed_description.guid)
+ return self.factory(guid, self, testbed_description.guid)
def destroy(self):
super(Factory, self).destroy()
def factories_info(self):
""" dictionary of dictionaries of factory specific information
factory_id: dict({
- "allow_addresses": whether the box allows adding IP addresses,
- "allow_routes": wether the box allows adding routes,
- "has_addresses": whether the box allows obtaining IP addresses,
- "has_routes": wether the box allows obtaining routes,
"help": help text,
"category": category the element belongs to,
"create_function": function for element instantiation,
configure_function = info.get("configure_function")
preconfigure_function = info.get("preconfigure_function")
prestart_function = info.get("prestart_function")
- allow_addresses = info.get("allow_addresses", False)
- allow_routes = info.get("allow_routes", False)
- has_addresses = info.get("has_addresses", False)
- has_routes = info.get("has_routes", False)
help = info["help"]
category = info["category"]
factory = Factory(factory_id,
preconfigure_function,
prestart_function,
help,
- category,
- allow_addresses,
- has_addresses,
- allow_routes,
- has_routes)
+ category)
factory_attributes = self._factory_attributes(factory_id, info)
self._add_attributes(factory.add_attribute, factory_attributes)
from constants import TESTBED_ID
from nepi.core import metadata
from nepi.core.attributes import Attribute
-from nepi.util import validation
+from nepi.util import tags, validation
from nepi.util.constants import ApplicationStatus as AS, \
FactoryCategories as FC
factories_info = dict({
NODE: dict({
- "allow_routes": True,
"help": "Emulated Node with virtualized network stack",
"category": FC.CATEGORY_NODES,
"create_function": create_node,
"configure_function": configure_node,
"box_attributes": ["forward_X11"],
"connector_types": ["devs", "apps"],
- "traces": ["node_pcap"]
+ "traces": ["node_pcap"],
+ "tags": [tags.NODE, tags.ALLOW_ROUTES],
}),
P2PIFACE: dict({
- "allow_addresses": True,
"help": "Point to point network interface",
"category": FC.CATEGORY_DEVICES,
"create_function": create_p2piface,
"configure_function": configure_device,
"box_attributes": ["lladdr", "up", "device_name", "mtu",
"multicast", "broadcast", "arp"],
- "connector_types": ["node", "p2p"]
+ "connector_types": ["node", "p2p"],
+ "tags": [tags.INTERFACE, tags.ALLOW_ADDRESSES],
}),
TAPIFACE: dict({
- "allow_addresses": True,
"help": "Tap device network interface",
"category": FC.CATEGORY_DEVICES,
"create_function": create_tapiface,
"configure_function": configure_device,
"box_attributes": ["lladdr", "up", "device_name", "mtu",
"multicast", "broadcast", "arp"],
- "connector_types": ["node", "fd->"]
+ "connector_types": ["node", "fd->"],
+ "tags": [tags.INTERFACE, tags.ALLOW_ADDRESSES],
}),
NODEIFACE: dict({
- "allow_addresses": True,
"help": "Node network interface",
"category": FC.CATEGORY_DEVICES,
"create_function": create_nodeiface,
"configure_function": configure_device,
"box_attributes": ["lladdr", "up", "device_name", "mtu",
"multicast", "broadcast", "arp"],
- "connector_types": ["node", "switch"]
+ "connector_types": ["node", "switch"],
+ "tags": [tags.INTERFACE, tags.ALLOW_ADDRESSES],
}),
SWITCH: dict({
"display_name": "Switch",
#TODO: Add attribute ("HelloTime", help, type, value, range, allowed, readonly, validation_function),
#TODO: Add attribute ("AgeingTime", help, type, value, range, allowed, readonly, validation_function),
#TODO: Add attribute ("MaxAge", help, type, value, range, allowed, readonly, validation_function)
- "connector_types": ["devs"]
+ "connector_types": ["devs"],
+ "tags": [tags.SWITCH],
}),
APPLICATION: dict({
"help": "Generic executable command line application",
"status_function": status_application,
"box_attributes": ["command", "user"],
"connector_types": ["node"],
- "traces": ["stdout", "stderr"]
+ "traces": ["stdout", "stderr"],
+ "tags": [tags.APPLICATION],
}),
TUNCHANNEL : dict({
- "category": FC.CATEGORY_TUNNELS,
- "create_function": create_tunchannel,
- "preconfigure_function": preconfigure_tunchannel,
- "configure_function": postconfigure_tunchannel,
- "prestart_function": wait_tunchannel,
- "help": "Channel to forward "+TAPIFACE+" data to "
+ "category": FC.CATEGORY_TUNNELS,
+ "create_function": create_tunchannel,
+ "preconfigure_function": preconfigure_tunchannel,
+ "configure_function": postconfigure_tunchannel,
+ "prestart_function": wait_tunchannel,
+ "help": "Channel to forward "+TAPIFACE+" data to "
"other TAP interfaces supporting the NEPI tunneling protocol.",
- "connector_types": ["->fd", "udp", "tcp"],
- "allow_addresses": False,
- "box_attributes": ["tun_proto", "tun_addr", "tun_port", "tun_key"]
+ "connector_types": ["->fd", "udp", "tcp"],
+ "allow_addresses": False,
+ "box_attributes": ["tun_proto", "tun_addr", "tun_port", "tun_key"],
+ "tags": [tags.TUNNEL],
}),
})
"category": FC.CATEGORY_APPLICATIONS,
"create_function": create_element,
"configure_function": configure_element,
- "help": "",
- "connector_types": [],
"stop_function": stop_application,
"start_function": start_application,
"status_function": status_application,
+ "help": "",
+ "connector_types": [],
"box_attributes": ["MaxPackets",
"Interval",
"RemoteIpv6",
"PacketSize",
"StartTime",
"StopTime"],
+ "tags": [tags.APPLICATION],
}),
"ns3::UdpL4Protocol": dict({
"category": FC.CATEGORY_PROTOCOLS,
"help": "",
"connector_types": ["node"],
"box_attributes": ["ProtocolNumber"],
+ "tags": [tags.PROTOCOL],
}),
"ns3::RandomDiscPositionAllocator": dict({
"category": FC.CATEGORY_MOBILITY_MODELS,
"configure_function": configure_node,
"help": "",
"connector_types": ["devs", "apps", "protos", "mobility"],
- "allow_routes": True,
- "box_attributes": [],
+ "tags": [tags.NODE, tags.ALLOW_ROUTES],
}),
"ns3::GridPositionAllocator": dict({
"category": FC.CATEGORY_MOBILITY_MODELS,
"DeltaX",
"DeltaY",
"LayoutType"],
- "tags": [tags.MOBILE],
}),
"ns3::TapBridge": dict({
"category": FC.CATEGORY_DEVICES,
"configure_function": configure_element,
"help": "",
"connector_types": [],
- "allow_addresses": True,
"box_attributes": ["Mtu",
"DeviceName",
"Gateway",
"Netmask",
"Start",
"Stop"],
+ "tags": [tags.INTERFACE, tags.ALLOW_ADDRESSES],
}),
"ns3::FlowMonitor": dict({
- "category": "",
+ "category": FC.CATEGORY_SERVICE_FLOWS,
"create_function": create_element,
"configure_function": configure_element,
"help": "",
"StartTime",
"StopTime"],
"traces": ["rtt"],
+ "tags": [tags.APPLICATION],
}),
"ns3::dot11s::PeerLink": dict({
"category": "",
"configure_function": configure_device,
"help": "",
"connector_types": ["node", "err", "queue", "chan"],
- "allow_addresses": True,
"box_attributes": ["Mtu",
"Address",
"DataRate",
"InterframeGap"],
- "traces": ["p2ppcap", "p2pascii"]
+ "traces": ["p2ppcap", "p2pascii"],
+ "tags": [tags.INTERFACE, tags.ALLOW_ADDRESSES],
}),
"ns3::NakagamiPropagationLossModel": dict({
"category": FC.CATEGORY_LOSS_MODELS,
"Protocol",
"StartTime",
"StopTime"],
+ "tags": [tags.APPLICATION],
}),
"ns3::AdhocWifiMac": dict({
"category": FC.CATEGORY_MAC_MODELS,
"configure_function": configure_device,
"help": "Network interface associated to a file descriptor",
"connector_types": ["node", "->fd"],
- "allow_addresses": True,
"box_attributes": ["Address",
"LinuxSocketAddress",
"tun_proto", "tun_addr", "tun_port", "tun_key"],
- "traces": ["fdpcap"]
+ "traces": ["fdpcap"],
+ "tags": [tags.INTERFACE, tags.ALLOW_ADDRESSES],
}),
"ns3::Nepi::TunChannel": dict({
"category": FC.CATEGORY_TUNNELS,
"other TAP interfaces supporting the NEPI tunneling protocol.",
"connector_types": ["fd->", "udp", "tcp"],
"allow_addresses": False,
- "box_attributes": ["tun_proto", "tun_addr", "tun_port", "tun_key"]
+ "box_attributes": ["tun_proto", "tun_addr", "tun_port", "tun_key"],
+ "tags": [tags.TUNNEL],
+
}),
"ns3::CsmaNetDevice": dict({
"category": FC.CATEGORY_DEVICES,
"configure_function": configure_device,
"help": "CSMA (carrier sense, multiple access) interface",
"connector_types": ["node", "chan", "err", "queue"],
- "allow_addresses": True,
"box_attributes": ["Address",
"Mtu",
"SendEnable",
"ReceiveEnable"],
- "traces": ["csmapcap", "csmapcap_promisc"]
+ "traces": ["csmapcap", "csmapcap_promisc"],
+ "tags": [tags.INTERFACE, tags.ALLOW_ADDRESSES],
}),
"ns3::UanPropModelThorp": dict({
"category": "",
"configure_function": configure_element,
"help": "",
"connector_types": ["node", "chan"],
- "allow_addresses": True,
"box_attributes": [],
+ "tags": [tags.INTERFACE, tags.ALLOW_ADDRESSES],
}),
"ns3::FriisPropagationLossModel": dict({
"category": FC.CATEGORY_LOSS_MODELS,
"help": "",
"connector_types": [],
"box_attributes": [],
+ "tags": [tags.INTERFACE, tags.ALLOW_ADDRESSES],
}),
"ns3::ConstantSpeedPropagationDelayModel": dict({
"category": FC.CATEGORY_DELAY_MODELS,
"configure_function": configure_station,
"help": "Base station for wireless mobile network",
"connector_types": ["node", "chan", "phy", "uplnk", "dwnlnk"],
- "allow_addresses": True,
"box_attributes": ["InitialRangInterval",
"DcdInterval",
"UcdInterval",
"RTG",
"TTG"],
"traces": ["wimaxpcap", "wimaxascii"],
+ "tags": [tags.INTERFACE, tags.ALLOW_ADDRESSES],
}),
"ns3::UdpServer": dict({
"category": FC.CATEGORY_APPLICATIONS,
"Start",
"Stop",
"RxQueueSize"],
+ "tags": [tags.INTERFACE, tags.ALLOW_ADDRESSES],
}),
"ns3::Ipv6ExtensionLooseRouting": dict({
"category": FC.CATEGORY_ROUTING,
"connector_types": [],
"box_attributes": ["Address",
"Mtu"],
+ "tags": [tags.INTERFACE, tags.ALLOW_ADDRESSES],
}),
"ns3::MatrixPropagationLossModel": dict({
"category": FC.CATEGORY_LOSS_MODELS,
"configure_function": configure_device,
"help": "",
"connector_types": ["node", "mac", "phy", "manager"],
- "allow_addresses": True,
"box_attributes": ["Mtu"],
+ "tags": [tags.INTERFACE, tags.ALLOW_ADDRESSES],
}),
"ns3::CsmaChannel": dict({
"category": FC.CATEGORY_CHANNELS,
"configure_function": configure_element,
"help": "",
"connector_types": ["node"],
- "allow_addresses": True,
"box_attributes": ["Mtu",
"EnableLearning",
"ExpirationTime"],
+ "tags": [tags.INTERFACE, tags.ALLOW_ADDRESSES],
}),
"ns3::Ipv6ExtensionRouting": dict({
"category": FC.CATEGORY_ROUTING,
"PacketSize",
"StartTime",
"StopTime"],
+ "tags": [tags.APPLICATION],
}),
"ns3::UdpClient": dict({
"category": FC.CATEGORY_APPLICATIONS,
"PacketSize",
"StartTime",
"StopTime"],
+ "tags": [tags.APPLICATION],
}),
"ns3::PointToPointChannel": dict({
"category": FC.CATEGORY_CHANNELS,
"configure_function": configure_element,
"help": "",
"connector_types": [],
- "allow_addresses": True,
"box_attributes": ["Mtu"],
+ "tags": [tags.INTERFACE, tags.ALLOW_ADDRESSES],
}),
"ns3::BasicEnergySource": dict({
"category": FC.CATEGORY_ENERGY_MODELS,
"configure_function": configure_element,
"help": "",
"connector_types": [],
- "allow_addresses": True,
"box_attributes": [],
+ "tags": [tags.INTERFACE, tags.ALLOW_ADDRESSES],
}),
"ns3::RateErrorModel": dict({
"category": FC.CATEGORY_ERROR_MODELS,
"configure_function": configure_element,
"help": "",
"connector_types": [],
- "allow_addresses": True,
"box_attributes": ["Mtu"],
+ "tags": [tags.INTERFACE, tags.ALLOW_ADDRESSES],
}),
"ns3::UanPhyGen": dict({
"category": FC.CATEGORY_PHY_MODELS,
"Protocol",
"StartTime",
"StopTime"],
+ "tags": [tags.APPLICATION],
}),
"ns3::RandomDirection2dMobilityModel": dict({
"category": FC.CATEGORY_MOBILITY_MODELS,
"box_attributes": ["Port",
"StartTime",
"StopTime"],
+ "tags": [tags.APPLICATION],
}),
"ns3::AmrrWifiManager": dict({
"category": FC.CATEGORY_MANAGERS,
"configure_function": configure_station,
"help": "Subscriber station for mobile wireless network",
"connector_types": ["node", "chan", "phy", "sflows"],
- "allow_addresses": True,
"box_attributes": ["LostDlMapInterval",
"LostUlMapInterval",
"MaxDcdInterval",
"RTG",
"TTG"],
"traces": ["wimaxpcap", "wimaxascii"],
+ "tags": [tags.INTERFACE, tags.ALLOW_ADDRESSES],
}),
"ns3::flame::FlameRtable": dict({
"category": "",
from constants import TESTBED_ID
from nepi.core import metadata
from nepi.core.attributes import Attribute
-from nepi.util import validation
+from nepi.util import tags, validation
from nepi.util.constants import ApplicationStatus as AS, \
FactoryCategories as FC, \
ATTR_NEPI_TESTBED_ENVIRONMENT_SETUP
factories_info = dict({
NODE: dict({
- "allow_routes": True,
"help": "Virtualized Node (V-Server style)",
"category": FC.CATEGORY_NODES,
"create_function": create_node,
# NEPI-in-NEPI attributes
ATTR_NEPI_TESTBED_ENVIRONMENT_SETUP,
],
- "connector_types": ["devs", "apps", "pipes", "deps"]
+ "connector_types": ["devs", "apps", "pipes", "deps"],
+ "tags": [tags.NODE, tags.ALLOW_ROUTES],
}),
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": FC.CATEGORY_DEVICES,
"create_function": create_nodeiface,
"preconfigure_function": configure_nodeiface,
"box_attributes": [ ],
- "connector_types": ["node", "inet"]
+ "connector_types": ["node", "inet"],
+ "tags": [tags.INTERFACE, tags.HAS_ADDRESSES],
}),
TUNIFACE: dict({
- "allow_addresses": True,
"help": "Virtual TUN network interface (layer 3)",
"category": FC.CATEGORY_DEVICES,
"create_function": create_tuniface,
"tun_proto", "tun_addr", "tun_port", "tun_key"
],
"traces": ["packets"],
- "connector_types": ["node","udp","tcp","fd->"]
+ "connector_types": ["node","udp","tcp","fd->"],
+ "tags": [tags.INTERFACE, tags.ALLOW_ADDRESSES],
}),
TAPIFACE: dict({
- "allow_addresses": True,
"help": "Virtual TAP network interface (layer 2)",
"category": FC.CATEGORY_DEVICES,
"create_function": create_tapiface,
"tun_proto", "tun_addr", "tun_port", "tun_key"
],
"traces": ["packets"],
- "connector_types": ["node","udp","tcp","fd->"]
+ "connector_types": ["node","udp","tcp","fd->"],
+ "tags": [tags.INTERFACE, tags.ALLOW_ADDRESSES],
}),
APPLICATION: dict({
"help": "Generic executable command line application",
"depends", "build-depends", "build", "install",
"sources", "rpm-fusion" ],
"connector_types": ["node"],
- "traces": ["stdout", "stderr", "buildlog"]
+ "traces": ["stdout", "stderr", "buildlog"],
+ "tags": [tags.APPLICATION],
}),
DEPENDENCY: dict({
"help": "Requirement for package or application to be installed on some node",
"box_attributes": ["depends", "build-depends", "build", "install",
"sources", "rpm-fusion" ],
"connector_types": ["node"],
- "traces": ["buildlog"]
+ "traces": ["buildlog"],
}),
NEPIDEPENDENCY: dict({
"help": "Requirement for NEPI inside NEPI - required to run testbed instances inside a node",
"category": FC.CATEGORY_APPLICATIONS,
"create_function": create_nepi_dependency,
"preconfigure_function": configure_dependency,
- "box_attributes": [ ],
+ "box_attributes": [],
"connector_types": ["node"],
- "traces": ["buildlog"]
+ "traces": ["buildlog"],
}),
NS3DEPENDENCY: dict({
"help": "Requirement for NS3 inside NEPI - required to run NS3 testbed instances inside a node. It also needs NepiDependency.",
"preconfigure_function": configure_dependency,
"box_attributes": [ ],
"connector_types": ["node"],
- "traces": ["buildlog"]
+ "traces": ["buildlog"],
}),
INTERNET: dict({
"help": "Internet routing",
"category": FC.CATEGORY_CHANNELS,
"create_function": create_internet,
"connector_types": ["devs"],
+ "tags": [tags.INTERNET],
}),
NETPIPE: dict({
"help": "Link emulation",
"bw_in","plr_in","delay_in",
"bw_out","plr_out","delay_out"],
"connector_types": ["node"],
- "traces": ["netpipe_stats"]
+ "traces": ["netpipe_stats"],
}),
})
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-MOBILE = 0
+MOBILE = "mobile"
+NODE = "node"
+INTERFACE = "interface"
+WIRELESS = "wireless"
+APPLICATION = "application"
+NAT = "nat"
+ROUTER = "router"
+SWITCH = "switch"
+PPP = "point-to-point"
+PROTOCOL = "protocol"
+TUNNEL = "tunnel"
+INTERNET = "internet"
+HUB = "hub"
+ALLOW_ADDRESSES = "allow_addresses"
+ALLOW_ROUTES = "allow_routes"
+HAS_ADDRESSES = "has_addresses"
+HAS_ROUTES = "has_routes"
+
+class Taggable(object):
+ def __init__(self):
+ super(Taggable, self).__init__()
+ self._tags = list()
+
+ @property
+ def tags(self):
+ return self._tags
+
+ def add_tag(self, tag_id):
+ self._tags.append(tag_id)
+
+ def has_tag(self, tag_id):
+ return tag_id in self._tags
app.connector("node").connect(node1.connector("apps"))
app.enable_trace("fake")
- self.assertEquals(node1.tags, [tags.MOBILE])
+ self.assertEquals(node1.tags, [tags.MOBILE, tags.NODE, tags.ALLOW_ROUTES])
xml = exp_desc.to_xml()
exp_desc2 = ExperimentDescription()
"status_function": None,
"box_attributes": ["fake","test"],
"connector_types": ["devs", "apps"],
- "tags": [tags.MOBILE]
+ "tags": [tags.MOBILE, tags.NODE, tags.ALLOW_ROUTES],
}),
IFACE: dict({
"help": "Fake iface",
"allow_addresses": True,
"factory_attributes": ["fake", "MaxAddresses"],
"box_attributes": ["fake", "test", "cross"],
- "connector_types": ["node", "iface", "cross"]
+ "connector_types": ["node", "iface", "cross"],
+ "tags": [tags.INTERFACE, tags.ALLOW_ADDRESSES],
}),
APP: dict({
"help": "Fake application",
"status_function": status_application,
"box_attributes": ["fake", "test"],
"connector_types": ["node"],
- "traces": ["fake"]
+ "traces": ["fake"],
+ "tags": [tags.APPLICATION],
}),
})
from constants import TESTBED_ID
from nepi.core import metadata
from nepi.core.attributes import Attribute
-from nepi.util import validation
+from nepi.util import tags, validation
from nepi.util.constants import ApplicationStatus as AS
NODE = "Node"
"stop_function": None,
"status_function": None,
"box_attributes": ["fake","test"],
- "connector_types": ["devs", "apps"]
+ "connector_types": ["devs", "apps"],
+ "tags": [tags.NODE, tags.ALLOW_ROUTES],
}),
IFACE: dict({
"help": "Fake iface",
"allow_addresses": True,
"factory_attributes": ["fake"],
"box_attributes": ["fake", "test", "cross"],
- "connector_types": ["node", "iface", "cross"]
+ "connector_types": ["node", "iface", "cross"],
+ "tags": [tags.INTERFACE, tags.ALLOW_ADDRESSES],
}),
APP: dict({
"help": "Fake application",
"status_function": status_application,
"box_attributes": ["fake", "test"],
"connector_types": ["node"],
- "traces": ["fake"]
+ "traces": ["fake"],
+ "tags": [tags.APPLICATION],
}),
})