1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 00:20:08 +00:00

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