diff --git a/xos/nose2-plugins/__init__.py b/xos/nose2-plugins/__init__.py
new file mode 100644
index 0000000..42722a8
--- /dev/null
+++ b/xos/nose2-plugins/__init__.py
@@ -0,0 +1,14 @@
+
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
diff --git a/xos/nose2-plugins/exclude.py b/xos/nose2-plugins/exclude.py
new file mode 100644
index 0000000..241eadb
--- /dev/null
+++ b/xos/nose2-plugins/exclude.py
@@ -0,0 +1,32 @@
+
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import logging
+import os
+
+from nose2.events import Plugin
+
+log = logging.getLogger('nose2.plugins.excludeignoredfiles')
+
+class ExcludeIgnoredFiles(Plugin):
+    commandLineSwitch = (None, 'exclude-ignored-files', 'Exclude that which should be excluded')
+
+    def matchPath(self, event):
+        if event.path.endswith(".py"):
+            text = open(event.path, "r").read()
+            if "test_framework: ignore" in text.lower():
+                log.info("Ignoring %s" % event.path)
+                event.handled = True
+                return False
diff --git a/xos/synchronizer/model_policies/model_policy_vegtenant.py b/xos/synchronizer/model_policies/model_policy_vegtenant.py
index fc2cec5..d380366 100644
--- a/xos/synchronizer/model_policies/model_policy_vegtenant.py
+++ b/xos/synchronizer/model_policies/model_policy_vegtenant.py
@@ -15,7 +15,6 @@
 from synchronizers.new_base.modelaccessor import *
 from synchronizers.new_base.model_policies.model_policy_tenantwithcontainer import TenantWithContainerPolicy, LeastLoadedNodeScheduler
 from synchronizers.new_base.exceptions import *
-import wrappers.vegtenant
 
 class VEGTenantPolicy(TenantWithContainerPolicy):
     model_name = "VEGTenant"
diff --git a/xos/synchronizer/model_policies/test_config.yaml b/xos/synchronizer/model_policies/test_config.yaml
index 07fe519..dc3b2c9 100644
--- a/xos/synchronizer/model_policies/test_config.yaml
+++ b/xos/synchronizer/model_policies/test_config.yaml
@@ -17,3 +17,12 @@
   username: xosadmin@opencord.org
   password: "sample"
   kind: "testframework"
+logging:
+  version: 1
+  handlers:
+    console:
+      class: logging.StreamHandler
+  loggers:
+    'multistructlog':
+      handlers:
+          - console
diff --git a/xos/synchronizer/model_policies/test_model_policy_vegtenant.py b/xos/synchronizer/model_policies/test_model_policy_vegtenant.py
index e7d1f4e..34c94ac 100644
--- a/xos/synchronizer/model_policies/test_model_policy_vegtenant.py
+++ b/xos/synchronizer/model_policies/test_model_policy_vegtenant.py
@@ -1,3 +1,4 @@
+
 # Copyright 2017-present Open Networking Foundation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -11,484 +12,410 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
+
 import unittest
-from mock import patch
+from mock import patch, call, Mock, PropertyMock
 import mock
 
 import os, sys
-sys.path.append("../../..")
-config = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + "/test_config.yaml")
-from xosconfig import Config
-Config.init(config, 'synchronizer-config-schema.yaml')
 
-import synchronizers.new_base.modelaccessor
+test_path=os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
+service_dir=os.path.join(test_path, "../../../..")
+xos_dir=os.path.join(test_path, "../../..")
+if not os.path.exists(os.path.join(test_path, "new_base")):
+    xos_dir=os.path.join(test_path, "../../../../../../orchestration/xos/xos")
+    services_dir=os.path.join(xos_dir, "../../xos_services")
 
-import synchronizers.new_base.model_policies.model_policy_tenantwithcontainer
-import model_policy_vegtenant
-from model_policy_vegtenant import VEGTenantPolicy
-from synchronizers.new_base.model_policies.model_policy_tenantwithcontainer import LeastLoadedNodeScheduler
+# ---------------------------------------------------------------------------------------------------------------------
+# End Model Policy Testing Framework
+# ---------------------------------------------------------------------------------------------------------------------
 
-MockObjectStores = {}
-
-class MockObjectList:
-    item_list = None
-
-    def __init__(self, initial=None):
-        self.id_counter = 0
-        if initial:
-            self.item_list=initial
-        elif self.item_list is None:
-            self.item_list=[]
-
-    def get_items(self):
-        return self.item_list
-
-    def count(self):
-        return len(self.get_items())
-
-    def first(self):
-        return self.get_items()[0]
-
-    def all(self):
-        return self.get_items()
-
-    def filter(self, **kwargs):
-        items = self.get_items()
-        for (k,v) in kwargs.items():
-            items = [x for x in items if getattr(x,k) == v]
-        return items
-
-    def get(self, **kwargs):
-        objs = self.filter(**kwargs)
-        if not objs:
-            raise Exception("No objects matching %s" % str(kwargs))
-        return objs[0]
-
-class MockObjectStore(MockObjectList):
-    def save(self, o):
-        if (not hasattr(o,"id")) or (not o.id):
-            for item in self.get_items():
-                if item.id >= self.id_counter:
-                    self.id_counter = item.id + 1
-
-            o.id = self.id_counter
-            self.id_counter = self.id_counter + 1
-
-        for item in self.get_items():
-            if item.id == o.id:
-                item = o
-                break
-        else:
-            self.get_items().append(o)
-
-class MockObject(object):
-    objects = None
-    id = None
-    def __init__(self, **kwargs):
-        for (k,v) in kwargs.items():
-            setattr(self,k,v)
-    @property
-    def self_content_type_id(self):
-        return self.__class__.__name__
-    def save(self):
-        if self.objects:
-            self.objects.save(self)
-    def delete(self):
-        pass
-
-def get_MockObjectStore(x):
-    return globals()["Mock%sObjects" % x]()
-
-class MockFlavorObjects(MockObjectStore): pass
-class MockFlavor(MockObject):
-    objects = get_MockObjectStore("Flavor")
-    name = None
-
-class MockInstanceObjects(MockObjectStore): pass
-class MockInstance(MockObject):
-    objects = get_MockObjectStore("Instance")
-    name = None
-
-class MockDeploymentObjects(MockObjectStore): pass
-class MockDeployment(MockObject):
-    objects = get_MockObjectStore("Deployment")
-    name = None
-
-class MockUserObjects(MockObjectStore): pass
-class MockUser(MockObject):
-    objects = get_MockObjectStore("User")
-    email = None
-
-class MockSliceObjects(MockObjectStore): pass
-class MockSlice(MockObject):
-    objects = get_MockObjectStore("Slice")
-    name = None
-    default_node = None
-    networks = None
-
-class MockNodeObjects(MockObjectStore): pass
-class MockNode(MockObject):
-    objects = get_MockObjectStore("Node")
-    hostname = None
-    site_deployment = None
-
-class MockImageObjects(MockObjectStore): pass
-class MockImage(MockObject):
-    objects = get_MockObjectStore("Image")
-    name = None
-
-class MockTagObjects(MockObjectStore): pass
-class MockTag(MockObject):
-    objects = get_MockObjectStore("Tag")
-    name = None
-    value = None
-
-class MockNetworkTemplateObjects(MockObjectStore): pass
-class MockNetworkTemplate(MockObject):
-    objects = get_MockObjectStore("NetworkTemplate")
-    name = None
-    visibility = None
-
-class MockNetworkParameterTypeObjects(MockObjectStore): pass
-class MockNetworkParameterType(MockObject):
-    objects = get_MockObjectStore("NetworkParameterType")
-    name = None
-
-class MockNetworkParameterObjects(MockObjectStore): pass
-class MockNetworkParameter(MockObject):
-    objects = get_MockObjectStore("NetworkParameter")
-    value = None
-    parameter_id = None
-
-class MockNetworkObjects(MockObjectStore): pass
-class MockNetwork(MockObject):
-    objects = get_MockObjectStore("Network")
-    name = None
-    template = None
-
-class MockPortObjects(MockObjectStore): pass
-class MockPort(MockObject):
-    objects = get_MockObjectStore("Port")
-    name = None
-    def set_parameter(self, name, value):
-        pass
-
-class MockAddressManagerServiceInstanceObjects(MockObjectStore): pass
-class MockAddressManagerServiceInstance(MockObject):
-    objects = get_MockObjectStore("AddressManagerServiceInstance")
-    public_ip = None
-    public_mac = None
-    address_pool_id = None
-    def set_attribute(self, name, value):
-        pass
-
-class MockVoltTenantObjects(MockObjectStore): pass
-class MockVoltTenant(MockObject):
-    objects = get_MockObjectStore("VoltTenant")
-    c_tag = None
-    s_tag = None
-
-class MockVEGServiceObjects(MockObjectStore): pass
-class MockVEGService(MockObject):
-    objects = get_MockObjectStore("VEGService")
-    name = None
-    node_label = None
-    slices = None
-    def __init__(self, **kwargs):
-        super(MockVEGService, self).__init__(**kwargs)
-
-class MockVEGTenantObjects(MockObjectStore): pass
-class MockVEGTenant(MockObject):
-    objects = get_MockObjectStore("VEGTenant")
-    owner = None
-    deleted = False
-    instance = None
-    creator = None
-    volt = None
-    service_specific_attribute = {}
-
-    def get_image(self):
-        return None
-
-class TestModelPolicyVegTenant(unittest.TestCase):
+class TestModelPolicyVsgTenant(unittest.TestCase):
     def setUp(self):
+        global VEGTenantPolicy, LeastLoadedNodeScheduler, MockObjectList
+
+        self.sys_path_save = sys.path
+        sys.path.append(xos_dir)
+        sys.path.append(os.path.join(xos_dir, 'synchronizers', 'new_base'))
+
+        config = os.path.join(test_path, "test_config.yaml")
+        from xosconfig import Config
+        Config.clear()
+        Config.init(config, 'synchronizer-config-schema.yaml')
+
+        from synchronizers.new_base.mock_modelaccessor_build import build_mock_modelaccessor
+        build_mock_modelaccessor(xos_dir, services_dir, ["vEG/xos/veg.xproto", "addressmanager/xos/addressmanager.xproto"])
+
+        import synchronizers.new_base.modelaccessor
+        import synchronizers.new_base.model_policies.model_policy_tenantwithcontainer
+        import model_policy_vegtenant
+        from model_policy_vegtenant import VEGTenantPolicy, model_accessor
+        from synchronizers.new_base.model_policies.model_policy_tenantwithcontainer import LeastLoadedNodeScheduler
+
+        from mock_modelaccessor import MockObjectList
+
+        # import all class names to globals
+        for (k, v) in model_accessor.all_model_classes.items():
+            globals()[k] = v
+
+        # Some of the functions we call have side-effects. For example, creating a VEGTenant may lead to creation of
+        # tags. Ideally, this wouldn't happen, but it does. So make sure we reset the world.
+        model_accessor.reset_all_object_stores()
+
+        # attic functions that are not present in the mock model accessor
+        VEGTenant.volt = PropertyMock(return_value = None)
+        AddressManagerServiceInstance.set_attribute = Mock()
+
         self.policy = VEGTenantPolicy()
-        self.tenant = MockVEGTenant()
-        self.user = MockUser(email="testadmin@test.org")
-        self.tenant = MockVEGTenant(creator=self.user, id=1)
-        self.flavor = MockFlavor(name="m1.small")
-        self.npt_ctag = MockNetworkParameterType(name="c_tag", id=1)
-        self.npt_stag = MockNetworkParameterType(name="s_tag", id=2)
-        self.npt_neutron_port_name = MockNetworkParameterType(name="neutron_port_name", id=3)
-        self.node = MockNode(hostname="my.node.com")
-        self.slice = MockSlice(name="mysite_test1", default_flavor=self.flavor, default_isolation="vm")
-        self.priv_template = MockNetworkTemplate(name="access_network", visibility="private")
-        self.priv_network = MockNetwork(name="mysite_test1_private", template=self.priv_template)
-        self.image = MockImage(name="trusty-server-multi-nic")
-        self.deployment = MockDeployment(name="testdeployment")
-        synchronizers.new_base.model_policies.model_policy_tenantwithcontainer.Instance = MockInstance
-        synchronizers.new_base.model_policies.model_policy_tenantwithcontainer.Flavor = MockFlavor
-        synchronizers.new_base.model_policies.model_policy_tenantwithcontainer.Tag = MockTag
-        synchronizers.new_base.model_policies.model_policy_tenantwithcontainer.Node = MockNode
-        model_policy_vegtenant.Instance = MockInstance
-        model_policy_vegtenant.Flavor = MockFlavor
-        model_policy_vegtenant.Tag = MockTag
-        model_policy_vegtenant.VEGService = MockVEGService
-        model_policy_vegtenant.Node = MockNode
-        model_policy_vegtenant.Port = MockPort
-        model_policy_vegtenant.NetworkParameterType = MockNetworkParameterType
-        model_policy_vegtenant.NetworkParameter = MockNetworkParameter
+        self.tenant = VEGTenant()
+        self.user = User(email="testadmin@test.org")
+        self.tenant = VEGTenant(creator=self.user, id=1)
+        self.flavor = Flavor(name="m1.small")
+        self.npt_ctag = NetworkParameterType(name="c_tag", id=1)
+        self.npt_stag = NetworkParameterType(name="s_tag", id=2)
+        self.npt_neutron_port_name = NetworkParameterType(name="neutron_port_name", id=3)
+        self.node = Node(hostname="my.node.com")
+        self.slice = Slice(name="mysite_test1", default_flavor=self.flavor, default_isolation="vm")
+        self.priv_template = NetworkTemplate(name="access_network", visibility="private")
+        self.priv_network = Network(name="mysite_test1_private", template=self.priv_template)
+        self.image = Image(name="trusty-server-multi-nic")
+        self.deployment = Deployment(name="testdeployment")
+        Tag.objects.item_list = []
 
-    @patch.object(VEGTenantPolicy, "manage_container")
-    @patch.object(VEGTenantPolicy, "manage_address_service_instance")
-    @patch.object(VEGTenantPolicy, "cleanup_orphans")
-    def test_handle_create(self, cleanup_orphans, manage_address_service_instance, manage_container):
-        self.policy.handle_create(self.tenant)
-        manage_container.assert_called_with(self.tenant)
-        manage_address_service_instance.assert_called_with(self.tenant)
-        cleanup_orphans.assert_called_with(self.tenant)
+    def tearDownb(self):
+        sys.path = self.sys_path_save
 
-    @patch.object(VEGTenantPolicy, "manage_container")
-    @patch.object(VEGTenantPolicy, "manage_address_service_instance")
-    @patch.object(VEGTenantPolicy, "cleanup_orphans")
-    def test_handle_update(self, cleanup_orphans, manage_address_service_instance, manage_container):
-        self.policy.handle_create(self.tenant)
-        manage_container.assert_called_with(self.tenant)
-        manage_address_service_instance.assert_called_with(self.tenant)
-        cleanup_orphans.assert_called_with(self.tenant)
+    def test_handle_create(self):
+        with patch.object(VEGTenantPolicy, "manage_container") as manage_container, \
+             patch.object(VEGTenantPolicy, "manage_address_service_instance") as manage_address_service_instance, \
+             patch.object(VEGTenantPolicy, "cleanup_orphans") as cleanup_orphans:
+            self.policy.handle_create(self.tenant)
+            manage_container.assert_called_with(self.tenant)
+            manage_address_service_instance.assert_called_with(self.tenant)
+            cleanup_orphans.assert_called_with(self.tenant)
 
-    @patch.object(MockAddressManagerServiceInstance, "delete")
-    def test_handle_delete_asi_exist(self, amsi_delete):
-        vrtenant = MockAddressManagerServiceInstance()
-        self.tenant.address_service_instance = vrtenant
-        self.policy.handle_delete(self.tenant)
-        amsi_delete.assert_called()
+    def test_handle_update(self):
+        with patch.object(VEGTenantPolicy, "manage_container") as manage_container, \
+             patch.object(VEGTenantPolicy, "manage_address_service_instance") as manage_address_service_instance, \
+             patch.object(VEGTenantPolicy, "cleanup_orphans") as cleanup_orphans:
+            self.policy.handle_create(self.tenant)
+            manage_container.assert_called_with(self.tenant)
+            manage_address_service_instance.assert_called_with(self.tenant)
+            cleanup_orphans.assert_called_with(self.tenant)
 
-    @patch.object(MockAddressManagerServiceInstance, "delete")
-    def test_handle_delete_asi_noexist(self, amsi_delete):
-        self.tenant.address_service_instance = None
-        self.policy.handle_delete(self.tenant)
-        amsi_delete.assert_not_called()
+    def test_handle_delete_asi_exist(self):
+        with patch.object(AddressManagerServiceInstance, "delete") as amsi_delete:
+            vrtenant = AddressManagerServiceInstance()
+            self.tenant.address_service_instance = vrtenant
+            self.policy.handle_delete(self.tenant)
+            # The delete model policy should be called.
+            #   NOTE: This will change when vEG is brought up to compliance with R-CORD vSG. See comments in VSG
+            #         model policy test case.
+            amsi_delete.assert_called()
 
-    @patch.object(MockAddressManagerServiceInstanceObjects, "get_items")
-    @patch.object(MockAddressManagerServiceInstance, "delete")
-    def test_cleanup_orphans(self, amsi_delete, amsi_objects):
-        vrtenant = MockAddressManagerServiceInstance(id=1)
-        self.tenant.address_service_instance = vrtenant
-        some_other_vrtenant = MockAddressManagerServiceInstance(id=2, subscriber_tenant_id = self.tenant.id)
-        amsi_objects.get_items = [some_other_vrtenant]
-        self.policy.handle_delete(self.tenant)
-        amsi_delete.assert_called()
+    def test_handle_delete_asi_noexist(self):
+        with patch.object(AddressManagerServiceInstance, "delete") as amsi_delete:
+            self.tenant.address_service_instance = None
+            self.policy.handle_delete(self.tenant)
+            amsi_delete.assert_not_called()
 
-    @patch.object(MockTag, "objects")
-    def test_find_instance_for_s_tag_noexist(self, tag_objects):
-        tag_objects.filter.return_value = []
-        instance = self.policy.find_instance_for_s_tag(3)
-        self.assertEqual(instance, None)
+# TODO: vEG doesn't currently implement this functionality
 
-    @patch.object(MockTag, "objects")
-    def test_find_instance_for_s_tag(self, tag_objects):
-        tagged_instance = MockInstance()
-        tag = MockTag(content_object = tagged_instance)
-        tag_objects.filter.return_value = [tag]
-        instance = self.policy.find_instance_for_s_tag(3)
-        self.assertEqual(instance, tagged_instance)
+#    def test_handle_delete_cleaup_instance(self):
+#        with patch.object(VEGTenant.objects, "get_items") as vegtenant_objects, \
+#             patch.object(Instance.objects, "get_items") as instance_objects, \
+#             patch.object(Instance, "delete") as instance_delete:
+#            veg_service = VEGService()
+#            instance = Instance(id=1)
+#            instance_objects.return_value = [instance]
+#            self.tenant.address_service_instance = None
+#            self.tenant.instance = instance
+#            self.tenant.instance_id = instance.id
+#            self.tenant.owner = veg_service
+#            vegtenant_objects.return_value = [self.tenant]
+#            self.policy.handle_delete(self.tenant)
+#            instance_delete.assert_called()
+
+# TODO: vEG doesn't currently implement this functionality
+
+#    def test_handle_delete_cleanup_instance_live(self):
+#        with patch.object(VEGTenant.objects, "get_items") as vegtenant_objects, \
+#             patch.object(Instance.objects, "get_items") as instance_objects, \
+#             patch.object(Instance, "delete") as instance_delete:
+#            # Make sure if an Instance still has active VSG Tenants, that we don't clean it up
+#            veg_service = VEGService()
+#            instance = Instance(id=1)
+#            instance_objects.return_value = [instance]
+#            self.tenant.address_service_instance = None
+#            self.tenant.instance = instance
+#            self.tenant.instance_id = instance.id
+#            self.tenant.owner = veg_service
+#
+#            other_tenant = VEGTenant()
+#            other_tenant.address_service_instance = None
+#            other_tenant.instance = instance
+#            other_tenant.instance_id = instance.id
+#            other_tenant.owner = veg_service
+#
+#            vegtenant_objects.return_value = [self.tenant, other_tenant]
+#
+#            self.policy.handle_delete(self.tenant)
+#            instance_delete.assert_not_called()
+
+
+# TODO: vEG doesn't currently implement this functionality
+
+#    def test_handle_delete_cleanup_instance_and_tags_and_stuff(self):
+#        with patch.object(ServiceInstance.objects, "get_items") as si_objects, \
+#             patch.object(AddressManagerServiceInstance.objects, "get_items") as amsi_objects, \
+#             patch.object(Tag.objects, "get_items") as tag_objects, \
+#             patch.object(VEGTenant.objects, "get_items") as vegtenant_objects, \
+#             patch.object(Instance.objects, "get_items") as instance_objects, \
+#             patch.object(AddressManagerServiceInstance, "delete") as amsi_delete, \
+#             patch.object(Tag, "delete") as tag_delete, \
+#             patch.object(Instance, "delete") as instance_delete:
+#            veg_service = VEGService()
+#            am_instance = AddressManagerServiceInstance()
+#            amsi_objects.return_value = [am_instance]
+#            si_objects.return_value = [am_instance]  # AddressManagerServiceInstance is a subclass of ServiceInstance
+#            instance = Instance(id=1)
+#            instance_objects.return_value = [instance]
+#            self.tenant.address_service_instance = None
+#            self.tenant.instance = instance
+#            self.tenant.instance_id = instance.id
+#            self.tenant.owner = veg_service
+#            vegtenant_objects.return_value = [self.tenant]
+#            stag_tag = Tag(service_id=self.tenant.owner.id, content_type=instance.self_content_type_id,
+#                           object_id=instance.id, name="s_tag")
+#            vrouter_tag = Tag(service_id=self.tenant.owner.id, content_type=instance.self_content_type_id,
+#                           object_id=instance.id, name="vm_vrouter_tenant", value=am_instance.id)
+#            tag_objects.return_value = [stag_tag, vrouter_tag]
+#            self.policy.handle_delete(self.tenant)
+#            instance_delete.assert_called()
+#            assert stag_tag.delete.called
+#            assert vrouter_tag.delete.called
+#            assert am_instance.delete.called
+
+    def test_cleanup_orphans(self):
+        with patch.object(AddressManagerServiceInstance.objects, "get_items") as amsi_objects, \
+             patch.object(AddressManagerServiceInstance, "delete") as amsi_delete:
+            vrtenant = AddressManagerServiceInstance(id=1)
+            self.tenant.address_service_instance = vrtenant
+            some_other_vrtenant = AddressManagerServiceInstance(id=2)
+            link = ServiceInstanceLink(subscriber_service_instance=self.tenant, provider_service_instance=some_other_vrtenant)
+            self.tenant.subscribed_links = MockObjectList(initial=[link])
+            amsi_objects.return_value = [some_other_vrtenant]
+            self.policy.cleanup_orphans(self.tenant)
+            amsi_delete.assert_called()
+
+    def test_find_instance_for_s_tag_noexist(self):
+        with patch.object(Tag.objects, "get_items") as tag_objects:
+            tag_objects.filter.return_value = []
+            instance = self.policy.find_instance_for_s_tag(3)
+            self.assertEqual(instance, None)
+
+    def test_find_instance_for_s_tag(self):
+        with patch.object(Tag, "objects") as tag_objects:
+            tagged_instance = Instance()
+            tag = Tag(content_object = tagged_instance)
+            tag_objects.filter.return_value = [tag]
+            instance = self.policy.find_instance_for_s_tag(3)
+            self.assertEqual(instance, tagged_instance)
 
     def test_manage_container_no_volt(self):
         with self.assertRaises(Exception) as e:
             self.policy.manage_container(self.tenant)
         self.assertEqual(e.exception.message, "This VEG container has no volt")
 
-    @patch.object(VEGTenantPolicy, "find_or_make_instance_for_s_tag")
-    @patch.object(MockVEGTenant, "save")
-    @patch.object(MockVEGTenant, "volt")
-    def test_manage_container_noinstance(self, volt, tenant_save, find_or_make_instance_for_s_tag):
-        instance = MockInstance()
-        volt.s_tag=222
-        volt.c_tag=111
-        find_or_make_instance_for_s_tag.return_value = instance
-        self.policy.manage_container(self.tenant)
-        self.assertEqual(self.tenant.instance, instance)
-        tenant_save.assert_called()
+    def test_manage_container_noinstance(self):
+        with patch.object(VEGTenantPolicy, "find_or_make_instance_for_s_tag") as find_or_make_instance_for_s_tag, \
+             patch.object(VEGTenant, "save") as tenant_save, \
+             patch.object(VEGTenant, "volt") as volt:
+            instance = Instance()
+            volt.s_tag=222
+            volt.c_tag=111
+            find_or_make_instance_for_s_tag.return_value = instance
+            self.policy.manage_container(self.tenant)
+            self.assertEqual(self.tenant.instance, instance)
+            tenant_save.assert_called()
 
-    @patch.object(VEGTenantPolicy, "find_or_make_instance_for_s_tag")
-    @patch.object(MockVEGTenant, "save")
-    @patch.object(MockVEGTenant, "volt")
-    def test_manage_container_hasinstance(self, volt, tenant_save, find_or_make_instance_for_s_tag):
-        instance = MockInstance()
-        volt.s_tag=222
-        volt.c_tag=111
-        self.tenant.instance = instance
-        self.policy.manage_container(self.tenant)
-        find_or_make_instance_for_s_tag.assert_not_called()
-        self.assertEqual(self.tenant.instance, instance)
-        tenant_save.assert_not_called()
+    def test_manage_container_hasinstance(self):
+        with patch.object(VEGTenantPolicy, "find_or_make_instance_for_s_tag") as find_or_make_instance_for_s_tag, \
+             patch.object(VEGTenant, "save") as tenant_save, \
+             patch.object(VEGTenant, "volt") as volt:
+            instance = Instance()
+            volt.s_tag=222
+            volt.c_tag=111
+            self.tenant.instance = instance
+            self.policy.manage_container(self.tenant)
+            find_or_make_instance_for_s_tag.assert_not_called()
+            self.assertEqual(self.tenant.instance, instance)
+            tenant_save.assert_not_called()
 
-    @patch.object(VEGTenantPolicy, "find_or_make_instance_for_s_tag")
-    @patch.object(MockVEGTenant, "save")
-    @patch.object(MockVEGTenant, "volt")
-    def test_manage_container_deleted(self, volt, tenant_save, find_or_make_instance_for_s_tag):
-        self.tenant.deleted = True
-        self.policy.manage_container(self.tenant)
-        find_or_make_instance_for_s_tag.assert_not_called()
-        tenant_save.assert_not_called()
+    def test_manage_container_deleted(self):
+        with patch.object(VEGTenantPolicy, "find_or_make_instance_for_s_tag") as find_or_make_instance_for_s_tag, \
+             patch.object(VEGTenant, "save") as tenant_save, \
+             patch.object(VEGTenant, "volt") as volt:
+            self.tenant.deleted = True
+            self.policy.manage_container(self.tenant)
+            find_or_make_instance_for_s_tag.assert_not_called()
+            tenant_save.assert_not_called()
 
-    @patch.object(MockPort, "save")
-    @patch.object(MockPort, "objects")
-    def test_find_or_make_port_noexist(self, port_objects, port_save):
-        instance = MockInstance(id=123)
-        network = MockInstance(id=456)
-        port_objects.filter.return_value = []
-        port=self.policy.find_or_make_port(instance, network)
-        self.assertNotEqual(port, None)
-        port_save.assert_called()
+    def test_find_or_make_port_noexist(self):
+        with patch.object(Port, "save") as port_save, \
+             patch.object(Port, "objects") as port_objects:
+            instance = Instance(id=123)
+            network = Instance(id=456)
+            port_objects.filter.return_value = []
+            port=self.policy.find_or_make_port(instance, network)
+            self.assertNotEqual(port, None)
+            port_save.assert_called()
 
-    @patch.object(MockPort, "save")
-    @patch.object(MockPort, "objects")
-    def test_find_or_make_port_exists(self, port_objects, port_save):
-        someport = MockPort()
-        def mock_port_filter(network_id, instance_id):
-            if (network_id==456) and (instance_id==123):
-                return [someport]
-            return None
-        instance = MockInstance(id=123)
-        network = MockInstance(id=456)
-        port_objects.filter.side_effect = mock_port_filter
-        port=self.policy.find_or_make_port(instance, network)
-        self.assertEqual(port, someport)
-        port_save.assert_not_called()
+    def test_find_or_make_port_exists(self):
+        with patch.object(Port, "save") as port_save, \
+             patch.object(Port, "objects") as port_objects:
+            someport = Port()
+            def mock_port_filter(network_id, instance_id):
+                if (network_id==456) and (instance_id==123):
+                    return [someport]
+                return None
+            instance = Instance(id=123)
+            network = Instance(id=456)
+            port_objects.filter.side_effect = mock_port_filter
+            port=self.policy.find_or_make_port(instance, network)
+            self.assertEqual(port, someport)
+            port_save.assert_not_called()
 
-    @patch.object(MockVEGServiceObjects, "get_items")
-    def test_get_lan_network_noexist(self, vegservice_objects):
-        vegservice=MockVEGService(name="myvegservice", id=1, slices=MockObjectList(initial=[self.slice]))
-        vegservice_objects.return_value = [vegservice]
-        self.tenant.owner = vegservice
-        self.slice.networks = MockObjectList()
-        with self.assertRaises(Exception) as e:
-            self.policy.get_lan_network(self.tenant, None)
-        self.assertEqual(e.exception.message, "No lan_network")
+    def test_get_lan_network_noexist(self):
+        with patch.object(VEGService.objects, "get_items") as vegservice_objects:
+            vegservice=VEGService(name="myvegservice", id=1, slices=MockObjectList(initial=[self.slice]))
+            vegservice_objects.return_value = [vegservice]
+            self.tenant.owner = vegservice
+            self.slice.networks = MockObjectList()
+            with self.assertRaises(Exception) as e:
+                self.policy.get_lan_network(self.tenant, None)
+            self.assertEqual(e.exception.message, "No lan_network")
 
-    @patch.object(MockVEGServiceObjects, "get_items")
-    def test_get_lan_network(self, vegservice_objects):
-        vegservice=MockVEGService(name="myvegservice", id=1, slices=MockObjectList(initial=[self.slice]))
-        vegservice_objects.return_value = [vegservice]
-        self.tenant.owner = vegservice
-        self.slice.networks = MockObjectList([self.priv_network])
-        lan_network = self.policy.get_lan_network(self.tenant, None)
-        self.assertEqual(lan_network, self.priv_network)
-
-    @patch.object(MockVEGServiceObjects, "get_items")
-    def test_get_lan_network_toomany(self, vegservice_objects):
-        some_other_network = MockNetwork(name="mysite_test1_private", template=self.priv_template)
-        vegservice=MockVEGService(name="myvegservice", id=1, slices=MockObjectList(initial=[self.slice]))
-        vegservice_objects.return_value = [vegservice]
-        self.tenant.owner = vegservice
-        self.slice.networks = MockObjectList([self.priv_network, some_other_network])
-        with self.assertRaises(Exception) as e:
+    def test_get_lan_network(self):
+        with patch.object(VEGService.objects, "get_items") as vegservice_objects:
+            vegservice=VEGService(name="myvegservice", id=1, slices=MockObjectList(initial=[self.slice]))
+            vegservice_objects.return_value = [vegservice]
+            self.tenant.owner = vegservice
+            self.slice.networks = MockObjectList([self.priv_network])
             lan_network = self.policy.get_lan_network(self.tenant, None)
-        self.assertEqual(e.exception.message, "The vEG slice should only have one non-management private network")
+            self.assertEqual(lan_network, self.priv_network)
 
-    @patch.object(MockNetworkParameterTypeObjects, "get_items")
-    def test_port_set_parameter_noparamexist(self, npt_objects):
-        npt_objects.return_value = [self.npt_stag]
-        port = MockPort()
-        self.policy.port_set_parameter(port, "s_tag", "123")
-        self.assertNotEqual(MockNetworkParameter.objects.all(), [])
-        param = MockNetworkParameter.objects.first()
-        self.assertEqual(param.value, "123")
-        self.assertEqual(param.parameter, self.npt_stag)
+    def test_get_lan_network_toomany(self):
+        with patch.object(VEGService.objects, "get_items") as vegservice_objects:
+            some_other_network = Network(name="mysite_test1_private", template=self.priv_template)
+            vegservice=VEGService(name="myvegservice", id=1, slices=MockObjectList(initial=[self.slice]))
+            vegservice_objects.return_value = [vegservice]
+            self.tenant.owner = vegservice
+            self.slice.networks = MockObjectList([self.priv_network, some_other_network])
+            with self.assertRaises(Exception) as e:
+                lan_network = self.policy.get_lan_network(self.tenant, None)
+            self.assertEqual(e.exception.message, "The vEG slice should only have one non-management private network")
 
-    @patch.object(MockNetworkParameterTypeObjects, "get_items")
-    @patch.object(MockNetworkParameterObjects, "get_items")
-    def test_port_set_parameter_paramexist(self, np_objects, npt_objects):
-        port = MockPort(id=1)
-        np_orig = MockNetworkParameter(parameter_id=self.npt_stag.id, value="456", object_id=port.id, content_type=port.self_content_type_id)
-        np_objects.return_value = [np_orig]
-        npt_objects.return_value = [self.npt_stag]
-        self.policy.port_set_parameter(port, "s_tag", "123")
-        self.assertEqual(MockNetworkParameter.objects.count(), 1)
-        param = MockNetworkParameter.objects.first()
-        self.assertEqual(param.value, "123")
+    def test_port_set_parameter_noparamexist(self):
+        with patch.object(NetworkParameterType.objects, "get_items") as npt_objects:
+            npt_objects.return_value = [self.npt_stag]
+            port = Port()
+            self.policy.port_set_parameter(port, "s_tag", "123")
+            self.assertNotEqual(NetworkParameter.objects.all(), [])
+            param = NetworkParameter.objects.first()
+            self.assertEqual(param.value, "123")
+            self.assertEqual(param.parameter, self.npt_stag)
 
-    @patch.object(MockNetworkParameterTypeObjects, "get_items")
-    @patch.object(MockNodeObjects, "get_items")
-    @patch.object(MockFlavorObjects, "get_items")
-    @patch.object(MockVEGServiceObjects, "get_items")
-    @patch.object(MockVEGTenant, "volt")
-    @patch.object(MockVEGTenant, "save")
-    @patch.object(VEGTenantPolicy, "get_image")
-    @patch.object(VEGTenantPolicy, "allocate_public_service_instance")
-    @patch.object(LeastLoadedNodeScheduler, "pick")
-    @patch.object(MockNode, "site_deployment")
-    @patch.object(MockInstance, "save")
-    @patch.object(MockInstance, "delete")
-    @patch.object(VEGTenantPolicy, "port_set_parameter")
-    def test_find_or_make_instance_for_s_tag(self, port_set_parameter, instance_delete, instance_save, site_deployment,
-                              pick, get_psi, get_image, tenant_save, volt,
-                              vegservice_objects, flavor_objects, node_objects, npt_objects):
-        # setup mocks
-        vrtenant = MockAddressManagerServiceInstance(public_ip="1.2.3.4", public_mac="01:02:03:04:05:06")
-        vegservice=MockVEGService(name="myvegservice", id=1, slices=MockObjectList(initial=[self.slice]))
-        vegservice_objects.return_value = [vegservice]
-        self.tenant.owner = vegservice
-        volt.s_tag=222
-        volt.c_tag=111
-        get_image.return_value = self.image
-        get_psi.return_value = vrtenant
-        pick.return_value = (self.node, None)
-        site_deployment.deployment = self.deployment
-        flavor_objects.return_value=[self.flavor]
-        node_objects.return_value=[self.node]
-        npt_objects.return_value=[self.npt_stag, self.npt_ctag, self.npt_neutron_port_name]
-        self.slice.networks = MockObjectList([self.priv_network])
-        # done setup mocks
+    def test_port_set_parameter_paramexist(self):
+        with patch.object(NetworkParameterType.objects, "get_items") as npt_objects, \
+             patch.object(NetworkParameter.objects, "get_items") as np_objects:
+            port = Port(id=1)
+            np_orig = NetworkParameter(parameter_id=self.npt_stag.id, value="456", object_id=port.id, content_type=port.self_content_type_id)
+            np_objects.return_value = [np_orig]
+            npt_objects.return_value = [self.npt_stag]
+            self.policy.port_set_parameter(port, "s_tag", "123")
+            self.assertEqual(NetworkParameter.objects.count(), 1)
+            param = NetworkParameter.objects.first()
+            self.assertEqual(param.value, "123")
 
-        # call the function under test
-        instance = self.policy.find_or_make_instance_for_s_tag(self.tenant, self.tenant.volt.s_tag)
+    def test_find_or_make_instance_for_s_tag(self):
+        with patch.object(NetworkParameterType.objects, "get_items") as npt_objects, \
+             patch.object(Node.objects, "get_items") as node_objects, \
+             patch.object(Flavor.objects, "get_items") as flavor_objects, \
+             patch.object(VEGService.objects, "get_items") as vegservice_objects, \
+             patch.object(VEGTenant, "volt") as volt, \
+             patch.object(VEGTenant, "save") as tenant_save, \
+             patch.object(VEGTenantPolicy, "get_image") as get_image, \
+             patch.object(VEGTenantPolicy, "allocate_public_service_instance") as get_psi, \
+             patch.object(LeastLoadedNodeScheduler, "pick") as pick, \
+             patch.object(Node, "site_deployment") as site_deployment, \
+             patch.object(Instance, "save") as instance_save, \
+             patch.object(Instance, "delete") as instance_delete, \
+             patch.object(VEGTenantPolicy, "port_set_parameter") as port_set_parameter:
+            # setup mocks
+            vrtenant = AddressManagerServiceInstance(public_ip="1.2.3.4", public_mac="01:02:03:04:05:06")
+            vegservice=VEGService(name="myvegservice", id=1, slices=MockObjectList(initial=[self.slice]))
+            vegservice_objects.return_value = [vegservice]
+            self.tenant.owner = vegservice
+            volt.s_tag=222
+            volt.c_tag=111
+            get_image.return_value = self.image
+            get_psi.return_value = vrtenant
+            pick.return_value = (self.node, None)
+            site_deployment.deployment = self.deployment
+            flavor_objects.return_value=[self.flavor]
+            node_objects.return_value=[self.node]
+            npt_objects.return_value=[self.npt_stag, self.npt_ctag, self.npt_neutron_port_name]
+            self.slice.networks = MockObjectList([self.priv_network])
+            # done setup mocks
 
-        # make sure Instance was created
-        self.assertNotEqual(instance, None)
-        self.assertEqual(instance.creator.email, "testadmin@test.org")
-        self.assertEqual(instance.image.name, "trusty-server-multi-nic")
-        self.assertEqual(instance.flavor.name, "m1.small")
-        self.assertEqual(instance.isolation, "vm")
-        self.assertEqual(instance.node.hostname, "my.node.com")
-        self.assertEqual(instance.slice.name, "mysite_test1")
-        self.assertEqual(instance.parent, None)
-        instance_save.assert_called()
-        instance_delete.assert_not_called()
+            # call the function under test
+            instance = self.policy.find_or_make_instance_for_s_tag(self.tenant, volt.s_tag)
 
-        # Access Network Port should have tags to c-tag and s-tag
-        port = MockPort.objects.first()
-        self.assertEqual(port.instance, instance)
-        self.assertEqual(port.network, self.priv_network)
-        port_set_parameter.assert_has_calls([mock.call(port, "c_tag", 111),
-                                             mock.call(port, "s_tag", 222),
-                                             mock.call(port, "neutron_port_name", "stag-222")])
+            # make sure Instance was created
+            self.assertNotEqual(instance, None)
+            self.assertEqual(instance.creator.email, "testadmin@test.org")
+            self.assertEqual(instance.image.name, "trusty-server-multi-nic")
+            self.assertEqual(instance.flavor.name, "m1.small")
+            self.assertEqual(instance.isolation, "vm")
+            self.assertEqual(instance.node.hostname, "my.node.com")
+            self.assertEqual(instance.slice.name, "mysite_test1")
+            self.assertEqual(instance.parent, None)
+            instance_save.assert_called()
+            instance_delete.assert_not_called()
 
-        # The instance should be tagged with the s-tag
-        tag = MockTag.objects.get(name="s_tag")
-        self.assertEqual(tag.value, "222")
-        self.assertEqual(tag.object_id, instance.id)
+            # Access Network Port should have tags to c-tag and s-tag
+            port = Port.objects.first()
+            self.assertEqual(port.instance, instance)
+            self.assertEqual(port.network, self.priv_network)
+            port_set_parameter.assert_has_calls([mock.call(port, "c_tag", 111),
+                                                 mock.call(port, "s_tag", 222),
+                                                 mock.call(port, "neutron_port_name", "stag-222")])
 
-        # The instance should have a tag pointing to its address_service_instance
-        tag = MockTag.objects.get(name="vm_vrouter_tenant")
-        self.assertNotEqual(tag.value, vrtenant.id)
-        self.assertEqual(tag.object_id, instance.id)
+            # The instance should be tagged with the s-tag
+            tag = Tag.objects.get(name="s_tag")
+            self.assertEqual(tag.value, "222")
+            self.assertEqual(tag.object_id, instance.id)
 
-        # Allocate_public_service_instance should have been called
-        get_psi.assert_called()
+            # The instance should have a tag pointing to its address_service_instance
+            tag = Tag.objects.get(name="vm_vrouter_tenant")
+            self.assertNotEqual(tag.value, vrtenant.id)
+            self.assertEqual(tag.object_id, instance.id)
 
-    @patch.object(VEGTenantPolicy, "allocate_public_service_instance")
-    def test_manage_address_service_instance(self, get_psi):
-        vrtenant = MockAddressManagerServiceInstance(public_ip="1.2.3.4", public_mac="01:02:03:04:05:06")
-        get_psi.return_value = vrtenant
+            # Allocate_public_service_instance should have been called
+            get_psi.assert_called()
 
-        self.tenant.address_service_instance = None
+    def test_manage_address_service_instance(self):
+        with patch.object(VEGTenantPolicy, "allocate_public_service_instance") as get_psi:
+            vrtenant = AddressManagerServiceInstance(public_ip="1.2.3.4", public_mac="01:02:03:04:05:06")
+            get_psi.return_value = vrtenant
 
-        self.policy.manage_address_service_instance(self.tenant)
+            self.tenant.vrouter = None
 
-        get_psi.assert_called_with(address_pool_name="addresses_veg", subscriber_tenant=self.tenant)
+            self.policy.manage_address_service_instance(self.tenant)
+
+            get_psi.assert_called_with(address_pool_name="addresses_veg", subscriber_tenant=self.tenant)
 
 if __name__ == '__main__':
     unittest.main()
diff --git a/xos/synchronizer/steps/sync_vegtenant.py b/xos/synchronizer/steps/sync_vegtenant.py
index 0959073..44db1ff 100644
--- a/xos/synchronizer/steps/sync_vegtenant.py
+++ b/xos/synchronizer/steps/sync_vegtenant.py
@@ -25,8 +25,6 @@
 from synchronizers.new_base.modelaccessor import *
 from synchronizers.new_base.ansible_helper import run_template_ssh
 from xos.logger import Logger, logging
-import wrappers.vegtenant
-import wrappers.veeserviceinstance
 
 # hpclibrary will be in steps/..
 parentdir = os.path.join(os.path.dirname(__file__),"..")
diff --git a/xos/synchronizer/veg_config.yaml b/xos/synchronizer/veg_config.yaml
index 342ffc1..af18596 100644
--- a/xos/synchronizer/veg_config.yaml
+++ b/xos/synchronizer/veg_config.yaml
@@ -20,3 +20,6 @@
 steps_dir: "/opt/xos/synchronizers/veg/steps"
 sys_dir: "/opt/xos/synchronizers/veg/sys"
 model_policies_dir: "/opt/xos/synchronizers/veg/model_policies"
+wrappers:
+  - wrappers.veeserviceinstance
+  - wrappers.vegtenant
diff --git a/xos/unittest.cfg b/xos/unittest.cfg
new file mode 100644
index 0000000..a5bdb18
--- /dev/null
+++ b/xos/unittest.cfg
@@ -0,0 +1,4 @@
+[unittest]
+plugins=nose2-plugins.exclude
+code-directories=synchronizer
+                 model_policies
