Bug 11702 - oe-selftest fails if local.conf doesn't end with a newline
Summary: oe-selftest fails if local.conf doesn't end with a newline
Status: RESOLVED OBSOLETE
Alias: None
Product: Build Testing
Classification: QA/Testing
Component: general (show other bugs)
Version: 2.4
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 2.4 M4
Assignee: Leonardo Sandoval Gonzalez
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2017-06-22 10:48 UTC by Richard Purdie
Modified: 2017-08-29 17:16 UTC (History)
1 user (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Purdie 2017-06-22 10:48:04 UTC
If local.conf doesn't have a newline at the end, we get this error:

$ oe-selftest -r archiver.Archiver.test_archiver_allows_to_filter_on_recipe_name
2017-06-22 11:40:18,363 - oe-selftest - INFO - Adding layer libraries:
2017-06-22 11:40:18,363 - oe-selftest - INFO - 	/media/build1/poky/meta/lib
2017-06-22 11:40:18,364 - oe-selftest - INFO - 	/media/build1/poky/meta-yocto-bsp/lib
2017-06-22 11:40:18,364 - oe-selftest - INFO - 	/media/build1/poky/meta-selftest/lib
2017-06-22 11:40:18,364 - oe-selftest - INFO - Running bitbake -p
2017-06-22 11:40:23,385 - oe-selftest - INFO - 
2017-06-22 11:40:23,386 - oe-selftest - INFO - Running tests...
2017-06-22 11:40:23,498 - oe-selftest - INFO - ----------------------------------------------------------------------
2017-06-22 11:40:46,005 - oe-selftest - INFO -   test_archiver_allows_to_filter_on_recipe_name (archiver.Archiver) ... ERROR (22.506s)
2017-06-22 11:40:46,006 - oe-selftest - INFO - 
2017-06-22 11:40:46,006 - oe-selftest - INFO - ======================================================================
2017-06-22 11:40:46,006 - oe-selftest - INFO - ERROR [22.506s]: test_archiver_allows_to_filter_on_recipe_name (archiver.Archiver)
2017-06-22 11:40:46,006 - oe-selftest - INFO - ----------------------------------------------------------------------
2017-06-22 11:40:46,006 - oe-selftest - INFO - Traceback (most recent call last):
  File "/media/build1/poky/meta/lib/oeqa/core/decorator/__init__.py", line 32, in wrapped_f
    return func(*args, **kwargs)
  File "/media/build1/poky/meta/lib/oeqa/selftest/cases/archiver.py", line 33, in test_archiver_allows_to_filter_on_recipe_name
    src_path = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['TARGET_SYS'])
  File "/usr/lib/python3.5/posixpath.py", line 89, in join
    genericpath._check_arg_types('join', a, *p)
  File "/usr/lib/python3.5/genericpath.py", line 143, in _check_arg_types
    (funcname, s.__class__.__name__)) from None
TypeError: join() argument must be str or bytes, not 'NoneType'
2017-06-22 11:40:46,007 - oe-selftest - INFO - ----------------------------------------------------------------------
2017-06-22 11:40:46,007 - oe-selftest - INFO - Ran 1 test in 22.507s
2017-06-22 11:40:46,007 - oe-selftest - INFO - 
2017-06-22 11:40:46,007 - oe-selftest - INFO - FAILED (errors=1)
2017-06-22 11:40:46,007 - oe-selftest - INFO - 
2017-06-22 11:40:46,007 - oe-selftest - INFO - Generating XML reports...
2017-06-22 11:40:46,011 - oe-selftest - INFO - RESULTS:
2017-06-22 11:40:46,011 - oe-selftest - INFO - RESULTS - archiver.Archiver.test_archiver_allows_to_filter_on_recipe_name - Testcase 1345: ERROR
2017-06-22 11:40:46,011 - oe-selftest - INFO - SUMMARY:
2017-06-22 11:40:46,011 - oe-selftest - INFO - oe-selftest () - Ran 1 test in 22.626s
2017-06-22 11:40:46,011 - oe-selftest - INFO - oe-selftest - FAIL - Required tests failed

We can likely do better than this.
Comment 1 Aníbal Limón 2017-07-19 20:24:37 UTC
(In reply to comment #0)
> If local.conf doesn't have a newline at the end, we get this error:
> 
> $ oe-selftest -r
> archiver.Archiver.test_archiver_allows_to_filter_on_recipe_name
> 2017-06-22 11:40:18,363 - oe-selftest - INFO - Adding layer libraries:
> 2017-06-22 11:40:18,363 - oe-selftest - INFO - 	/media/build1/poky/meta/lib
> 2017-06-22 11:40:18,364 - oe-selftest - INFO - 
> /media/build1/poky/meta-yocto-bsp/lib
> 2017-06-22 11:40:18,364 - oe-selftest - INFO - 
> /media/build1/poky/meta-selftest/lib
> 2017-06-22 11:40:18,364 - oe-selftest - INFO - Running bitbake -p
> 2017-06-22 11:40:23,385 - oe-selftest - INFO - 
> 2017-06-22 11:40:23,386 - oe-selftest - INFO - Running tests...
> 2017-06-22 11:40:23,498 - oe-selftest - INFO -
> ----------------------------------------------------------------------
> 2017-06-22 11:40:46,005 - oe-selftest - INFO -  
> test_archiver_allows_to_filter_on_recipe_name (archiver.Archiver) ... ERROR
> (22.506s)
> 2017-06-22 11:40:46,006 - oe-selftest - INFO - 
> 2017-06-22 11:40:46,006 - oe-selftest - INFO -
> ======================================================================
> 2017-06-22 11:40:46,006 - oe-selftest - INFO - ERROR [22.506s]:
> test_archiver_allows_to_filter_on_recipe_name (archiver.Archiver)
> 2017-06-22 11:40:46,006 - oe-selftest - INFO -
> ----------------------------------------------------------------------
> 2017-06-22 11:40:46,006 - oe-selftest - INFO - Traceback (most recent call
> last):
>   File "/media/build1/poky/meta/lib/oeqa/core/decorator/__init__.py", line
> 32, in wrapped_f
>     return func(*args, **kwargs)
>   File "/media/build1/poky/meta/lib/oeqa/selftest/cases/archiver.py", line
> 33, in test_archiver_allows_to_filter_on_recipe_name
>     src_path = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['TARGET_SYS'])
>   File "/usr/lib/python3.5/posixpath.py", line 89, in join
>     genericpath._check_arg_types('join', a, *p)
>   File "/usr/lib/python3.5/genericpath.py", line 143, in _check_arg_types
>     (funcname, s.__class__.__name__)) from None
> TypeError: join() argument must be str or bytes, not 'NoneType'
> 2017-06-22 11:40:46,007 - oe-selftest - INFO -
> ----------------------------------------------------------------------
> 2017-06-22 11:40:46,007 - oe-selftest - INFO - Ran 1 test in 22.507s
> 2017-06-22 11:40:46,007 - oe-selftest - INFO - 
> 2017-06-22 11:40:46,007 - oe-selftest - INFO - FAILED (errors=1)
> 2017-06-22 11:40:46,007 - oe-selftest - INFO - 
> 2017-06-22 11:40:46,007 - oe-selftest - INFO - Generating XML reports...
> 2017-06-22 11:40:46,011 - oe-selftest - INFO - RESULTS:
> 2017-06-22 11:40:46,011 - oe-selftest - INFO - RESULTS -
> archiver.Archiver.test_archiver_allows_to_filter_on_recipe_name - Testcase
> 1345: ERROR
> 2017-06-22 11:40:46,011 - oe-selftest - INFO - SUMMARY:
> 2017-06-22 11:40:46,011 - oe-selftest - INFO - oe-selftest () - Ran 1 test
> in 22.626s
> 2017-06-22 11:40:46,011 - oe-selftest - INFO - oe-selftest - FAIL - Required
> tests failed
> 
> We can likely do better than this.

I can't reproduce this error, i deleted the 0x0a character with vim (:set noendofline binary) and then verified with hexdump -C.

And for me this test passes.

Anibal
Comment 2 Leonardo Sandoval Gonzalez 2017-08-29 17:16:48 UTC
The problem seems to be gone, even though I can't find the commit with fixed. Closing as obsolete.