Bug 1760812

Summary: imgbased/src/imgbased/local.py fails unit testing with nosetests-3
Product: [oVirt] imgbased Reporter: Sandro Bonazzola <sbonazzo>
Component: GeneralAssignee: Yuval Turgeman <yturgema>
Status: CLOSED CURRENTRELEASE QA Contact: Sandro Bonazzola <sbonazzo>
Severity: high Docs Contact:
Priority: urgent    
Version: ---CC: bugs, cshao, lsvaty, mavital, nlevy, peyu, qiyuan, sbonazzo, weiwang, yaniwang, yturgema
Target Milestone: ovirt-4.4.0Keywords: BuildBlocker
Target Release: 1.2.6Flags: sbonazzo: ovirt-4.4?
cshao: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: imgbased-1.2.6 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-20 20:03:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Node RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1696701    

Description Sandro Bonazzola 2019-10-11 11:47:59 UTC
[2019-10-11T11:20:18.899Z] ======================================================================

[2019-10-11T11:20:18.899Z] FAIL: Doctest: imgbased.local.Configuration.sections

[2019-10-11T11:20:18.899Z] ----------------------------------------------------------------------

[2019-10-11T11:20:18.899Z] Traceback (most recent call last):

[2019-10-11T11:20:18.899Z]   File "/usr/lib64/python3.6/doctest.py", line 2199, in runTest

[2019-10-11T11:20:18.899Z]     raise self.failureException(self.format_failure(new.getvalue()))

[2019-10-11T11:20:18.899Z] AssertionError: Failed doctest test for imgbased.local.Configuration.sections

[2019-10-11T11:20:18.899Z]   File "/home/jenkins/workspace/imgbased_standard-check-patch/imgbased/src/imgbased/local.py", line 151, in sections

[2019-10-11T11:20:18.899Z] 

[2019-10-11T11:20:18.899Z] ----------------------------------------------------------------------

[2019-10-11T11:20:18.899Z] File "/home/jenkins/workspace/imgbased_standard-check-patch/imgbased/src/imgbased/local.py", line 170, in imgbased.local.Configuration.sections

[2019-10-11T11:20:18.899Z] Failed example:

[2019-10-11T11:20:18.899Z]     list(rs.sections())

[2019-10-11T11:20:18.899Z] Exception raised:

[2019-10-11T11:20:18.899Z]     Traceback (most recent call last):

[2019-10-11T11:20:18.899Z]       File "/usr/lib64/python3.6/doctest.py", line 1330, in __run

[2019-10-11T11:20:18.899Z]         compileflags, 1), test.globs)

[2019-10-11T11:20:18.899Z]       File "<doctest imgbased.local.Configuration.sections[5]>", line 1, in <module>

[2019-10-11T11:20:18.899Z]         list(rs.sections())

[2019-10-11T11:20:18.899Z]       File "/home/jenkins/workspace/imgbased_standard-check-patch/imgbased/src/imgbased/local.py", line 202, in sections

[2019-10-11T11:20:18.899Z]         p = self._parser()

[2019-10-11T11:20:18.899Z]       File "/home/jenkins/workspace/imgbased_standard-check-patch/imgbased/src/imgbased/local.py", line 122, in _parser

[2019-10-11T11:20:18.899Z]         p.readfp(BytesIO(self.cfgstr))

[2019-10-11T11:20:18.899Z]     TypeError: a bytes-like object is required, not 'str'

[2019-10-11T11:20:18.899Z] ----------------------------------------------------------------------

[2019-10-11T11:20:18.899Z] File "/home/jenkins/workspace/imgbased_standard-check-patch/imgbased/src/imgbased/local.py", line 173, in imgbased.local.Configuration.sections

[2019-10-11T11:20:18.899Z] Failed example:

[2019-10-11T11:20:18.899Z]     list(rs.sections("core"))

[2019-10-11T11:20:18.899Z] Exception raised:

[2019-10-11T11:20:18.899Z]     Traceback (most recent call last):

[2019-10-11T11:20:18.899Z]       File "/usr/lib64/python3.6/doctest.py", line 1330, in __run

[2019-10-11T11:20:18.899Z]         compileflags, 1), test.globs)

[2019-10-11T11:20:18.899Z]       File "<doctest imgbased.local.Configuration.sections[6]>", line 1, in <module>

[2019-10-11T11:20:18.899Z]         list(rs.sections("core"))

[2019-10-11T11:20:18.899Z]       File "/home/jenkins/workspace/imgbased_standard-check-patch/imgbased/src/imgbased/local.py", line 202, in sections

[2019-10-11T11:20:18.899Z]         p = self._parser()

[2019-10-11T11:20:18.899Z]       File "/home/jenkins/workspace/imgbased_standard-check-patch/imgbased/src/imgbased/local.py", line 122, in _parser

[2019-10-11T11:20:18.899Z]         p.readfp(BytesIO(self.cfgstr))

[2019-10-11T11:20:18.899Z]     TypeError: a bytes-like object is required, not 'str'

[2019-10-11T11:20:18.899Z] ----------------------------------------------------------------------

[2019-10-11T11:20:18.899Z] File "/home/jenkins/workspace/imgbased_standard-check-patch/imgbased/src/imgbased/local.py", line 176, in imgbased.local.Configuration.sections

[2019-10-11T11:20:18.899Z] Failed example:

[2019-10-11T11:20:18.899Z]     list(rs.sections(Configuration.CoreSection))

[2019-10-11T11:20:18.899Z] Exception raised:

[2019-10-11T11:20:18.899Z]     Traceback (most recent call last):

[2019-10-11T11:20:18.899Z]       File "/usr/lib64/python3.6/doctest.py", line 1330, in __run

[2019-10-11T11:20:18.899Z]         compileflags, 1), test.globs)

[2019-10-11T11:20:18.899Z]       File "<doctest imgbased.local.Configuration.sections[7]>", line 1, in <module>

[2019-10-11T11:20:18.899Z]         list(rs.sections(Configuration.CoreSection))

[2019-10-11T11:20:18.899Z]       File "/home/jenkins/workspace/imgbased_standard-check-patch/imgbased/src/imgbased/local.py", line 202, in sections

[2019-10-11T11:20:18.899Z]         p = self._parser()

[2019-10-11T11:20:18.899Z]       File "/home/jenkins/workspace/imgbased_standard-check-patch/imgbased/src/imgbased/local.py", line 122, in _parser

[2019-10-11T11:20:18.899Z]         p.readfp(BytesIO(self.cfgstr))

[2019-10-11T11:20:18.899Z]     TypeError: a bytes-like object is required, not 'str'

[2019-10-11T11:20:18.899Z] ----------------------------------------------------------------------

[2019-10-11T11:20:18.899Z] File "/home/jenkins/workspace/imgbased_standard-check-patch/imgbased/src/imgbased/local.py", line 179, in imgbased.local.Configuration.sections

[2019-10-11T11:20:18.899Z] Failed example:

[2019-10-11T11:20:18.899Z]     core = rs.section(Configuration.CoreSection)

[2019-10-11T11:20:18.899Z] Exception raised:

[2019-10-11T11:20:18.899Z]     Traceback (most recent call last):

[2019-10-11T11:20:18.899Z]       File "/usr/lib64/python3.6/doctest.py", line 1330, in __run

[2019-10-11T11:20:18.899Z]         compileflags, 1), test.globs)

[2019-10-11T11:20:18.899Z]       File "<doctest imgbased.local.Configuration.sections[8]>", line 1, in <module>

[2019-10-11T11:20:18.899Z]         core = rs.section(Configuration.CoreSection)

[2019-10-11T11:20:18.899Z]       File "/home/jenkins/workspace/imgbased_standard-check-patch/imgbased/src/imgbased/local.py", line 137, in section

[2019-10-11T11:20:18.899Z]         sections = [s for s in self.sections(filter_type)

[2019-10-11T11:20:18.899Z]       File "/home/jenkins/workspace/imgbased_standard-check-patch/imgbased/src/imgbased/local.py", line 137, in <listcomp>

[2019-10-11T11:20:18.899Z]         sections = [s for s in self.sections(filter_type)

[2019-10-11T11:20:18.899Z]       File "/home/jenkins/workspace/imgbased_standard-check-patch/imgbased/src/imgbased/local.py", line 202, in sections

[2019-10-11T11:20:18.899Z]         p = self._parser()

[2019-10-11T11:20:18.899Z]       File "/home/jenkins/workspace/imgbased_standard-check-patch/imgbased/src/imgbased/local.py", line 122, in _parser

[2019-10-11T11:20:18.899Z]         p.readfp(BytesIO(self.cfgstr))

[2019-10-11T11:20:18.899Z]     TypeError: a bytes-like object is required, not 'str'

[2019-10-11T11:20:18.899Z] ----------------------------------------------------------------------

[2019-10-11T11:20:18.899Z] File "/home/jenkins/workspace/imgbased_standard-check-patch/imgbased/src/imgbased/local.py", line 180, in imgbased.local.Configuration.sections

[2019-10-11T11:20:18.899Z] Failed example:

[2019-10-11T11:20:18.899Z]     core

[2019-10-11T11:20:18.899Z] Exception raised:

[2019-10-11T11:20:18.899Z]     Traceback (most recent call last):

[2019-10-11T11:20:18.899Z]       File "/usr/lib64/python3.6/doctest.py", line 1330, in __run

[2019-10-11T11:20:18.899Z]         compileflags, 1), test.globs)

[2019-10-11T11:20:18.899Z]       File "<doctest imgbased.local.Configuration.sections[9]>", line 1, in <module>

[2019-10-11T11:20:18.899Z]         core

[2019-10-11T11:20:18.899Z]     NameError: name 'core' is not defined

[2019-10-11T11:20:18.899Z] ----------------------------------------------------------------------

[2019-10-11T11:20:18.899Z] File "/home/jenkins/workspace/imgbased_standard-check-patch/imgbased/src/imgbased/local.py", line 182, in imgbased.local.Configuration.sections

[2019-10-11T11:20:18.899Z] Failed example:

[2019-10-11T11:20:18.899Z]     core.debug = 11

[2019-10-11T11:20:18.899Z] Exception raised:

[2019-10-11T11:20:18.899Z]     Traceback (most recent call last):

[2019-10-11T11:20:18.899Z]       File "/usr/lib64/python3.6/doctest.py", line 1330, in __run

[2019-10-11T11:20:18.899Z]         compileflags, 1), test.globs)

[2019-10-11T11:20:18.899Z]       File "<doctest imgbased.local.Configuration.sections[10]>", line 1, in <module>

[2019-10-11T11:20:18.899Z]         core.debug = 11

[2019-10-11T11:20:18.900Z]     NameError: name 'core' is not defined

[2019-10-11T11:20:18.900Z] ----------------------------------------------------------------------

[2019-10-11T11:20:18.900Z] File "/home/jenkins/workspace/imgbased_standard-check-patch/imgbased/src/imgbased/local.py", line 183, in imgbased.local.Configuration.sections

[2019-10-11T11:20:18.900Z] Failed example:

[2019-10-11T11:20:18.900Z]     rs.save(core)

[2019-10-11T11:20:18.900Z] Exception raised:

[2019-10-11T11:20:18.900Z]     Traceback (most recent call last):

[2019-10-11T11:20:18.900Z]       File "/usr/lib64/python3.6/doctest.py", line 1330, in __run

[2019-10-11T11:20:18.900Z]         compileflags, 1), test.globs)

[2019-10-11T11:20:18.900Z]       File "<doctest imgbased.local.Configuration.sections[11]>", line 1, in <module>

[2019-10-11T11:20:18.900Z]         rs.save(core)

[2019-10-11T11:20:18.900Z]     NameError: name 'core' is not defined

[2019-10-11T11:20:18.900Z] ----------------------------------------------------------------------

[2019-10-11T11:20:18.900Z] File "/home/jenkins/workspace/imgbased_standard-check-patch/imgbased/src/imgbased/local.py", line 190, in imgbased.local.Configuration.sections

[2019-10-11T11:20:18.900Z] Failed example:

[2019-10-11T11:20:18.900Z]     core.experimental = True

[2019-10-11T11:20:18.900Z] Exception raised:

[2019-10-11T11:20:18.900Z]     Traceback (most recent call last):

[2019-10-11T11:20:18.900Z]       File "/usr/lib64/python3.6/doctest.py", line 1330, in __run

[2019-10-11T11:20:18.900Z]         compileflags, 1), test.globs)

[2019-10-11T11:20:18.900Z]       File "<doctest imgbased.local.Configuration.sections[12]>", line 1, in <module>

[2019-10-11T11:20:18.900Z]         core.experimental = True

[2019-10-11T11:20:18.900Z]     NameError: name 'core' is not defined

[2019-10-11T11:20:18.900Z] ----------------------------------------------------------------------

[2019-10-11T11:20:18.900Z] File "/home/jenkins/workspace/imgbased_standard-check-patch/imgbased/src/imgbased/local.py", line 191, in imgbased.local.Configuration.sections

[2019-10-11T11:20:18.900Z] Failed example:

[2019-10-11T11:20:18.900Z]     rs.save(core)

[2019-10-11T11:20:18.900Z] Exception raised:

[2019-10-11T11:20:18.900Z]     Traceback (most recent call last):

[2019-10-11T11:20:18.900Z]       File "/usr/lib64/python3.6/doctest.py", line 1330, in __run

[2019-10-11T11:20:18.900Z]         compileflags, 1), test.globs)

[2019-10-11T11:20:18.900Z]       File "<doctest imgbased.local.Configuration.sections[13]>", line 1, in <module>

[2019-10-11T11:20:18.900Z]         rs.save(core)

[2019-10-11T11:20:18.900Z]     NameError: name 'core' is not defined

[2019-10-11T11:20:18.900Z] ----------------------------------------------------------------------

[2019-10-11T11:20:18.900Z] File "/home/jenkins/workspace/imgbased_standard-check-patch/imgbased/src/imgbased/local.py", line 198, in imgbased.local.Configuration.sections

[2019-10-11T11:20:18.900Z] Failed example:

[2019-10-11T11:20:18.900Z]     rs.remove(rs.section("core"))

[2019-10-11T11:20:18.900Z] Exception raised:

[2019-10-11T11:20:18.900Z]     Traceback (most recent call last):

[2019-10-11T11:20:18.900Z]       File "/usr/lib64/python3.6/doctest.py", line 1330, in __run

[2019-10-11T11:20:18.900Z]         compileflags, 1), test.globs)

[2019-10-11T11:20:18.900Z]       File "<doctest imgbased.local.Configuration.sections[14]>", line 1, in <module>

[2019-10-11T11:20:18.900Z]         rs.remove(rs.section("core"))

[2019-10-11T11:20:18.900Z]       File "/home/jenkins/workspace/imgbased_standard-check-patch/imgbased/src/imgbased/local.py", line 137, in section

[2019-10-11T11:20:18.900Z]         sections = [s for s in self.sections(filter_type)

[2019-10-11T11:20:18.900Z]       File "/home/jenkins/workspace/imgbased_standard-check-patch/imgbased/src/imgbased/local.py", line 137, in <listcomp>

[2019-10-11T11:20:18.900Z]         sections = [s for s in self.sections(filter_type)

[2019-10-11T11:20:18.900Z]       File "/home/jenkins/workspace/imgbased_standard-check-patch/imgbased/src/imgbased/local.py", line 202, in sections

[2019-10-11T11:20:18.900Z]         p = self._parser()

[2019-10-11T11:20:18.900Z]       File "/home/jenkins/workspace/imgbased_standard-check-patch/imgbased/src/imgbased/local.py", line 122, in _parser

[2019-10-11T11:20:18.900Z]         p.readfp(BytesIO(self.cfgstr))

[2019-10-11T11:20:18.900Z]     TypeError: a bytes-like object is required, not 'str'

[2019-10-11T11:20:18.900Z] 

[2019-10-11T11:20:18.900Z] -------------------- >> begin captured logging << --------------------

[2019-10-11T11:20:18.900Z] imgbased: DEBUG: Using cfgstr

[2019-10-11T11:20:18.900Z] imgbased: DEBUG: Using cfgstr

[2019-10-11T11:20:18.900Z] imgbased: DEBUG: Using cfgstr

[2019-10-11T11:20:18.900Z] imgbased: DEBUG: Using cfgstr

[2019-10-11T11:20:18.900Z] imgbased: DEBUG: Using cfgstr

[2019-10-11T11:20:18.900Z] --------------------- >> end captured logging << ---------------------

Comment 1 Sandro Bonazzola 2020-05-20 20:03:30 UTC
This bugzilla is included in oVirt 4.4.0 release, published on May 20th 2020.

Since the problem described in this bug report should be
resolved in oVirt 4.4.0 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.