Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1603150

Summary: Potential bugs not caught because of randomized unit tests on mapping conversion between api model entities and engine business entities
Product: [oVirt] ovirt-engine Reporter: eraviv
Component: RestAPIAssignee: Ori Liel <oliel>
Status: CLOSED CURRENTRELEASE QA Contact: Lukas Svaty <lsvaty>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.2.2CC: bugs, mperina
Target Milestone: ovirt-4.2.7Keywords: CodeChange
Target Release: ---Flags: rule-engine: ovirt-4.2+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-4.2.7.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-02 14:31:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description eraviv 2018-07-19 10:15:42 UTC
Description of problem:

org.ovirt.engine.api.restapi.types.AbstractInvertibleMappingTest.testRoundtrip()
uses randomization to test conversion of api model entities to engine business entities. This may cause a hole in the modelling to be overlooked and if a specific value is not triggered by the test.

Version-Release number of selected component (if applicable):
ovirt-engine-4.3-master

How reproducible:
100%

Steps to Reproduce:
1. create new entry in org.ovirt.engine.api.model.BootProtocol
2. create corresponding entry in org.ovirt.engine.core.common.businessentities.network.Ipv6BootProtocol but NOT in org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol
3. compile and run the round trip test

Actual results:
the test fails sometimes and in different places

Expected results:
test should be deterministic - either always fail or always succeed

Additional info:

Comment 1 Ori Liel 2018-09-13 09:00:10 UTC
This bug is about a necessary code change in unit-test classes. The verification is that the unit-tests pass after the code change. I have verified this and it can also be seen in jenkins:

http://jenkins.ovirt.org/job/ovirt-engine_master_check-patch-fc28-x86_64/2136/ 
http://jenkins.ovirt.org/job/ovirt-engine_master_check-patch-el7-x86_64/42666/

Therefore I am changing the status of the bug to 'VERIFIED'

Comment 2 Ori Liel 2018-09-13 09:01:42 UTC
(changed back to post because patch was not submitted yet, pending review)

Comment 3 Ori Liel 2018-09-13 09:01:52 UTC
(changed back to post because patch was not submitted yet, pending review)

Comment 4 Ori Liel 2018-09-13 12:29:22 UTC
Note: by picking a single enum value for each value, some coverage is lost, since across time all enum values are tested. The tested code is trivial, making the loss quite insignificant. Tests for mapping of specific enums, covering all values, may be added by developers where felt necessary. This message will be added to the commit message of the patch as well

Comment 5 Lukas Svaty 2018-10-10 07:26:08 UTC
CodeChange

Comment 6 Sandro Bonazzola 2018-11-02 14:31:38 UTC
This bugzilla is included in oVirt 4.2.7 release, published on November 2nd 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.7 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.