From: Max msuraev@sysmocom.de
Ignore install leftovers. --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..766f495 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +osmopython.egg-info/
From: Max msuraev@sysmocom.de
--- README | 1 + 1 file changed, 1 insertion(+)
diff --git a/README b/README index c4b7830..b85f7c9 100644 --- a/README +++ b/README @@ -2,6 +2,7 @@ Building/installation: sudo python setup.py install If you prefer to have it cleanly removable, install checkinstall and run sudo checkinstall python setup.py install +Alternatively, just run 'pip install --user -e ./'
Use There are currently 3 scripts in this package:
From: Max msuraev@sysmocom.de
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. --- osmopy/osmotestconfig.py | 13 +++++++------ 1 file 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))
On Wed, Mar 30, 2016 at 02:58:16PM +0200, msuraev@sysmocom.de wrote:
From: Max msuraev@sysmocom.de
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.
osmopy/osmotestconfig.py | 13 +++++++------ 1 file 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
[...]
@@ -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))
would have been slightly more beautiful to put ignore_configs at the end like in the def above, and would have made for a slightly smaller diff, too... but whatever.
~Neels
From: Max msuraev@sysmocom.de
In addition to binary name it's now possible to provide extra command-line arguments in osmoappdesc.py for application under test. This change is fully optional and backward compatible. --- osmopy/osmotestconfig.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/osmopy/osmotestconfig.py b/osmopy/osmotestconfig.py index 808048d..b020d86 100644 --- a/osmopy/osmotestconfig.py +++ b/osmopy/osmotestconfig.py @@ -49,7 +49,7 @@ def test_config_atest(app_desc, config, run_test, verbose=True): proc = None ret = None try: - cmd = [app_desc[1], "-c", config] + cmd = app_desc[1].split(' ') + [ "-c", config] if verbose: print "Verifying %s, test %s" % (' '.join(cmd), run_test.__name__)
@@ -128,7 +128,7 @@ def verify_doc(vty):
# Skip testing the configurations of anything that hasn't been compiled def app_exists(app_desc): - cmd = app_desc[1] + cmd = app_desc[1].split(' ')[0] return os.path.exists(cmd)