moving all libs to global scope 65/91765/1
authorDR695H <dr695h@att.com>
Fri, 19 Jul 2019 18:29:09 +0000 (14:29 -0400)
committerDR695H <dr695h@att.com>
Fri, 19 Jul 2019 18:29:09 +0000 (14:29 -0400)
Issue-ID: TEST-174
Change-Id: Ieae316661540206eb1e74126f8b8859e373e3786
Signed-off-by: DR695H <dr695h@att.com>
16 files changed:
robotframework-onap/ONAPLibrary/JSON.py
robotframework-onap/ONAPLibrary/Kafka.py
robotframework-onap/ONAPLibrary/MUSIC.py
robotframework-onap/ONAPLibrary/OOF.py
robotframework-onap/ONAPLibrary/Openstack.py
robotframework-onap/ONAPLibrary/PreloadData.py
robotframework-onap/ONAPLibrary/Protobuf.py
robotframework-onap/ONAPLibrary/SDC.py
robotframework-onap/ONAPLibrary/SDNC.py
robotframework-onap/ONAPLibrary/SO.py
robotframework-onap/ONAPLibrary/ServiceMapping.py
robotframework-onap/ONAPLibrary/Templating.py
robotframework-onap/ONAPLibrary/Utilities.py
robotframework-onap/tests/ONAPLibrary/ServiceMappingKeywordsTests.py [new file with mode: 0644]
robotframework-onap/tests/ONAPLibrary/vFW/service_mapping.json [new file with mode: 0644]
robotframework-onap/tests/runner.py

index 1cb67dd..b3ef653 100644 (file)
@@ -21,6 +21,8 @@ class JSON(HybridCore):
     """JSON is common resource for simple json helper keywords.
     """
 
+    ROBOT_LIBRARY_SCOPE = "GLOBAL"
+
     def __init__(self):
         self.keyword_implementors = [
             JSONKeywords(),
index 5ff8b21..e089531 100644 (file)
@@ -19,6 +19,8 @@ from ONAPLibrary.KafkaKeywords import KafkaKeywords
 class Kafka(HybridCore):
     """ Utilities useful for Kafka consuming and producing """
 
+    ROBOT_LIBRARY_SCOPE = "GLOBAL"
+
     def __init__(self):
         self.keyword_implementors = [
             KafkaKeywords()
index 29ebd9c..88eb405 100644 (file)
@@ -20,6 +20,8 @@ class MUSIC(HybridCore):
     """MUSIC is an ONAP testing library for Robot Framework that provides functionality for interacting with the music
     component. """
 
+    ROBOT_LIBRARY_SCOPE = "GLOBAL"
+
     def __init__(self):
         self.keyword_implementors = [
             MUSICKeywords()
index d1cc864..34b93ea 100644 (file)
@@ -20,6 +20,8 @@ class OOF(HybridCore):
     """OOF is an ONAP testing library for Robot Framework that provides functionality for interacting with the
     optimiztion framework. """
 
+    ROBOT_LIBRARY_SCOPE = "GLOBAL"
+
     def __init__(self):
         self.keyword_implementors = [
             SNIROKeywords()
index 833d731..b8861b2 100644 (file)
@@ -21,6 +21,8 @@ class Openstack(HybridCore):
     """SO is an ONAP testing library for Robot Framework that provides functionality for interacting with the serivce
     orchestrator. """
 
+    ROBOT_LIBRARY_SCOPE = "GLOBAL"
+
     def __init__(self):
         self.keyword_implementors = [
             BaseOpenstackKeywords(),
index 81ddcb8..4d24078 100644 (file)
@@ -20,6 +20,8 @@ class PreloadData(HybridCore):
     """PreloadData is an ONAP testing library for Robot Framework that enables the use of a preload_data.json
     to dynamically add preload data to a robot test suite with out changing robot code"""
 
+    ROBOT_LIBRARY_SCOPE = "GLOBAL"
+
     def __init__(self):
         self.keyword_implementors = [
             PreloadDataKeywords()
index c81a0a2..0dfb1c4 100644 (file)
@@ -19,6 +19,8 @@ from ONAPLibrary.ProtobufKeywords import ProtobufKeywords
 class Protobuf(HybridCore):
     """ Utilities useful for Protobuf manipulation """
 
+    ROBOT_LIBRARY_SCOPE = "GLOBAL"
+
     def __init__(self):
         self.keyword_implementors = [
             ProtobufKeywords()
index d3dd9b3..f95468a 100644 (file)
@@ -20,6 +20,8 @@ class SDC(HybridCore):
     """SDC is an ONAP testing library for Robot Framework that provides functionality for interacting with the serivce
     orchestrator. """
 
+    ROBOT_LIBRARY_SCOPE = "GLOBAL"
+
     def __init__(self):
         self.keyword_implementors = [
             BaseSDCKeywords()
index bd16ae4..a96ef5f 100644 (file)
@@ -21,6 +21,8 @@ class SDNC(HybridCore):
     """SDNC is an ONAP testing library for Robot Framework that provides functionality for interacting with the network
     controller. """
 
+    ROBOT_LIBRARY_SCOPE = "GLOBAL"
+
     def __init__(self):
         self.keyword_implementors = [
             BaseSDNCKeywords(),
index b01c14f..2454e97 100644 (file)
@@ -21,6 +21,8 @@ class SO(HybridCore):
     """SO is an ONAP testing library for Robot Framework that provides functionality for interacting with the serivce
     orchestrator. """
 
+    ROBOT_LIBRARY_SCOPE = "GLOBAL"
+
     def __init__(self):
         self.keyword_implementors = [
             BaseSOKeywords(),
index 16125c2..8eeb3c9 100644 (file)
@@ -20,6 +20,8 @@ class ServiceMapping(HybridCore):
     """ServiceMapping is an ONAP testing library for Robot Framework that enables the use of a service_mapping.json
     to dynamically add services to a robot test suite with out changing robot code"""
 
+    ROBOT_LIBRARY_SCOPE = "GLOBAL"
+
     def __init__(self):
         self.keyword_implementors = [
             ServiceMappingKeywords()
index 8975402..fc26829 100644 (file)
@@ -21,6 +21,8 @@ class Templating(HybridCore):
     templating engine
     """
 
+    ROBOT_LIBRARY_SCOPE = "GLOBAL"
+
     def __init__(self):
         self.keyword_implementors = [
             TemplatingKeywords()
index f791c9a..5751e21 100644 (file)
@@ -23,6 +23,8 @@ from ONAPLibrary.Base64Keywords import Base64Keywords
 class Utilities(HybridCore):
     """ Keywords are useful for helper functions requests """
 
+    ROBOT_LIBRARY_SCOPE = "GLOBAL"
+
     def __init__(self):
         self.keyword_implementors = [
             DNSKeywords(),
diff --git a/robotframework-onap/tests/ONAPLibrary/ServiceMappingKeywordsTests.py b/robotframework-onap/tests/ONAPLibrary/ServiceMappingKeywordsTests.py
new file mode 100644 (file)
index 0000000..105ebf4
--- /dev/null
@@ -0,0 +1,33 @@
+# Copyright 2019 AT&T Intellectual Property. All rights reserved.
+#
+# 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.
+
+from robot.api.deco import keyword
+import os.path
+from unittest import TestCase
+from ONAPLibrary.ServiceMappingKeywords import ServiceMappingKeywords
+
+
+class ServiceMappingKeywordsTests(TestCase):
+
+    @staticmethod
+    def _get_location():
+        path = os.path.realpath(
+            os.path.join(os.getcwd(), os.path.dirname(__file__)))
+        return path
+
+    @keyword
+    def test(self):
+        sm = ServiceMappingKeywords()
+        sm.set_directory("default", self._get_location())
+        self.assertEqual(['vFW'], sm.get_service_folder_mapping("default", "vFW"))
diff --git a/robotframework-onap/tests/ONAPLibrary/vFW/service_mapping.json b/robotframework-onap/tests/ONAPLibrary/vFW/service_mapping.json
new file mode 100644 (file)
index 0000000..0c6486f
--- /dev/null
@@ -0,0 +1,20 @@
+{
+   "GLOBAL_SERVICE_FOLDER_MAPPING": { 
+                               "vFW" : ["vFW"]
+   },
+   "GLOBAL_SERVICE_VNF_MAPPING": { 
+           "vFW"  : ["vFW"]
+   },
+   "GLOBAL_SERVICE_GEN_NEUTRON_NETWORK_MAPPING": {
+        "vFW" :[]
+   },
+   "GLOBAL_SERVICE_DEPLOYMENT_ARTIFACT_MAPPING": {
+    "vFW" :[]
+   },
+   "GLOBAL_SERVICE_TEMPLATE_MAPPING":  {
+    "vFW"  : [{"isBase" : "true", "template" : "vfw_preload.template", "vnf_index": "0", "name_pattern": "base_vfw"}]
+   },
+   "GLOBAL_VALIDATE_NAME_MAPPING": {
+                                 "vFW" : "vfw_name_0"
+   } 
+}
index 63487ff..d1b217a 100644 (file)
@@ -6,6 +6,7 @@ from unittest import TestSuite
 from tests.vcpeutils.SoUtils_test import SoUtilsTest
 from tests.ONAPLibrary.ProtobufKeywordsTest import ProtobufKeywordsTest
 from tests.ONAPLibrary.UUIDKeywordsTest import UUIDKeywordsTest
+from tests.ONAPLibrary.ServiceMappingKeywordsTests import ServiceMappingKeywordsTests
 
 # initialize the test suite
 loader = TestLoader()
@@ -15,6 +16,7 @@ suite = TestSuite()
 suite.addTests(loader.loadTestsFromTestCase(ProtobufKeywordsTest))
 suite.addTests(loader.loadTestsFromTestCase(SoUtilsTest))
 suite.addTests(loader.loadTestsFromTestCase(UUIDKeywordsTest))
+suite.addTests(loader.loadTestsFromTestCase(ServiceMappingKeywordsTests))
 
 # initialize a runner, pass it your suite and run it
 runner = TextTestRunner(verbosity=3)