Bug 12928

Summary: bitbake-selftest with network disabled doesn't work
Product: [Build System, Metadata & Runtime] BitBake Reporter: Richard Purdie <richard.purdie>
Component: bitbakeAssignee: Mark Hatle <mark.hatle>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Undecided CC: poky.bs.watcher, poky.watcher
Version: 2.6   
Target Milestone: 2.6 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Richard Purdie 2018-09-22 15:10:12 UTC
If I run:

BB_SKIP_NETTESTS=yes bitbake-selftest

I see:

Unset BB_SKIP_NETTESTS to run network tests
....................................................................................................................................................................................................................................ssss........sssssssssssssss.........s.....s.......................................................................E
Stdout:
Looking for collection core...
E
Stdout:
Looking for layerbranch openembedded-core...
....
======================================================================
ERROR: test_find_collection (layerindexlib.tests.restapi.LayerIndexWebRestApiTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/media/build1/poky/bitbake/lib/layerindexlib/tests/restapi.py", line 150, in test_find_collection
    _check(collection, result)
  File "/media/build1/poky/bitbake/lib/layerindexlib/tests/restapi.py", line 136, in _check
    result = self.layerindex.find_collection(collection)
AttributeError: 'LayerIndexWebRestApiTest' object has no attribute 'layerindex'

Stdout:
Looking for collection core...

======================================================================
ERROR: test_find_layerbranch (layerindexlib.tests.restapi.LayerIndexWebRestApiTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/media/build1/poky/bitbake/lib/layerindexlib/tests/restapi.py", line 173, in test_find_layerbranch
    _check(collection, result)
  File "/media/build1/poky/bitbake/lib/layerindexlib/tests/restapi.py", line 156, in _check
    for index in self.layerindex.indexes:
AttributeError: 'LayerIndexWebRestApiTest' object has no attribute 'layerindex'

Stdout:
Looking for layerbranch openembedded-core...

----------------------------------------------------------------------
Ran 348 tests in 20.443s

whereas bitbake-selftest with the network tests enabled works just fine. We should fix this. I suspect its a bug Mark introduced with the new tests for the layerindex.
Comment 1 Mark Hatle 2018-09-25 15:09:24 UTC
patch send to bitbake-devel list for review.

changes also available at bitbake-contrib  mgh/12928 branch