tests: add QUBES_TEST_TEMPLATES env variable

Allow easily list templates to be tested, without enumerating all the
test classes. This is especially useful with nose2 runner which can't
use load tests protocol _and_ select subset of tests.
This commit is contained in:
Marek Marczykowski-Górecki 2018-10-03 22:40:38 +02:00
parent 35c66987ab
commit 7a607e3731
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -1143,6 +1143,9 @@ _templates = None
def list_templates():
'''Returns tuple of template names available in the system.'''
global _templates
if _templates is None:
if 'QUBES_TEST_TEMPLATES' in os.environ:
_templates = os.environ['QUBES_TEST_TEMPLATES'].split()
if _templates is None:
try:
app = qubes.Qubes()