Remove skip exception from virtual interfaces test

Currently, test_list_virtual_interfaces in the virtual interfaces
rbac test file throws a skip exception in the event that a BadRequest
is thrown -- which happens if neutron is enabled. This is because
listing virtual interfaces is only available for nova-network, in nova.

However, skipping the test is not necessary, because policy enforcement
is always performed [0]: the API always performs policy enforcement
first followed by everything else, so a 403 is always thrown before a 400.

So, this patch gets rid of the unnecessary raising of skipException.
It also adds a assertRaisesRegexp with the expected error message:
"Listing virtual interfaces is not supported by this cloud" and
expected BadRequest error. By checking for a specific regex (error
message), there is certainty that the expected BadRequest is indeed
thrown; if any other BadRequest is thrown, an AssertionError will be
raised.

In short: this patch removes the skipException because policy
enforcement is always performed and ensures that the correct
BadRequest is thrown.

[0] https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/virtual_interfaces.py

Change-Id: Ia5bd4feb2708095bbab9eb2a377f336da84103fc
1 file changed