]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/selftest/image_tyypedep: Avoid undefined variable failure
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 11 Jul 2018 11:06:48 +0000 (11:06 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 13 Jul 2018 15:34:30 +0000 (16:34 +0100)
If something goes wrong with the test, dep can be undefined. Avoid a
traceback for this and handle it more gracefully.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/cases/image_typedep.py

index e6788853a362cf11ddeaefc21c5b4bf9aec15aa0..932c7f883da9a9809b5574d3541e0fab7f38e6df 100644 (file)
@@ -29,11 +29,14 @@ inherit image
         # like CONVERSION_DEPENDS_bz2="somedep"
         result = bitbake('-e emptytest')
 
+        dep = None
         for line in result.output.split('\n'):
             if line.startswith('CONVERSION_DEPENDS_bz2'):
                 dep = line.split('=')[1].strip('"')
                 break
 
+        self.assertIsNotNone(dep, "CONVERSION_DEPENDS_bz2 dependency not found in bitbake -e output")
+
         # Now get the dependency task list and check for the expected task
         # dependency
         bitbake('-g emptytest')