Merge "Integration doc for 5g pnp pnf use case"
[integration.git] / test / vcpe / vcpecommon.py
index 8977170..18390f7 100755 (executable)
@@ -19,32 +19,28 @@ class VcpeCommon:
     external_net_prefix_len = 16
     #############################################################################################
     # set the openstack cloud access credentials here
-    oom_mode = False
+    oom_mode = True
 
     cloud = {
         '--os-auth-url': 'http://10.12.25.2:5000',
         '--os-username': 'kxi',
         '--os-user-domain-id': 'default',
         '--os-project-domain-id': 'default',
-        '--os-tenant-id': '41d6d38489bd40b09ea8a6b6b852dcbd' if oom_mode else '1e097c6713e74fd7ac8e4295e605ee1e',
+        '--os-tenant-id': 'b8ad3842ab3642f7bf3fbe4e4d3b9f86' if oom_mode else '1e097c6713e74fd7ac8e4295e605ee1e',
         '--os-region-name': 'RegionOne',
         '--os-password': 'n3JhGMGuDzD8',
-        '--os-project-domain-name': 'Integration-SB-00' if oom_mode else 'Integration-SB-07',
+        '--os-project-domain-name': 'Integration-SB-05' if oom_mode else 'Integration-SB-07',
         '--os-identity-api-version': '3'
     }
 
     common_preload_config = {
-        'oam_onap_net': 'oam_network_0qV7' if oom_mode else 'oam_onap_lAky',
-        'oam_onap_subnet': 'oam_network_0qV7' if oom_mode else 'oam_onap_lAky',
+        'oam_onap_net': 'oam_network_AiBB' if oom_mode else 'oam_onap_lAky',
+        'oam_onap_subnet': 'oam_network_AiBB' if oom_mode else 'oam_onap_lAky',
         'public_net': 'external',
         'public_net_id': '971040b2-7059-49dc-b220-4fab50cb2ad4'
     }
-# for sb07
-#    'oam_onap_lAky',
-# for sb00
-    #'oam_onap_net': 'oam_network_0qV7',
-    #'oam_onap_subnet': 'oam_network_0qV7',
-    #     End: configurations that you must change for a new ONAP installation
+    sdnc_controller_pod = 'dev-sdnc-sdnc-0'
+
     #############################################################################################
 
     template_variable_symbol = '${'
@@ -71,8 +67,17 @@ class VcpeCommon:
         self.logger = logging.getLogger(__name__)
         self.logger.info('Initializing configuration')
 
-        self.oom_so_sdnc_aai_ip = '10.12.5.18'
-        self.oom_dcae_ves_collector = '10.12.5.18'
+        # vgw_VfModuleModelInvariantUuid is in rescust service csar, look in service-VcpesvcRescust1118-template.yml for groups vgw module metadata. TODO: read this value automcatically
+        self.vgw_VfModuleModelInvariantUuid = 'c16ad38c-2c2c-49ae-bbe8-66c7ffbcc30a'
+        # OOM: this is the address that the brg and bng will nat for config of brg - 10.0.0.x address of k8 host for sdnc
+        self.sdnc_oam_ip = '10.0.0.20'
+        # OOM: this is a k8 host external IP 
+        self.oom_so_sdnc_aai_ip = '10.12.5.228'
+        # OOM: this is a k8 host external IP  can be same as oom_so_sdnc_aai_ip
+        self.oom_dcae_ves_collector = '10.12.5.228'
+        # OOM: this is a k8 host external IP  can be same as oom_so_sdnc_aai_ip
+        self.mr_ip_addr = '10.12.5.228'
+        self.mr_ip_port = '30227'
         self.so_nbi_port = '30277' if self.oom_mode else '8080'
         self.sdnc_preloading_port = '30202' if self.oom_mode else '8282'
         self.aai_query_port = '30233' if self.oom_mode else '8443'
@@ -133,7 +138,7 @@ class VcpeCommon:
         #############################################################################################
         # SO urls, note: do NOT add a '/' at the end of the url
         self.so_req_api_url = {'v4': 'http://' + self.hosts['so'] + ':' + self.so_nbi_port + '/onap/so/infra/serviceInstantiation/v7/serviceInstances',
-                           'v5': 'http://' + self.hosts['so'] + ':' + self.so_nbi_port + '/onap/so/infraserviceInstantiation/v7/serviceInstances'}
+                           'v5': 'http://' + self.hosts['so'] + ':' + self.so_nbi_port + '/onap/so/infra/serviceInstantiation/v7/serviceInstances'}
         self.so_check_progress_api_url = 'http://' + self.hosts['so'] + ':' + self.so_nbi_port + '/onap/so/infra/orchestrationRequests/v6'
         self.so_userpass = 'InfraPortalClient', 'password1$'
         self.so_headers = {'Content-Type': 'application/json', 'Accept': 'application/json'}
@@ -314,6 +319,17 @@ class VcpeCommon:
                 return str(ip)
         return None
 
+    def get_pod_node_oam_ip(self, pod):
+        """
+        :Assuming kubectl is available
+        :param pod: pod name as a string, e.g. 'dev-sdnc-sdnc-0'
+        :return pod's node oam ip (10.0.0.0/16)
+        """
+        cmd = "kubectl -n onap describe pod {0} |grep Node:|cut -d'/' -f2".format(pod)
+        ret = commands.getstatusoutput(cmd)
+        self.logger.debug("cmd = %s, ret = %s", cmd, ret)
+        return ret
+
     def get_vm_ip(self, keywords, net_addr=None, net_addr_len=None):
         """
         :param keywords: list of keywords to search for vm, e.g. ['bng', 'gmux', 'brg']