workaround for bgpvpn tempest run 79/53379/1
authorPeriyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>
Fri, 9 Mar 2018 09:00:50 +0000 (10:00 +0100)
committerPeriyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>
Fri, 9 Mar 2018 09:01:30 +0000 (10:01 +0100)
Adding tempest.conf file in the /etc/tempest directory as it is needed
for tempest run command.

Change-Id: I754dca76908014dcbb17e82a2e7b561d4826bff0
Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>
sdnvpn/test/functest/run_tempest.py

index 5d124b9..2661507 100644 (file)
@@ -56,6 +56,13 @@ def main():
            "cd -;".format(verifier_repo_dir, bgpvpn_tempest_list))
     logger.info("Generating bgpvpn tempest list: %s" % cmd)
     os.popen(cmd)
+    # TODO: Though --config-file parameter is set during the tempest run,
+    # it looks for tempest.conf at /etc/tempest/ directory. so applying
+    # the following workaround. Will remove it when the root cause is found.
+    cmd = ("mkdir /etc/tempest;"
+           "cp {0} /etc/tempest/tempest.conf".format(bgpvpn_tempest_conf))
+    logger.info("Configuring default tempest conf file")
+    os.popen(cmd)
 
     cmd_line = ("tempest run --config-file {0} -t --whitelist-file {1}"
                 .format(bgpvpn_tempest_conf, bgpvpn_tempest_list))
@@ -80,7 +87,7 @@ def main():
         m = re.search('Ran:(.*)tests', output)
         num_tests = m.group(1)
         # Look for tests failed
-        m = re.search('Failed:(.*)', output)
+        m = re.search('Failed:(.*)', output)
         failed = m.group(1)
         # Look for name of the tests
         testcases = re.findall("\{0\} (.*)", output)
@@ -94,8 +101,8 @@ def main():
             status = "FAIL"
 
         return {"status": status, "details": results}
-    except:
-        logger.error("Problem when parsing the results.")
+    except Exception as e:
+        logger.error("Problem when parsing the results: %s", e)
 
 
 if __name__ == '__main__':