Comment 0 for bug 1860030

Revision history for this message
Thomas Gao (tgao) wrote :

Brief Description
-----------------
Several tests in sysinv/tests/api/test_interface.py fail to verify the error raised when `expect_errors=True` is set.

For example, for test_invalid_sriov_numvfs, the expected error is "Value for number of SR-IOV VFs must be > 0," while the actual error is "Unable to provision pci-sriov interface without configured mgmt interface." Since the only assertion in place is `assertEqual(http_client.BAD_REQUEST, response.status_int`, there is no mechanism to verify whether the appropriate type of error has been raised, the test passed as a false negative.

Those false negative tests include:

- test_invalid_sriov_numvfs
- test_invalid_sriov_totalvfs_zero
- test_invalid_sriov_exceeded_totalvfs
- test_invalid_driver_for_sriov

Severity
--------
Minor: System/Feature is usable with minor issue

Steps to Reproduce
------------------

In the development repo:

> cd cgcs-root/stx/config/sysinv/sysinv/sysinv/sysinv/tests/api
> tox -e py27 test_invalid_sriov_numvfs

Expected Behavior
------------------
Test should fail when the function doesn't start with `self._create_ethernet('mgmt', constants.NETWORK_TYPE_MGMT)`

Actual Behavior
----------------
Test succeeds when the function doesn't start with `self._create_ethernet('mgmt', constants.NETWORK_TYPE_MGMT)`

Reproducibility
---------------
100% Reproducible

System Configuration
--------------------
Any machine that's set up for development.

Branch/Pull Time/Commit
-----------------------
master; 1/16/2020; 737b98c4562c6adf269be9f367d0fd21c09da65f

Last Pass
---------
new test scenario

Timestamp/Logs
--------------
Attach the logs for debugging (use attachments in Launchpad or for large collect files use: https://files.starlingx.kube.cengn.ca/)
Provide a snippet of logs here and the timestamp when issue was seen.
Please indicate the unique identifier in the logs to highlight the problem

Test Activity
-------------
Feature Testing