scripts/contrib/devtool-stress: skip incompatible recipes

If devtool returns exit code 4 then record the recipes as "skipped"
rather than "failed" - these are recipes we know cannot work (usually
because they don't provide any source).

(From OE-Core rev: 8fc109f1cb6eb437c12d2d11a6937de6f035e296)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Paul Eggleton 2016-07-11 11:07:57 +12:00 committed by Richard Purdie
parent 5c91537ab2
commit 89f8348dc5
1 changed files with 35 additions and 22 deletions

View File

@ -121,14 +121,18 @@ def stress_extract(args):
sys.stdout.write('Testing %s ' % (pn + ' ').ljust(40, '.'))
sys.stdout.flush()
failed = False
skipped = None
srctree = os.path.join(tmpdir, pn)
try:
bb.process.run('devtool extract %s %s' % (pn, srctree))
except bb.process.CmdError as exc:
failed = True
with open('stress_%s_extract.log' % pn, 'w') as f:
f.write(str(exc))
except bb.process.ExecutionError as exc:
if exc.exitcode == 4:
skipped = 'incompatible'
else:
failed = True
with open('stress_%s_extract.log' % pn, 'w') as f:
f.write(str(exc))
if os.path.exists(srctree):
shutil.rmtree(srctree)
@ -136,6 +140,8 @@ def stress_extract(args):
if failed:
print('failed')
failures += 1
elif skipped:
print('skipped (%s)' % skipped)
else:
print('ok')
except KeyboardInterrupt:
@ -162,29 +168,34 @@ def stress_modify(args):
sys.stdout.flush()
failed = False
reset = True
skipped = None
srctree = os.path.join(tmpdir, pn)
try:
bb.process.run('devtool modify -x %s %s' % (pn, srctree))
except bb.process.CmdError as exc:
with open('stress_%s_modify.log' % pn, 'w') as f:
f.write(str(exc))
failed = 'modify'
reset = False
if not failed:
try:
bb.process.run('bitbake -c install %s' % pn)
except bb.process.CmdError as exc:
with open('stress_%s_install.log' % pn, 'w') as f:
except bb.process.ExecutionError as exc:
if exc.exitcode == 4:
skipped = 'incompatible'
else:
with open('stress_%s_modify.log' % pn, 'w') as f:
f.write(str(exc))
failed = 'build'
if reset:
try:
bb.process.run('devtool reset %s' % pn)
except bb.process.CmdError as exc:
print('devtool reset failed: %s' % str(exc))
break
failed = 'modify'
reset = False
if not skipped:
if not failed:
try:
bb.process.run('bitbake -c install %s' % pn)
except bb.process.CmdError as exc:
with open('stress_%s_install.log' % pn, 'w') as f:
f.write(str(exc))
failed = 'build'
if reset:
try:
bb.process.run('devtool reset %s' % pn)
except bb.process.CmdError as exc:
print('devtool reset failed: %s' % str(exc))
break
if os.path.exists(srctree):
shutil.rmtree(srctree)
@ -192,6 +203,8 @@ def stress_modify(args):
if failed:
print('failed (%s)' % failed)
failures += 1
elif skipped:
print('skipped (%s)' % skipped)
else:
print('ok')
except KeyboardInterrupt: