Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tc-testing: split config file

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>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Brenda J. Butler and committed by
David S. Miller
181d6610 a5a5efe9

+37
+14
tools/testing/selftests/tc-testing/tdc_config.py
··· 17 17 # Name of the namespace to use 18 18 'NS': 'tcut' 19 19 } 20 + 21 + 22 + ENVIR = { } 23 + 24 + # put customizations in tdc_config_local.py 25 + try: 26 + from tdc_config_local import * 27 + except ImportError as ie: 28 + pass 29 + 30 + try: 31 + NAMES.update(EXTRA_NAMES) 32 + except NameError as ne: 33 + pass
+23
tools/testing/selftests/tc-testing/tdc_config_local_template.py
··· 1 + """ 2 + tdc_config_local.py - tdc plugin-writer-specified values 3 + 4 + Copyright (C) 2017 bjb@mojatatu.com 5 + """ 6 + 7 + import os 8 + 9 + ENVIR = os.environ.copy() 10 + 11 + ENV_LD_LIBRARY_PATH = os.getenv('LD_LIBRARY_PATH', '') 12 + ENV_OTHER_LIB = os.getenv('OTHER_LIB', '') 13 + 14 + 15 + # example adding value to NAMES, without editing tdc_config.py 16 + EXTRA_NAMES = dict() 17 + EXTRA_NAMES['SOME_BIN'] = os.path.join(os.getenv('OTHER_BIN', ''), 'some_bin') 18 + 19 + 20 + # example adding values to ENVIR, without editing tdc_config.py 21 + ENVIR['VALGRIND_LIB'] = '/usr/lib/valgrind' 22 + ENVIR['VALGRIND_BIN'] = '/usr/bin/valgrind' 23 + ENVIR['VGDB_BIN'] = '/usr/bin/vgdb'