---
doc/control.autoqa.template | 7 +++++--
tests/depcheck/control.autoqa | 7 +++++--
tests/initscripts/control.autoqa | 24 +++++++++++-------------
3 files changed, 21 insertions(+), 17 deletions(-)
diff --git a/doc/control.autoqa.template b/doc/control.autoqa.template
index 435ca40..178ac1d 100644
--- a/doc/control.autoqa.template
+++ b/doc/control.autoqa.template
@@ -40,5 +40,8 @@ if event in ['post-koji-build']:
# correct distribution must be present (like 'fc13')
if autoqa_args.has_key('nvrs'):
from autoqa.util import get_distro
- distro = get_distro(autoqa_args['nvrs'][0])
- labels.append(distro)
+ try:
+ distro = get_distro(autoqa_args['nvrs'][0])
+ labels.append(distro)
+ except ValueError: # no distro tag found
+ execute = False
diff --git a/tests/depcheck/control.autoqa b/tests/depcheck/control.autoqa
index bdd6041..c3236e4 100644
--- a/tests/depcheck/control.autoqa
+++ b/tests/depcheck/control.autoqa
@@ -9,5 +9,8 @@ if event in ['post-bodhi-update-batch']:
# must be present (like 'fc13') If proper label is not found the test will not execute
if autoqa_args.has_key('nvrs'):
from autoqa.util import get_distro
- distro = get_distro(autoqa_args['nvrs'][0])
- labels.append(distro)
+ try:
+ distro = get_distro(autoqa_args['nvrs'][0])
+ labels.append(distro)
+ except ValueError:
+ execute = False
diff --git a/tests/initscripts/control.autoqa b/tests/initscripts/control.autoqa
index 51ea825..b7ec70b 100644
--- a/tests/initscripts/control.autoqa
+++ b/tests/initscripts/control.autoqa
@@ -5,23 +5,11 @@
# virtual machines as a precaution
labels = ['virt']
-# because we install the package, the autotest label of the correct distribution
-# must be present (like 'fc13'). If proper label is not found the test will not execute
-if autoqa_args.has_key('nvrs'):
- from autoqa.util import get_distro
- try:
- distro = get_distro(autoqa_args['nvrs'][0])
- except IndexError:
- # FIXME - Optionally emit a warning that no %{dist} string was found?
- pass
- else:
- labels.append(distro)
-
# we want to run initscripts just for post-koji-build
if event in ['post-koji-build']:
execute = True
-# we also don't want to run this test for packages we currently don't have
+# we don't want to run this test for packages we currently don't have
# covered or for packages that contain no init scripts at all
# let's just look into tests/ directory if we have test available and decide
if autoqa_args.has_key('name'):
@@ -29,3 +17,13 @@ if autoqa_args.has_key('name'):
if autoqa_args['name'] not in os.listdir('tests'):
# not supported
execute = False
+
+# because we install the package, the autotest label of the correct distribution
+# must be present (like 'fc13'). If proper label is not found the test will not execute
+if autoqa_args.has_key('nvrs'):
+ from autoqa.util import get_distro
+ try:
+ distro = get_distro(autoqa_args['nvrs'][0])
+ labels.append(distro)
+ except ValueError:
+ execute = False
--
1.7.6