CORD-2476 migrate vsg service to dynamic load

Change-Id: Ifadbf322b8f59f8e87a77822e652abb7ed107af6
diff --git a/xos/synchronizer/model_policies/test_model_policy_vsgserviceinstance.py b/xos/synchronizer/model_policies/test_model_policy_vsgserviceinstance.py
index aaad139..99cdd94 100644
--- a/xos/synchronizer/model_policies/test_model_policy_vsgserviceinstance.py
+++ b/xos/synchronizer/model_policies/test_model_policy_vsgserviceinstance.py
@@ -27,9 +27,17 @@
     xos_dir=os.path.join(test_path, "../../../../../../orchestration/xos/xos")
     services_dir=os.path.join(xos_dir, "../../xos_services")
 
-# ---------------------------------------------------------------------------------------------------------------------
-# End Model Policy Testing Framework
-# ---------------------------------------------------------------------------------------------------------------------
+# While transitioning from static to dynamic load, the path to find neighboring xproto files has changed. So check
+# both possible locations...
+def get_models_fn(service_name, xproto_name):
+    name = os.path.join(service_name, "xos", xproto_name)
+    if os.path.exists(os.path.join(services_dir, name)):
+        return name
+    else:
+        name = os.path.join(service_name, "xos", "synchronizer", "models", xproto_name)
+        if os.path.exists(os.path.join(services_dir, name)):
+            return name
+    raise Exception("Unable to find service=%s xproto=%s" % (service_name, xproto_name))
 
 class TestModelPolicyVsgTenant(unittest.TestCase):
     def setUp(self):
@@ -45,7 +53,8 @@
         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, ["vsg/xos/vsg.xproto", "addressmanager/xos/addressmanager.xproto"])
+        build_mock_modelaccessor(xos_dir, services_dir, [get_models_fn("vsg", "vsg.xproto"),
+                                                         get_models_fn("addressmanager", "addressmanager.xproto")])
 
         import synchronizers.new_base.modelaccessor
         import synchronizers.new_base.model_policies.model_policy_tenantwithcontainer