mirror of
https://git.yoctoproject.org/poky
synced 2026-09-24 22:36:21 +02:00
oeqa/selftest/image_tyypedep: Avoid undefined variable failure
If something goes wrong with the test, dep can be undefined. Avoid a traceback for this and handle it more gracefully. (From OE-Core rev: 0b74cb42aefe5c1b812fd155784e4c6581e26ce2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -29,11 +29,14 @@ inherit image
|
|||||||
# like CONVERSION_DEPENDS_bz2="somedep"
|
# like CONVERSION_DEPENDS_bz2="somedep"
|
||||||
result = bitbake('-e emptytest')
|
result = bitbake('-e emptytest')
|
||||||
|
|
||||||
|
dep = None
|
||||||
for line in result.output.split('\n'):
|
for line in result.output.split('\n'):
|
||||||
if line.startswith('CONVERSION_DEPENDS_bz2'):
|
if line.startswith('CONVERSION_DEPENDS_bz2'):
|
||||||
dep = line.split('=')[1].strip('"')
|
dep = line.split('=')[1].strip('"')
|
||||||
break
|
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
|
# Now get the dependency task list and check for the expected task
|
||||||
# dependency
|
# dependency
|
||||||
bitbake('-g emptytest')
|
bitbake('-g emptytest')
|
||||||
|
|||||||
Reference in New Issue
Block a user