testimage: Fix SDK extraction error handling

Currently if the SDK fails to extract, no error is shown and the test is marked
as passed! Clearly this is incorrect, fix it to correctly raise an error.

(From OE-Core rev: fb2235a21e45fa1a47c3b7a9a6a72c515ef10dd1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2015-09-11 13:24:50 +01:00
parent 06cde90f9f
commit 6a71f66173

View File

@@ -375,7 +375,10 @@ def testsdk_main(d):
sdktestdir = d.expand("${WORKDIR}/testimage-sdk/")
bb.utils.remove(sdktestdir, True)
bb.utils.mkdirhier(sdktestdir)
subprocess.call("cd %s; %s <<EOF\n./tc\nY\nEOF" % (sdktestdir, tcname), shell=True)
try:
subprocess.check_output("cd %s; %s <<EOF\n./tc\nY\nEOF" % (sdktestdir, tcname), shell=True)
except subprocess.CalledProcessError as e:
bb.fatal("Couldn't install the SDK:\n%s" % e.output)
try:
targets = glob.glob(d.expand(sdktestdir + "/tc/environment-setup-*"))