From 37f74b50178fc458d9e1bc9fff1cd8bcdd9ada8d Mon Sep 17 00:00:00 2001 From: Martin Klozik Date: Thu, 23 Jul 2015 08:30:19 +0100 Subject: Support vswitch selection from the command line. New command line argument '--vswitch' was introduced to override vswitch implementation selected in configuration file. Modified file: * vsperf JIRA: VSPERF-27 Change-Id: Ia0070ea9f998349dcca697a0fe9519a009479477 Signed-off-by: Martin Klozik (martinx.klozik@intel.com) Reviewed-by: Maryam Tahhan --- vsperf | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/vsperf b/vsperf index cb02d6db..34f42ca5 100755 --- a/vsperf +++ b/vsperf @@ -130,6 +130,7 @@ def parse_arguments(): group.add_argument('--verbosity', choices=list_logging_levels(), help='debug level') group.add_argument('--trafficgen', help='traffic generator to use') + group.add_argument('--vswitch', help='vswitch implementation to use') group.add_argument('--sysmetrics', help='system metrics logger to use') group = parser.add_argument_group('test behavior options') group.add_argument('--xunit', action='store_true', @@ -301,6 +302,16 @@ def main(): settings.getValue('TRAFFICGEN_DIR')) sys.exit(1) + # configure vswitch + if args['vswitch']: + vswitches = Loader().get_vswitches() + if args['vswitch'] not in vswitches: + logging.error('There are no vswitches matching \'%s\' found in' + ' \'%s\'. Exiting...', args['vswitch'], + settings.getValue('VSWITCH_DIR')) + sys.exit(1) + + # generate results directory name date = datetime.datetime.fromtimestamp(time.time()) -- cgit 1.2.3-korg