diff options
author | Max <msuraev@sysmocom.de> | 2016-03-30 14:58:16 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2016-03-31 11:59:35 +0200 |
commit | d401cc13aefeea45fd2514466998dd62e6c5fabe (patch) | |
tree | 24c54996487460b13fdd9c70bc731feeb9b36cb5 | |
parent | 32d0fd88727c8038466afdea748862d4c8eac1d4 (diff) |
Add optional ignore_configs attribute
This attribute in osmoappdesc.py allows to ignore certain configs while
running vty tests. It's handy for hardware-specific or otherwise special
configuration examples.
-rw-r--r-- | osmopy/osmotestconfig.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/osmopy/osmotestconfig.py b/osmopy/osmotestconfig.py index ce47cf3..808048d 100644 --- a/osmopy/osmotestconfig.py +++ b/osmopy/osmotestconfig.py @@ -139,11 +139,11 @@ def remove_tmpdir(tmpdir): os.rmdir(tmpdir) -def check_configs_tested(basedir, app_configs): +def check_configs_tested(basedir, app_configs, ignore_configs): configs = [] for root, dirs, files in os.walk(basedir): for f in files: - if f.endswith(".cfg"): + if f.endswith(".cfg") and f not in ignore_configs: configs.append(os.path.join(root, f)) for config in configs: found = False @@ -155,8 +155,8 @@ def check_configs_tested(basedir, app_configs): def test_all_apps(apps, app_configs, tmpdir="writtenconfig", verbose=True, - confpath=".", rmtmp=False): - check_configs_tested("doc/examples/", app_configs) + confpath=".", rmtmp=False, ignore_configs=[]): + check_configs_tested("doc/examples/", app_configs, ignore_configs) errors = 0 for app in apps: if not app_exists(app): @@ -202,10 +202,11 @@ if __name__ == '__main__': apps = osmoappdesc.apps configs = osmoappdesc.app_configs + ignores = getattr(osmoappdesc, 'ignore_configs', []) if args.e1nitb: configs['nitb'].extend(osmoappdesc.nitb_e1_configs) os.chdir(workdir) - sys.exit(test_all_apps(apps, configs, confpath=confpath, - verbose=args.verbose)) + sys.exit(test_all_apps(apps, configs, ignore_configs=ignores, + confpath=confpath, verbose=args.verbose)) |