[PATCH] osmo-gsm-tester[master]: improve doc and usability of osmo-gsm-tester.py -t option

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Sat May 6 20:28:25 UTC 2017


Review at  https://gerrit.osmocom.org/2494

improve doc and usability of osmo-gsm-tester.py -t option

Allow exact matches by prepending a '='.
Properly document the -t option.

Change-Id: I61bed7e05f0c1f08cf3de72f62d9ba6609d44aee
---
M src/osmo-gsm-tester.py
1 file changed, 11 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/94/2494/1

diff --git a/src/osmo-gsm-tester.py b/src/osmo-gsm-tester.py
index 34e5fbd..fb4a8d7 100755
--- a/src/osmo-gsm-tester.py
+++ b/src/osmo-gsm-tester.py
@@ -84,7 +84,10 @@
             help='A series of suite-scenarios combinations as defined in the'
                  ' osmo-gsm-tester configuration')
     parser.add_argument('-t', '--test', dest='test', action='append',
-            help='Run only tests matching this name')
+            help='Run only tests matching this name. Any test name that'
+                 ' contains the given string is run. To get an exact patch,'
+                 ' prepend a "=" like "-t =my_exact_name". The ".py" suffix is'
+                 ' always optional.')
     parser.add_argument('-l', '--log-level', dest='log_level', choices=log.LEVEL_STRS.keys(),
             default=None,
             help='Set logging level for all categories (on stdout)')
@@ -130,9 +133,15 @@
     test_names = []
     for test_name in (args.test or []):
         found = False
+        if test_name.startswith('=') and not test_name.endswith('.py'):
+            test_name = test_name + '.py'
         for suite_scenario_str, suite_def, scenarios in suite_scenarios:
             for test in suite_def.tests:
-                if test_name in test.name():
+                if test_name.startswith('='):
+                    match = test_name[1:] == test.name()
+                else:
+                    match = test_name in test.name()
+                if match:
                     found = True
                     test_names.append(test.name())
         if not found:

-- 
To view, visit https://gerrit.osmocom.org/2494
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I61bed7e05f0c1f08cf3de72f62d9ba6609d44aee
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list