From f426da4469d88fc520fa7aa96576b7ca8096e4d0 Mon Sep 17 00:00:00 2001 From: Maryam Tahhan Date: Thu, 30 Jul 2015 13:44:36 +0100 Subject: bug_fix: process pkt_size/duration from cli Refactor rfc25444_duration to duration and update the --test-params help to show the type of parameters that can be set from the cli. Also configure pkt_sizes so that it can be modified from the CLI. Also fixes the tcl script to configure framesize properly (to the value selected and not the default 64b). JIRA: VSPERF-27 Change-Id: I76dcd824977a5f940cf7476090d2d2a3acca8160 Signed-off-by: Billy O'Mahony Signed-off-by: Maryam Tahhan Reviewed-by: Al Morton Reviewed-by: Dino Madarang --- vsperf | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'vsperf') diff --git a/vsperf b/vsperf index 4510e121..d5086ac4 100755 --- a/vsperf +++ b/vsperf @@ -56,7 +56,9 @@ def parse_arguments(): """ Parse and split the '--test-params' argument. - This expects either 'x=y' or 'x' (implicit true) values. + This expects either 'x=y', 'x=y,z' or 'x' (implicit true) + values. For multiple overrides use a ; separated list for + e.g. --test-params 'x=z; y=a,b' """ def __call__(self, parser, namespace, values, option_string=None): results = {} @@ -137,6 +139,7 @@ def parse_arguments(): group.add_argument('--trafficgen', help='traffic generator to use') group.add_argument('--vswitch', help='vswitch implementation to use') group.add_argument('--vnf', help='vnf to use') + group.add_argument('--duration', help='traffic transmit duration') 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', @@ -148,7 +151,9 @@ def parse_arguments(): group.add_argument('--conf-file', action=_ValidateFileAction, help='settings file') group.add_argument('--test-params', action=_SplitTestParamsAction, - help='csv list of test parameters: key=val;...') + help='csv list of test parameters: key=val; e.g.' + 'including pkt_sizes=x,y; duration=x; ' + 'rfc2544_trials=x ...') args = vars(parser.parse_args()) @@ -325,6 +330,13 @@ def main(): settings.getValue('vnf_dir')) sys.exit(1) + if args['duration']: + if args['duration'].isdigit() and int(args['duration']) > 0: + settings.setValue('duration', args['duration']) + else: + logging.error('The selected Duration is not a number') + sys.exit(1) + # generate results directory name date = datetime.datetime.fromtimestamp(time.time()) results_dir = "results_" + date.strftime('%Y-%m-%d_%H-%M-%S') -- cgit