From 8439f0cf56f719c33cc0f785609824c6ac83a04d Mon Sep 17 00:00:00 2001 From: ahothan Date: Sat, 3 Sep 2016 09:07:32 -0700 Subject: [PATCH] Add --keep-first-flow-and-exit option Change-Id: Id34fc89d523d9279c6b4b74080de8fb74a054a9a --- vmtp/vmtp.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/vmtp/vmtp.py b/vmtp/vmtp.py index efd628a..f0d61a5 100755 --- a/vmtp/vmtp.py +++ b/vmtp/vmtp.py @@ -356,6 +356,12 @@ class VmtpTest(object): self.server, bandwidth=self.config.vm_bandwidth, az_to=self.server.az) + if self.config.keep_first_flow_and_exit: + CONLOG.info(self.rescol.ppr.pformat(perf_output)) + FILELOG.info(json.dumps(perf_output, sort_keys=True)) + LOG.info('Stopping execution after first flow, cleanup all VMs/networks manually') + sys.exit(0) + if self.config.stop_on_error: # check if there is any error in the results results_list = perf_output['results'] @@ -877,6 +883,12 @@ def parse_opts_from_cli(): action='store_true', help='Stop and keep everything as-is on error (must cleanup manually)') + parser.add_argument('--keep-first-flow-and-exit', dest='keep_first_flow_and_exit', + default=False, + action='store_true', + help='Stage and run the first flow and exit' + ' without cleanup (must cleanup manually)') + parser.add_argument('--vm-image-url', dest='vm_image_url', action='store', help='URL to a Linux image in qcow2 format that can be downloaded from' @@ -932,6 +944,7 @@ def merge_opts_to_configs(opts): config.debug = opts.debug config.stop_on_error = opts.stop_on_error + config.keep_first_flow_and_exit = opts.keep_first_flow_and_exit config.inter_node_only = opts.inter_node_only config.same_network_only = opts.same_network_only