Change vgw module name for vCPE test script

Change-Id: I17308f23812cc1a335155fd4e9e789bed04dec00
Issue-ID: INT-717
Signed-off-by: Yang Xu <yang.xu3@huawei.com>
diff --git a/test/vcpe/cleanvGMUX.py b/test/vcpe/cleanvGMUX.py
old mode 100644
new mode 100755
index fe586fe..29f35ae
--- a/test/vcpe/cleanvGMUX.py
+++ b/test/vcpe/cleanvGMUX.py
@@ -61,4 +61,3 @@
     logger.debug('---------------------------------------------------------------')
     logger.debug('list interfaces after cleaning gmux')
     list_interface()
-
diff --git a/test/vcpe/healthcheck-k8s.py b/test/vcpe/healthcheck-k8s.py
old mode 100644
new mode 100755
diff --git a/test/vcpe/loop.py b/test/vcpe/loop.py
index ad58797..d024396 100755
--- a/test/vcpe/loop.py
+++ b/test/vcpe/loop.py
@@ -25,7 +25,7 @@
 custom.del_vgmux_ves_mode(hosts['mux'])
 time.sleep(2)
 custom.del_vgmux_ves_collector(hosts['mux'])
-exit()
+#exit()
 
 time.sleep(2)
 logging.info('Setting vGMUX DCAE collector IP address')
diff --git a/test/vcpe/preload_templates/template.vcpe_gwgra_vfmodule.json b/test/vcpe/preload_templates/template.vcpe_gwgra_vfmodule.json
index ced57ca..b9e7c3d 100644
--- a/test/vcpe/preload_templates/template.vcpe_gwgra_vfmodule.json
+++ b/test/vcpe/preload_templates/template.vcpe_gwgra_vfmodule.json
@@ -112,7 +112,7 @@
 				] },
 				"vf-module-assignments": {},
 				"vf-module-topology-identifier": {
-					"vf-module-name": "zRegionOne${vgw_vfmod_name_index}_base_vcpe_vgw_0"
+					"vf-module-name": "VGW2BRG-${brg_mac}"
 				}
 			},
 			"vnf-resource-assignments": {},
diff --git a/test/vcpe/preload_templates/template.vcpe_vgw_vfmodule.json b/test/vcpe/preload_templates/template.vcpe_vgw_vfmodule.json
index fef5cbb..f56e8f4 100644
--- a/test/vcpe/preload_templates/template.vcpe_vgw_vfmodule.json
+++ b/test/vcpe/preload_templates/template.vcpe_vgw_vfmodule.json
@@ -47,15 +47,15 @@
                 }, 
                 {
                     "vnf-parameter-name": "vgw_private_ip_0", 
-                    "vnf-parameter-value": "10.5.0.111"
+                    "vnf-parameter-value": "10.5.0.116"
                 }, 
                 {
                     "vnf-parameter-name": "vgw_private_ip_1", 
-                    "vnf-parameter-value": "10.0.101.111"
+                    "vnf-parameter-value": "10.0.101.116"
                 }, 
                 {
                     "vnf-parameter-name": "vgw_private_ip_2", 
-                    "vnf-parameter-value": "10.2.0.26"
+                    "vnf-parameter-value": "10.2.0.31"
                 }, 
                 {
                     "vnf-parameter-name": "vgw_name_0", 
@@ -67,7 +67,7 @@
                 }, 
                 {
                     "vnf-parameter-name": "vg_vgmux_tunnel_vni", 
-                    "vnf-parameter-value": "111"
+                    "vnf-parameter-value": "116"
                 }, 
                 {
                     "vnf-parameter-name": "onap_private_net_id", 
diff --git a/test/vcpe/soutils.py b/test/vcpe/soutils.py
index 7603127..6d6a27e 100755
--- a/test/vcpe/soutils.py
+++ b/test/vcpe/soutils.py
@@ -166,6 +166,7 @@
                                        'owningEntityName': self.vcpecommon.owning_entity_name}
 
     def generate_custom_service_request(self, instance_name, model, brg_mac):
+        brg_mac_enc = brg_mac.replace(':', '-')
         req_details = {
             'modelInfo':  model,
             'subscriberInfo':  {'subscriberName': 'Kaneohe',
@@ -182,8 +183,8 @@
                        'name': 'VfModuleNames',
                        'value': [
                             {
-                                'VfModuleModelInvariantUuid': 'c16ad38c-2c2c-49ae-bbe8-66c7ffbcc30a',
-                                'VfModuleName': 'VGW2BRG-fa:16:3e:5c:27:8b'
+                                'VfModuleModelInvariantUuid': self.vcpecommon.vgw_VfModuleModelInvariantUuid,
+                                'VfModuleName': 'VGW2BRG-{0}'.format(brg_mac_enc)
                             }
                        ]
                     },
diff --git a/test/vcpe/vcpe.py b/test/vcpe/vcpe.py
index 925f11d..3fb96c5 100755
--- a/test/vcpe/vcpe.py
+++ b/test/vcpe/vcpe.py
@@ -159,7 +159,7 @@
     time.sleep(2)
     vcpecommon.del_vgmux_ves_collector()
 
-    logger.info('Staring vGMUX data reporting to DCAE')
+    logger.info('Starting vGMUX data reporting to DCAE')
     time.sleep(2)
     vcpecommon.set_vgmux_ves_collector()
 
diff --git a/test/vcpe/vcpe_custom_service.py b/test/vcpe/vcpe_custom_service.py
index 408f8a8..36012f7 100755
--- a/test/vcpe/vcpe_custom_service.py
+++ b/test/vcpe/vcpe_custom_service.py
@@ -72,6 +72,7 @@
             brg_mac = str(raw_input("Enter the BRG MAC address: "))
         else:
             brg_mac = self.vcpecommon.get_brg_mac_from_sdnc()
+        brg_mac_enc = brg_mac.replace(':', '-')
         # get name index
         self.vgw_vfmod_name_index= self.vcpecommon.load_object(self.vcpecommon.vgw_vfmod_name_index_file)
         self.vgw_vfmod_name_index=self.vgw_vfmod_name_index + 1
@@ -83,7 +84,7 @@
             self.vcpecommon.increase_ip_address_or_vni_in_template(vgw_template_file, parameters_to_change)
             preloader.preload_vgw(vgw_template_file, brg_mac, preload_dict, name_suffix)
             # preload vGW-GRA
-            preloader.preload_vgw_gra(vgw_gra_template_file, brg_mac, preload_dict, name_suffix, str(self.vgw_vfmod_name_index))
+            preloader.preload_vgw_gra(vgw_gra_template_file, brg_mac_enc, preload_dict, name_suffix, str(self.vgw_vfmod_name_index))
 
         # create service
         so = soutils.SoUtils(self.vcpecommon, 'v5')
diff --git a/test/vcpe/vcpecommon.py b/test/vcpe/vcpecommon.py
index 29aad19..18390f7 100755
--- a/test/vcpe/vcpecommon.py
+++ b/test/vcpe/vcpecommon.py
@@ -67,6 +67,8 @@
         self.logger = logging.getLogger(__name__)
         self.logger.info('Initializing configuration')
 
+        # 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