]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
testimage: Fix SDK extraction error handling
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 11 Sep 2015 12:24:50 +0000 (13:24 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 12 Sep 2015 21:47:24 +0000 (22:47 +0100)
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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/testimage.bbclass

index 19a37cb037e4767ff39291baa33a2b703d749b09..d4263df3231ee54280d52caca48965165cfde475 100644 (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-*"))