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.orgNeels Hofmeyr has submitted this change and it was merged.
Change subject: improve doc and usability of osmo-gsm-tester.py -t option
......................................................................
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(-)
Approvals:
  Pau Espin Pedrol: Looks good to me, approved
  Jenkins Builder: Verified
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: merged
Gerrit-Change-Id: I61bed7e05f0c1f08cf3de72f62d9ba6609d44aee
Gerrit-PatchSet: 3
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>