Hi Folks,
Currently VSPERF uses a lot of configuration options spread among several
configuration files, but only a few of them are configurable "on the fly" by
CLI option -test-params. During the past, there were several requirements to
allow a CLI modification of various configuration options. So in these days
some of them can be modified, but it is hard to find, which one (one have to
consult documentation related to the specific feature).
What about a change which will allow to modify any option by CLI (and
"Parameters" option of testcase definition)? It means, that for any
configuration option (by default UPPER case name) its lower case form can be
used to redefine the value through -test-params argument.
In a nutshell following patch will do the trick:
diff --git a/conf/__init__.py b/conf/__init__.py
index 4622823..d4332ac 100644
--- a/conf/__init__.py
+++ b/conf/__init__.py
@@ -34,7 +34,11 @@ class Settings(object):
"""Return a settings item value
"""
if attr in self.__dict__:
- return getattr(self, attr)
+ if attr == 'TEST_PARAMS':
+ return getattr(self, attr)
+ else:
+ # Check if parameter value was overridden by CLI option
+ return get_test_param(attr.lower(), getattr(self, attr))
else:
raise AttributeError("%r object has no attribute %r" %
(self.__class__, attr))
Let me know what do you think (e.g. reply with +1).
If you'll find it useful, I'll create a ticket for that and prepare a patch.
The final patch have to take into the account currently supported CLI
parameters (i.e. code cleanup & type conversion/checking & testing).
Best Regards,
Martin
--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263
This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
_______________________________________________
opnfv-tech-discuss mailing list
[email protected]
https://lists.opnfv.org/mailman/listinfo/opnfv-tech-discuss