Bypass APEX-570 when publishing image metadata 97/53697/2
authorCédric Ollivier <cedric.ollivier@orange.com>
Tue, 13 Mar 2018 15:27:39 +0000 (16:27 +0100)
committerCédric Ollivier <cedric.ollivier@orange.com>
Tue, 13 Mar 2018 16:36:15 +0000 (17:36 +0100)
This temporarily fix aims at testing juju_epc vs a non default region
name [1]. It must be removed as soon as APEX is fixed [2].

It completes the previous patch which only modified credentials [3].

[1] https://build.opnfv.org/ci/view/functest/job/functest-apex-baremetal-daily-master/lastFailedBuild/console
[2] https://jira.opnfv.org/browse/APEX-570
[3] https://gerrit.opnfv.org/gerrit/#/c/53465/

Change-Id: I3e1e64ad7147ee5cdf899eb2500f8b825b818619
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
functest/opnfv_tests/vnf/epc/juju_epc.py

index 0239e11..3967891 100644 (file)
@@ -284,10 +284,17 @@ class JujuEpc(vnf.VnfOnBoarding):
                     name=image_name, image_user='cloud', img_format='qcow2',
                     image_file=image_file))
                 image_id = image_creator.create().id
+                # It allows gating APEX and ensures this testcase is working
+                # till https://jira.opnfv.org/browse/APEX-570 is fixed in APEX.
+                # It must be removed as soon as possible to disable per
+                # installer processing in Functest.
+                region = self.snaps_creds.region_name
+                if not region and env.get('INSTALLER_TYPE') == 'apex':
+                    region = "regionOne"
                 os.system(
                     'juju metadata generate-image -d ~ -i {} -s {} -r '
                     '{} -u {}'.format(
-                        image_id, image_name, self.snaps_creds.region_name,
+                        image_id, image_name, region,
                         self.public_auth_url))
                 self.created_object.append(image_creator)
         self.__logger.info("Network ID  : %s", net_id)