Merge with head
authorClaudio-Daniel Freire <claudio-daniel.freire@inria.fr>
Wed, 25 May 2011 15:48:27 +0000 (17:48 +0200)
committerClaudio-Daniel Freire <claudio-daniel.freire@inria.fr>
Wed, 25 May 2011 15:48:27 +0000 (17:48 +0200)
13 files changed:
examples/vlc_wireless_netns_ns3.py
src/nepi/core/design.py
src/nepi/core/execute.py
src/nepi/core/metadata.py
src/nepi/core/testbed_impl.py
src/nepi/testbeds/ns3/execute.py
src/nepi/util/graphical_info.py
src/nepi/util/guid.py
src/nepi/util/parser/_xml.py
src/nepi/util/parser/base.py
src/nepi/util/proxy.py
test/core/execute.py
test/core/integration.py

index 45eb72d..03c9138 100644 (file)
@@ -161,7 +161,7 @@ class VlcWirelessNetnsNs3Example(object):
         # create vlc server
         # DEBUG!! target = "{#[vlc_client].addr[0].[Address]#}"
         target = "10.0.2.2" 
-        command = "vlc -I dummy -vvv %s --sout '#rtp{dst=%s,port=5004,mux=ts}' vlc:quit" \
+        command = "vlc -I dummy -vvv %s --sout '#rtp{dst=%s,port=5004,mux=ts}' vlc://quit" \
                 % (self.movie, target)
         vlc_server = netns_desc1.create("Application")
         vlc_server.set_attribute_value("command", command)
@@ -190,9 +190,6 @@ class VlcWirelessNetnsNs3Example(object):
         vlc_client.set_attribute_value("command", command)
         vlc_client.set_attribute_value("user", self.user)
         vlc_client.connector("node").connect(node4.connector("apps"))
-        #vlc_trace = vlc_server.get_trace("StderrTrace")
-        #vlc_trace.get_attribute("Filename").value = "vlc_server.err"
-        #vlc_trace.enable()        
 
         #command = "xterm"
         #xterm2 = netns_desc2.create("Application")
index a005188..c899344 100644 (file)
@@ -13,8 +13,6 @@ from nepi.util.guid import GuidGenerator
 from nepi.util.graphical_info import GraphicalInfo
 from nepi.util.parser._xml import XmlExperimentParser
 import sys
-    
-
 
 class ConnectorType(ConnectorTypeBase):
     def __init__(self, testbed_id, factory_id, name, help, max = -1, min = 0):
@@ -115,7 +113,7 @@ class Trace(AttributesMap):
         super(Trace, self).__init__()
         self._trace_id = trace_id
         self._help = help       
-        self.enabled = enabled
+        self._enabled = enabled
     
     @property
     def trace_id(self):
@@ -125,6 +123,16 @@ class Trace(AttributesMap):
     def help(self):
         return self._help
 
+    @property
+    def enabled(self):
+        return self._enabled
+
+    def enable(self):
+        self._enabled = True
+
+    def disable(self):
+        self._enabled = False
+
 class Address(AttributesMap):
     def __init__(self):
         super(Address, self).__init__()
@@ -191,7 +199,7 @@ class Box(AttributesMap):
         # factory_attributes -- factory attributes for box construction
         self._factory_attributes = dict()
         # graphical_info -- GUI position information
-        self.graphical_info = GraphicalInfo(str(self._guid))
+        self.graphical_info = GraphicalInfo()
 
         for connector_type in factory.connector_types:
             connector = Connector(self, connector_type)
@@ -237,7 +245,7 @@ class Box(AttributesMap):
         return self._traces.values()
 
     @property
-    def traces_name(self):
+    def trace_names(self):
         return self._traces.keys()
 
     @property
@@ -260,10 +268,13 @@ class Box(AttributesMap):
         return self._traces[trace_id].help
 
     def enable_trace(self, trace_id):
-        self._traces[trace_id].enabled = True
+        self._traces[trace_id].enable()
 
     def disable_trace(self, trace_id):
-        self._traces[trace_id].enabled = False
+        self._traces[trace_id].disable()
+
+    def is_trace_enabled(self, trace_id):
+        return self._traces[trace_id].enabled
 
     def connector(self, name):
         return self._connectors[name]
@@ -514,13 +525,13 @@ class FactoriesProvider(object):
         del self._factories[factory_id]
 
 class TestbedDescription(AttributesMap):
-    def __init__(self, guid_generator, provider):
+    def __init__(self, guid_generator, provider, guid = None):
         super(TestbedDescription, self).__init__()
         self._guid_generator = guid_generator
-        self._guid = guid_generator.next()
+        self._guid = guid_generator.next(guid)
         self._provider = provider
         self._boxes = dict()
-        self.graphical_info = GraphicalInfo(str(self._guid))
+        self.graphical_info = GraphicalInfo()
 
         metadata = Metadata(provider.testbed_id, provider.testbed_version)
         for attr in metadata.testbed_attributes().attributes:
@@ -543,8 +554,8 @@ class TestbedDescription(AttributesMap):
     def box(self, guid):
         return self._boxes[guid] if guid in self._boxes else None
 
-    def create(self, factory_id):
-        guid = self._guid_generator.next()
+    def create(self, factory_id, guid = None):
+        guid = self._guid_generator.next(guid)
         factory = self._provider.factory(factory_id)
         box = factory.create(guid, self)
         self._boxes[guid] = box
@@ -561,8 +572,8 @@ class TestbedDescription(AttributesMap):
         self._boxes = None
 
 class ExperimentDescription(object):
-    def __init__(self, guid = 0):
-        self._guid_generator = GuidGenerator(guid)
+    def __init__(self):
+        self._guid_generator = GuidGenerator()
         self._testbed_descriptions = dict()
 
     @property
@@ -587,16 +598,25 @@ class ExperimentDescription(object):
             if box: return box
         return None
 
-    def add_testbed_description(self, provider):
+    def get_element(self, guid):
+        if guid in self._testbed_descriptions:
+            return self._testbed_descriptions[guid]
+        for testbed_description in self._testbed_descriptions.values():
+            box = testbed_description.box(guid)
+            if box: return box
+        return None
+
+    def add_testbed_description(self, provider, guid = None):
         testbed_description = TestbedDescription(self._guid_generator, 
-                provider)
+                provider, guid)
         guid = testbed_description.guid
         self._testbed_descriptions[guid] = testbed_description
         return testbed_description
 
-    def remove_testbed_description(self, testbed_description):
-        guid = testbed_description.guid
+    def remove_testbed_description(self, guid):
+        testbed_description = self._testbed_descriptions[guid]
         del self._testbed_descriptions[guid]
+        testbed_description.destroy()
 
     def destroy(self):
         for testbed_description in self.testbed_descriptions:
index c7919d5..b6470d5 100644 (file)
@@ -329,7 +329,7 @@ class TestbedController(object):
     def get_attribute_list(self, guid):
         raise NotImplementedError
 
-    def get_tags(self, guid):
+    def get_factory_id(self, guid):
         raise NotImplementedError
 
     def action(self, time, guid, action):
@@ -420,7 +420,7 @@ class ExperimentController(object):
             self._parallel([testbed.do_setup 
                             for guid,testbed in self._testbeds.iteritems()
                             if guid in allowed_guids])
-            
+       
             # perform create-connect in parallel, wait
             # (internal connections only)
             self._parallel([testbed.do_create
@@ -438,9 +438,10 @@ class ExperimentController(object):
             self._parallel([testbed.do_preconfigure
                             for guid,testbed in self._testbeds.iteritems()
                             if guid in allowed_guids])
-            
+            self._clear_caches()
+
         steps_to_configure(self, self._testbeds)
-        
+
         if self._netreffed_testbeds:
             # initally resolve netrefs
             self.do_netrefs(data, fail_if_undefined=False)
@@ -466,7 +467,8 @@ class ExperimentController(object):
         self._parallel([testbed.do_configure
                         for testbed in self._testbeds.itervalues()])
 
-        
+        self._clear_caches()
+
         #print >>sys.stderr, "DO IT"
         #import time
         #time.sleep(60)
@@ -479,17 +481,24 @@ class ExperimentController(object):
             cross_data = self._get_cross_data(guid)
             testbed.do_cross_connect_compl(cross_data)
        
+        self._clear_caches()
+
         # Last chance to configure (parallel on all testbeds)
         self._parallel([testbed.do_prestart
                         for testbed in self._testbeds.itervalues()])
 
-        # After this point no new elements will be craeted. Cleaning cache for safety.
-        self._guids_in_testbed_cache = dict()
+        self._clear_caches()
 
         # start experiment (parallel start on all testbeds)
         self._parallel([testbed.start
                         for testbed in self._testbeds.itervalues()])
 
+        self._clear_caches()
+
+    def _clear_caches(self):
+        # Cleaning cache for safety.
+        self._guids_in_testbed_cache = dict()
+
     def _persist_testbed_proxies(self):
         TRANSIENT = ('Recover',)
         
@@ -571,7 +580,8 @@ class ExperimentController(object):
         testbed = self._testbed_for_guid(guid)
         if testbed != None:
             testbed.set(guid, name, value, time)
-        raise RuntimeError("No element exists with guid %d" % guid)    
+        else:
+            raise RuntimeError("No element exists with guid %d" % guid)    
 
     def get(self, guid, name, time = TIME_NOW):
         testbed = self._testbed_for_guid(guid)
@@ -579,10 +589,22 @@ class ExperimentController(object):
             return testbed.get(guid, name, time)
         raise RuntimeError("No element exists with guid %d" % guid)    
 
-    def get_tags(self, guid):
+    def get_factory_id(self, guid):
+        testbed = self._testbed_for_guid(guid)
+        if testbed != None:
+            return testbed.get_factory_id(guid)
+        raise RuntimeError("No element exists with guid %d" % guid)    
+
+    def get_testbed_id(self, guid):
+        testbed = self._testbed_for_guid(guid)
+        if testbed != None:
+            return testbed.testbed_id
+        raise RuntimeError("No element exists with guid %d" % guid)    
+
+    def get_testbed_version(self, guid):
         testbed = self._testbed_for_guid(guid)
         if testbed != None:
-            return testbed.get_tags(guid)
+            return testbed.testbed_version
         raise RuntimeError("No element exists with guid %d" % guid)    
 
     def shutdown(self):
index c8015cd..b344d5a 100644 (file)
@@ -182,6 +182,13 @@ class Metadata(object):
             value = "",
             flags = Attribute.DesignOnly
         )),
+        ("label", dict(
+            name = "label",
+            validation_function = validation.is_string,
+            type = Attribute.STRING,
+            flags = Attribute.DesignOnly,
+            help = "A unique identifier for referring to this testbed",
+        )),
     )
     
     DEPLOYMENT_ATTRIBUTES = (
index b34b8fe..663851d 100644 (file)
@@ -392,15 +392,15 @@ class TestbedController(execute.TestbedController):
         
         return addresses[index][attribute_index]
 
-    def get_tags(self, guid):
-        factory = self._get_factory(guid)
-        return factory.tags
-
     def get_attribute_list(self, guid):
         factory = self._get_factory(guid)
         attribute_list = list()
         return factory.box_attributes.attributes_list
 
+    def get_factory_id(self, guid):
+        factory = self._get_factory(guid)
+        return factory.factory_id
+
     def start(self, time = TIME_NOW):
         self._do_in_factory_order(
             'start_function',
index ab34f25..b975b7f 100644 (file)
@@ -1,10 +1,11 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
-from constants import TESTBED_ID
 from nepi.core import testbed_impl
 from nepi.core.attributes import Attribute
-from nepi.util.constants import TIME_NOW
+from constants import TESTBED_ID
+from nepi.util.constants import TIME_NOW, \
+    TESTBED_STATUS_STARTED
 import os
 import sys
 import threading
@@ -69,8 +70,8 @@ class TestbedController(testbed_impl.TestbedController):
         elif factory.box_attributes.is_attribute_invisible(name):
             return
         else:
-            ns3_value = self._to_ns3_value(guid, name, value) 
-            element.SetAttribute(name, ns3_value)
+            ns3_value = self._to_ns3_value(guid, name, value)
+            self._set_attribute(name, ns3_value, element)
 
     def get(self, guid, name, time = TIME_NOW):
         value = super(TestbedController, self).get(guid, name, time)
@@ -94,7 +95,7 @@ class TestbedController(testbed_impl.TestbedController):
                 (name, guid))
         checker = info.checker
         ns3_value = checker.Create() 
-        element.GetAttribute(name, ns3_value)
+        self._get_attribute(name, ns3_value, element)
         value = ns3_value.SerializeToString(checker)
         attr_type = factory.box_attributes.get_attribute_type(name)
         if attr_type == Attribute.INTEGER:
@@ -139,13 +140,15 @@ class TestbedController(testbed_impl.TestbedController):
         """Schedules event on running experiment"""
         def execute_event(condition, has_event_occurred, func, *args):
             # exec func
-            func(*args)
-            # flag event occured
-            has_event_occurred[0] = True
-            # notify condition indicating attribute was set
-            condition.acquire()
-            condition.notifyAll()
-            condition.release()
+            try:
+                func(*args)
+            finally:
+                # flag event occured
+                has_event_occurred[0] = True
+                # notify condition indicating attribute was set
+                condition.acquire()
+                condition.notifyAll()
+                condition.release()
 
         # contextId is defined as general context
         contextId = long(0xffffffff)
@@ -162,9 +165,28 @@ class TestbedController(testbed_impl.TestbedController):
             while not has_event_occurred[0] and not self.ns3.Simulator.IsFinished():
                 condition.wait()
                 condition.release()
-                if not has_event_occurred[0]:
-                    raise RuntimeError('Event could not be scheduled : %s %s ' \
-                    % (repr(func), repr(args)))
+
+    def _set_attribute(self, name, ns3_value, element):
+        if self.status() == TESTBED_STATUS_STARTED:
+            # schedule the event in the Simulator
+            self._schedule_event(self._condition, self._set_ns3_attribute, 
+                    name, ns3_value, element)
+        else:
+            self._set_ns3_attribute(name, ns3_value, element)
+
+    def _get_attribute(self, name, ns3_value, element):
+        if self.status() == TESTBED_STATUS_STARTED:
+            # schedule the event in the Simulator
+            self._schedule_event(self._condition, self._get_ns3_attribute, 
+                    name, ns3_value, element)
+        else:
+            self._get_ns3_attribute(name, ns3_value, element)
+
+    def _set_ns3_attribute(self, name, ns3_value, element):
+        element.SetAttribute(name, ns3_value)
+
+    def _get_ns3_attribute(self, name, ns3_value, element):
+        element.GetAttribute(name, ns3_value)
 
     def _to_ns3_value(self, guid, name, value):
         factory_id = self._create[guid]
index 12a40bd..2a09ba2 100644 (file)
@@ -5,10 +5,9 @@
 class GraphicalInfo(object):
     """ This class allows to describe the position and dimensions of a 
     2D object in a GUI canvas"""
-    def __init__(self, label):
+    def __init__(self):
         self.x = 0.0
         self.y = 0.0
         self.width = 0.0
         self.height = 0.0
-        self.label = label
 
index 7e28552..3198e25 100644 (file)
@@ -2,10 +2,17 @@
 # -*- coding: utf-8 -*-
 
 class GuidGenerator(object):
-    def __init__(self, guid = 0):
-        self._last_guid = guid
+    def __init__(self):
+        self._guids = list()
 
-    def next(self):
-        self._last_guid += 1
-        return self._last_guid
+    def next(self, guid = None):
+        if guid != None:
+            if guid in self._guids:
+                raise RuntimeError("guid %d is already assigned" % guid)
+        else:
+            last_guid = 0 if len(self._guids) == 0 else self._guids[-1]
+            guid = last_guid + 1 
+        self._guids.append(guid)
+        self._guids.sort()
+        return guid
 
index b240776..7f439cf 100644 (file)
@@ -63,12 +63,11 @@ class XmlExperimentParser(ExperimentParser):
     def graphical_info_data_to_xml(self, doc, parent_tag, guid, data):
         graphical_info_tag = doc.createElement("graphical_info") 
         parent_tag.appendChild(graphical_info_tag)
-        (x, y, width, height, label) = data.get_graphical_info_data(guid)
+        (x, y, width, height) = data.get_graphical_info_data(guid)
         graphical_info_tag.setAttribute("x", str(x))
         graphical_info_tag.setAttribute("y", str(y))
         graphical_info_tag.setAttribute("width", str(width))
         graphical_info_tag.setAttribute("height", str(height))
-        graphical_info_tag.setAttribute("label", str(label))
 
     def factory_attributes_data_to_xml(self, doc, parent_tag, guid, data):
         factory_attributes_tag = doc.createElement("factory_attributes")
@@ -197,8 +196,7 @@ class XmlExperimentParser(ExperimentParser):
             y = float(graphical_info_tag.getAttribute("y"))
             width = float(graphical_info_tag.getAttribute("width"))
             height = float(graphical_info_tag.getAttribute("height"))
-            label = str(graphical_info_tag.getAttribute("label"))
-            data.add_graphical_info_data(guid, x, y, width, height, label)
+            data.add_graphical_info_data(guid, x, y, width, height)
 
     def factory_attributes_data_from_xml(self, tag, guid, data):
         factory_attributes_tag_list = tag.getElementsByTagName(
index 1737f14..fcc8efc 100644 (file)
@@ -30,7 +30,7 @@ class ExperimentData(object):
         box_data["factory_id"] = factory_id
         self.data[guid] = box_data
 
-    def add_graphical_info_data(self, guid, x, y, width, height, label):
+    def add_graphical_info_data(self, guid, x, y, width, height):
         data = self.data[guid]
         if not "graphical_info" in data:
             data["graphical_info"] = dict()
@@ -39,7 +39,6 @@ class ExperimentData(object):
         graphical_info_data["y"] = y
         graphical_info_data["width"] = width
         graphical_info_data["height"] = height
-        graphical_info_data["label"] = label
 
     def add_factory_attribute_data(self, guid, name, value):
         data = self.data[guid]
@@ -120,8 +119,7 @@ class ExperimentData(object):
         return (graphical_info_data["x"],
                 graphical_info_data["y"],
                 graphical_info_data["width"],
-                graphical_info_data["height"],
-                graphical_info_data["label"])
+                graphical_info_data["height"])
 
     def get_factory_attribute_data(self, guid):
         data = self.data[guid]
@@ -215,7 +213,7 @@ class ExperimentParser(object):
 
     def graphical_info_to_data(self, data, guid, g_info):
         data.add_graphical_info_data(guid, g_info.x, g_info.y, g_info.width, 
-                g_info.height, g_info.label)
+                g_info.height)
 
     def factory_attributes_to_data(self, data, guid, factory_attributes):
         factory_attributes = factory_attributes or dict()
@@ -273,7 +271,7 @@ class ExperimentParser(object):
         from nepi.core.design import FactoriesProvider
         (testbed_id, testbed_version) = data.get_testbed_data(guid)
         provider = FactoriesProvider(testbed_id, testbed_version)
-        experiment_description.add_testbed_description(provider)
+        experiment_description.add_testbed_description(provider, guid)
         testbed_description = experiment_description.testbed_description(guid)
         self.graphical_info_from_data(testbed_description, data)
         self.attributes_from_data(testbed_description, data)
@@ -284,7 +282,8 @@ class ExperimentParser(object):
                 testbed_guid)
         self.factory_attributes_from_data(testbed_description, factory_id,
                 guid, data)
-        box = testbed_description.create(factory_id)
+        box = testbed_description.create(factory_id, guid)
+
         self.graphical_info_from_data(box, data)
         self.attributes_from_data(box, data)
         self.traces_from_data(box, data)
@@ -292,13 +291,12 @@ class ExperimentParser(object):
         self.routes_from_data(box, data)
 
     def graphical_info_from_data(self, element, data):
-        (x, y, width, height, label) =  data.get_graphical_info_data(
+        (x, y, width, height) =  data.get_graphical_info_data(
                 element.guid)
         element.graphical_info.x = x
         element.graphical_info.y = y
         element.graphical_info.width = width
         element.graphical_info.height = height
-        element.graphical_info.label = label
 
     def factory_attributes_from_data(self, testbed_description, factory_id, 
             guid, data):
index 8db9dd7..7ed34ce 100644 (file)
@@ -53,10 +53,10 @@ DO_CONNECT_COMPL    = 33
 DO_CROSS_CONNECT_COMPL  = 34
 TESTBED_ID  = 35
 TESTBED_VERSION  = 36
-EXPERIMENT_SET = 37
-EXPERIMENT_GET = 38
-DO_PRESTART = 39
-GET_TAGS = 40
+DO_PRESTART = 37
+GET_FACTORY_ID = 38
+GET_TESTBED_ID = 39
+GET_TESTBED_VERSION = 40
 
 instruction_text = dict({
     OK:     "OK",
@@ -90,14 +90,14 @@ instruction_text = dict({
     GET_ROUTE: "GET_ROUTE",
     GET_ADDRESS: "GET_ADDRESS",
     GET_ATTRIBUTE_LIST: "GET_ATTRIBUTE_LIST",
+    GET_FACTORY_ID: "GET_FACTORY_ID",
+    GET_TESTBED_ID: "GET_TESTBED_ID",
+    GET_TESTBED_VERSION: "GET_TESTBED_VERSION",
     ACTION: "ACTION",
     STATUS: "STATUS",
     GUIDS:  "GUIDS",
     TESTBED_ID: "TESTBED_ID",
     TESTBED_VERSION: "TESTBED_VERSION",
-    EXPERIMENT_SET: "EXPERIMENT_SET",
-    EXPERIMENT_GET: "EXPERIMENT_GET",
-    GET_TAGS: "GET_TAGS",
     })
 
 def log_msg(server, params):
@@ -645,11 +645,11 @@ class TestbedControllerServer(BaseServer):
     def get_attribute_list(self, guid):
         return self._testbed.get_attribute_list(guid)
 
-    @Marshalling.handles(GET_TAGS)
+    @Marshalling.handles(GET_FACTORY_ID)
     @Marshalling.args(int)
-    @Marshalling.retval( Marshalling.pickled_data )
-    def get_tags(self, guid):
-        return self._testbed.get_tags(guid)
+    @Marshalling.retval()
+    def get_factory_id(self, guid):
+        return self._testbed.get_factory_id(guid)
 
 class ExperimentControllerServer(BaseServer):
     def __init__(self, root_dir, log_level, experiment_xml):
@@ -686,24 +686,18 @@ class ExperimentControllerServer(BaseServer):
     def is_finished(self, guid):
         return self._controller.is_finished(guid)
 
-    @Marshalling.handles(EXPERIMENT_GET)
+    @Marshalling.handles(GET)
     @Marshalling.args(int, Marshalling.base64_data, str)
     @Marshalling.retval( Marshalling.pickled_data )
     def get(self, guid, name, time):
         return self._controller.get(guid, name, time)
 
-    @Marshalling.handles(EXPERIMENT_SET)
+    @Marshalling.handles(SET)
     @Marshalling.args(int, Marshalling.base64_data, Marshalling.pickled_data, str)
     @Marshalling.retvoid
     def set(self, guid, name, value, time):
         self._controller.set(guid, name, value, time)
 
-    @Marshalling.handles(GET_TAGS)
-    @Marshalling.args(int)
-    @Marshalling.retval( Marshalling.pickled_data )
-    def get_tags(self, guid):
-        return self._controller.get_tags(guid)
-
     @Marshalling.handles(START)
     @Marshalling.args()
     @Marshalling.retvoid
@@ -728,6 +722,24 @@ class ExperimentControllerServer(BaseServer):
     def shutdown(self):
         self._controller.shutdown()
 
+    @Marshalling.handles(GET_TESTBED_ID)
+    @Marshalling.args(int)
+    @Marshalling.retval()
+    def get_testbed_id(self, guid):
+        return self._controller.get_testbed_id(guid)
+
+    @Marshalling.handles(GET_FACTORY_ID)
+    @Marshalling.args(int)
+    @Marshalling.retval()
+    def get_factory_id(self, guid):
+        return self._controller.get_factory_id(guid)
+
+    @Marshalling.handles(GET_TESTBED_VERSION)
+    @Marshalling.args(int)
+    @Marshalling.retval()
+    def get_testbed_version(self, guid):
+        return self._controller.get_testbed_version(guid)
+
 class BaseProxy(object):
     _ServerClass = None
     _ServerClassModule = "nepi.util.proxy"
index 2f39379..8055e99 100755 (executable)
@@ -50,7 +50,6 @@ class ExecuteTestCase(unittest.TestCase):
 """
         
         self.assertTrue(app_result.startswith(comp_result))
-        self.assertEquals(instance.get_tags(4), [tags.MOBILE])
 
         instance.stop()
         instance.shutdown()
index 2bd0d9b..c135b5f 100755 (executable)
@@ -2,7 +2,7 @@
 # -*- coding: utf-8 -*-
 
 from nepi.core.design import ExperimentDescription, FactoriesProvider
-from nepi.util import proxy, tags
+from nepi.util import proxy
 from nepi.util.constants import STATUS_FINISHED, DeploymentConfiguration as DC
 import mock
 import mock.metadata_v01
@@ -100,7 +100,10 @@ class ExecuteTestCase(unittest.TestCase):
 1 packets transmitted, 1 received, 0% packet loss, time 0ms
 """
         self.assertTrue(fake_result.startswith(comp_result))
-        self.assertEquals(controller.get_tags(node1.guid), [tags.MOBILE])
+
+        self.assertEquals(controller.get_testbed_id(node1.guid), "mock")
+        self.assertEquals(controller.get_testbed_version(node1.guid), "01")
+        self.assertEquals(controller.get_factory_id(node1.guid), "Node")
 
         controller.stop()
         controller.shutdown()
@@ -123,7 +126,10 @@ class ExecuteTestCase(unittest.TestCase):
 1 packets transmitted, 1 received, 0% packet loss, time 0ms
 """
         self.assertTrue(fake_result.startswith(comp_result))
-        self.assertEquals(controller.get_tags(node1.guid), [tags.MOBILE])
+
+        self.assertEquals(controller.get_testbed_id(node1.guid), "mock")
+        self.assertEquals(controller.get_testbed_version(node1.guid), "01")
+        self.assertEquals(controller.get_factory_id(node1.guid), "Node")
 
         controller.stop()
         controller.shutdown()
@@ -148,7 +154,10 @@ class ExecuteTestCase(unittest.TestCase):
 1 packets transmitted, 1 received, 0% packet loss, time 0ms
 """
         self.assertTrue(fake_result.startswith(comp_result))
-        self.assertEquals(controller.get_tags(node1.guid), [tags.MOBILE])
+
+        self.assertEquals(controller.get_testbed_id(node1.guid), "mock")
+        self.assertEquals(controller.get_testbed_version(node1.guid), "01")
+        self.assertEquals(controller.get_factory_id(node1.guid), "Node")
 
         controller.stop()
         controller.shutdown()
@@ -178,7 +187,10 @@ class ExecuteTestCase(unittest.TestCase):
 1 packets transmitted, 1 received, 0% packet loss, time 0ms
 """
         self.assertTrue(fake_result.startswith(comp_result))
-        self.assertEquals(controller.get_tags(node1.guid), [tags.MOBILE])
+
+        self.assertEquals(controller.get_testbed_id(node1.guid), "mock")
+        self.assertEquals(controller.get_testbed_version(node1.guid), "01")
+        self.assertEquals(controller.get_factory_id(node1.guid), "Node")
 
         controller.stop()
         controller.shutdown()
@@ -208,7 +220,10 @@ class ExecuteTestCase(unittest.TestCase):
 1 packets transmitted, 1 received, 0% packet loss, time 0ms
 """
         self.assertTrue(fake_result.startswith(comp_result))
-        self.assertEquals(controller.get_tags(node1.guid), [tags.MOBILE])
+
+        self.assertEquals(controller.get_testbed_id(node1.guid), "mock")
+        self.assertEquals(controller.get_testbed_version(node1.guid), "01")
+        self.assertEquals(controller.get_factory_id(node1.guid), "Node")
 
         # controller dies
         del controller