summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2017-01-05 09:19:34 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-01-05 09:19:34 +0000
commite7a55a6d763692acc2cb1cddf5bf21eb7be95310 (patch)
treee41b410d4419ca11477a1253aaa0f79c41ea665b /tools
parenta09699652cdb1d68a333dcb9bffb2062d681f441 (diff)
parentd478c32bd174a5bf19d1a3384bb3b4e03f442920 (diff)
Merge "pkt_gen: STC - Handle Results DB file synchronization failures."
Diffstat (limited to 'tools')
-rw-r--r--tools/pkt_gen/testcenter/testcenter-rfc2544-rest.py9
-rw-r--r--tools/pkt_gen/testcenter/testcenter-rfc2889-rest.py9
2 files changed, 14 insertions, 4 deletions
diff --git a/tools/pkt_gen/testcenter/testcenter-rfc2544-rest.py b/tools/pkt_gen/testcenter/testcenter-rfc2544-rest.py
index 538d8a8a..8da8ed17 100644
--- a/tools/pkt_gen/testcenter/testcenter-rfc2544-rest.py
+++ b/tools/pkt_gen/testcenter/testcenter-rfc2544-rest.py
@@ -490,8 +490,13 @@ def main():
resultsdb = args.results_dir + \
lab_server_resultsdb.split("/Results")[1]
- logger.info(
- "The local summary DB file has been saved to %s", resultsdb)
+ if not os.path.exists(resultsdb):
+ resultsdb = lab_server_resultsdb
+ logger.info("Failed to create the local summary DB File, using"
+ " the remote DB file instead.")
+ else:
+ logger.info(
+ "The local summary DB file has been saved to %s", resultsdb)
# The returns the "RFC2544ThroughputTestResultDetailedSummaryView"
# table view from the results database.
diff --git a/tools/pkt_gen/testcenter/testcenter-rfc2889-rest.py b/tools/pkt_gen/testcenter/testcenter-rfc2889-rest.py
index cfa425e8..ddb64562 100644
--- a/tools/pkt_gen/testcenter/testcenter-rfc2889-rest.py
+++ b/tools/pkt_gen/testcenter/testcenter-rfc2889-rest.py
@@ -265,8 +265,13 @@ def main():
resultsdb = args.results_dir + \
lab_server_resultsdb.split("/Results")[1]
- logger.info(
- "The local summary DB file has been saved to %s", resultsdb)
+ if not os.path.exists(resultsdb):
+ resultsdb = lab_server_resultsdb
+ logger.info("Failed to create the local summary DB file, using"
+ " the remote DB file instead.")
+ else:
+ logger.info(
+ "The local summary DB file has been saved to %s", resultsdb)
resultsdict = (
stc.perform("QueryResult",