* [PATCH net-next] tc-testing: split config file
@ 2017-10-31 18:27 Brenda J. Butler
2017-10-31 18:40 ` Lucas Bates
2017-11-01 2:06 ` David Miller
0 siblings, 2 replies; 4+ messages in thread
From: Brenda J. Butler @ 2017-10-31 18:27 UTC (permalink / raw)
To: davem
Cc: jhs, xiyou.wangcong, jiri, chrism, lucasb, aring, mrv, netdev,
Brenda J. Butler
Move the config customization into a site-local file
tdc_config_local.py, so that updates of the tdc test
software does not require hand-editing of the config.
This patch includes a template for the site-local
customization file.
In addition, this makes it easy to revert to a stock
tdc environment for testing the test framework and/or
the core tests.
Also it makes it harder for any custom config to be
submitted back to the kernel tdc.
Signed-off-by: Brenda J. Butler <bjb@mojatatu.com>
---
tools/testing/selftests/tc-testing/tdc_config.py | 14 +++++++++++++
.../tc-testing/tdc_config_local_template.py | 24 ++++++++++++++++++++++
2 files changed, 38 insertions(+)
create mode 100644 tools/testing/selftests/tc-testing/tdc_config_local_template.py
diff --git a/tools/testing/selftests/tc-testing/tdc_config.py b/tools/testing/selftests/tc-testing/tdc_config.py
index b6352515c1b5..596558445713 100644
--- a/tools/testing/selftests/tc-testing/tdc_config.py
+++ b/tools/testing/selftests/tc-testing/tdc_config.py
@@ -17,3 +17,17 @@ NAMES = {
# Name of the namespace to use
'NS': 'tcut'
}
+
+
+ENVIR = { }
+
+# put customizations in tdc_config_local.py
+try:
+ from tdc_config_local import *
+except ImportError as ie:
+ pass
+
+try:
+ NAMES.update(EXTRA_NAMES)
+except NameError as ne:
+ pass
diff --git a/tools/testing/selftests/tc-testing/tdc_config_local_template.py b/tools/testing/selftests/tc-testing/tdc_config_local_template.py
new file mode 100644
index 000000000000..24bad1633cac
--- /dev/null
+++ b/tools/testing/selftests/tc-testing/tdc_config_local_template.py
@@ -0,0 +1,24 @@
+"""
+tdc_config_local.py - tdc plugin-writer-specified values
+
+Copyright (C) 2017 bjb@mojatatu.com
+"""
+
+import os
+
+ENVIR = os.environ.copy()
+
+ENV_LD_LIBRARY_PATH = os.getenv('LD_LIBRARY_PATH', '')
+ENV_OTHER_LIB = os.getenv('OTHER_LIB', '')
+
+
+# example adding value to NAMES, without editing tdc_config.py
+EXTRA_NAMES = dict()
+EXTRA_NAMES['SOME_BIN'] = os.path.join(os.getenv('OTHER_BIN', ''), 'some_bin')
+
+
+# example adding values to ENVIR, without editing tdc_config.py
+ENVIR['VALGRIND_LIB'] = '/usr/lib/valgrind'
+ENVIR['VALGRIND_BIN'] = '/usr/bin/valgrind'
+ENVIR['VGDB_BIN'] = '/usr/bin/vgdb'
+
--
2.15.0.rc0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] tc-testing: split config file
2017-10-31 18:27 [PATCH net-next] tc-testing: split config file Brenda J. Butler
@ 2017-10-31 18:40 ` Lucas Bates
2017-11-01 2:06 ` David Miller
1 sibling, 0 replies; 4+ messages in thread
From: Lucas Bates @ 2017-10-31 18:40 UTC (permalink / raw)
To: Brenda J. Butler
Cc: davem, Jamal Hadi Salim, Cong Wang, Jiri Pirko, Chris Mi,
Alexander Aring, Roman Mashak, Linux Kernel Network Developers
On Tue, Oct 31, 2017 at 2:27 PM, Brenda J. Butler <bjb@mojatatu.com> wrote:
> Move the config customization into a site-local file
> tdc_config_local.py, so that updates of the tdc test
> software does not require hand-editing of the config.
> This patch includes a template for the site-local
> customization file.
>
> In addition, this makes it easy to revert to a stock
> tdc environment for testing the test framework and/or
> the core tests.
>
> Also it makes it harder for any custom config to be
> submitted back to the kernel tdc.
>
> Signed-off-by: Brenda J. Butler <bjb@mojatatu.com>
Acked-by: Lucas Bates <lucasb@mojatatu.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] tc-testing: split config file
2017-10-31 18:27 [PATCH net-next] tc-testing: split config file Brenda J. Butler
2017-10-31 18:40 ` Lucas Bates
@ 2017-11-01 2:06 ` David Miller
2017-11-01 2:41 ` Brenda Butler
1 sibling, 1 reply; 4+ messages in thread
From: David Miller @ 2017-11-01 2:06 UTC (permalink / raw)
To: bjb; +Cc: jhs, xiyou.wangcong, jiri, chrism, lucasb, aring, mrv, netdev
From: "Brenda J. Butler" <bjb@mojatatu.com>
Date: Tue, 31 Oct 2017 14:27:28 -0400
> Move the config customization into a site-local file
> tdc_config_local.py, so that updates of the tdc test
> software does not require hand-editing of the config.
> This patch includes a template for the site-local
> customization file.
>
> In addition, this makes it easy to revert to a stock
> tdc environment for testing the test framework and/or
> the core tests.
>
> Also it makes it harder for any custom config to be
> submitted back to the kernel tdc.
>
> Signed-off-by: Brenda J. Butler <bjb@mojatatu.com>
Please always remove trailing empty lines in files, GIT even warns
about this when one tries to apply the patch:
> @@ -17,3 +17,17 @@ NAMES = {
> # Name of the namespace to use
> 'NS': 'tcut'
> }
> +
...
> +# example adding values to ENVIR, without editing tdc_config.py
> +ENVIR['VALGRIND_LIB'] = '/usr/lib/valgrind'
> +ENVIR['VALGRIND_BIN'] = '/usr/bin/valgrind'
> +ENVIR['VGDB_BIN'] = '/usr/bin/vgdb'
> +
I fixed it up this time, but please be mindful of this in the future.
Thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] tc-testing: split config file
2017-11-01 2:06 ` David Miller
@ 2017-11-01 2:41 ` Brenda Butler
0 siblings, 0 replies; 4+ messages in thread
From: Brenda Butler @ 2017-11-01 2:41 UTC (permalink / raw)
To: David Miller
Cc: Jamal Hadi Salim, Cong Wang, Jiri Pirko, Chris Mi, Lucas Bates,
Alexander Aring, Roman Mashak, netdev
On Tue, Oct 31, 2017 at 10:06 PM, David Miller <davem@davemloft.net> wrote:
> From: "Brenda J. Butler" <bjb@mojatatu.com>
> Date: Tue, 31 Oct 2017 14:27:28 -0400
>
>> Move the config customization into a site-local file
>> tdc_config_local.py, so that updates of the tdc test
...
>> Signed-off-by: Brenda J. Butler <bjb@mojatatu.com>
>
> Please always remove trailing empty lines in files, GIT even warns
> about this when one tries to apply the patch:
>
>> @@ -17,3 +17,17 @@ NAMES = {
>> # Name of the namespace to use
>> 'NS': 'tcut'
>> }
>> +
> ...
>> +# example adding values to ENVIR, without editing tdc_config.py
>> +ENVIR['VALGRIND_LIB'] = '/usr/lib/valgrind'
>> +ENVIR['VALGRIND_BIN'] = '/usr/bin/valgrind'
>> +ENVIR['VGDB_BIN'] = '/usr/bin/vgdb'
>> +
Thank you, I will make sure to that.
bjb
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-11-01 2:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-31 18:27 [PATCH net-next] tc-testing: split config file Brenda J. Butler
2017-10-31 18:40 ` Lucas Bates
2017-11-01 2:06 ` David Miller
2017-11-01 2:41 ` Brenda Butler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).