Bug 1516780 - modify exit to graceful error on test 004_basic_sanity.verify_add_vm_template
Summary: modify exit to graceful error on test 004_basic_sanity.verify_add_vm_template
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-system-tests
Classification: Community
Component: General
Version: 2.0
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: ---
Assignee: Yaniv Kaul
QA Contact: Lukas Svaty
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-23 11:24 UTC by Dafna Ron
Modified: 2019-10-24 12:35 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2019-10-24 12:35:49 UTC
oVirt Team: External
Embargoed:


Attachments (Terms of Use)

Description Dafna Ron 2017-11-23 11:24:27 UTC
failure in OST exits with following error:
scenarios/004_basic_sanity.py", line 500, in <lambda>\n    lambda: api.vms.get(VM1_NAME).status.state == \'down\',\nAttributeError: \'NoneType\' object has no attribute \'status\'\n--------------------- >> end captured logging << ---------------------'


This is a little confusing as to the reason of failure and it would be helpful in future debug if the tests exists with graceful error. 


Further info from ykaul on ovirt list: 


    This is a test error - code like this is always wrong:

        api.vms.get(VM1_NAME).status.state == something

    In this case, api.vms.get() returned None. The test code
    should handle None and fail with meaningfull error, or maybe
    retry the call.


It doesn't matter - if api.vms.get(VM1_NAME) return None, we'll fail the test. So we can add an assert here, but still fail in exactly the same manner. 
Gracefully with 'VM1_NAME was not found' ? Perhaps.

Comment 1 Yaniv Kaul 2017-11-23 11:25:54 UTC
Not sure why it's assigned to me, but I can take a look at this.

Comment 2 Yaniv Kaul 2017-11-23 12:41:30 UTC
Hopefully looks better with https://gerrit.ovirt.org/84572 .
I assume there are many other places in the code we'll need to 'harden' for such issues.


Note You need to log in before you can comment on or make changes to this bug.