Skip to content

Commit 9cb92e8

Browse files
author
Balazs Gibizer
committed
[func test] refactor interface attach with qos
To make the existing negative detach test more generic the logic is changed from increasing the resource request of the port over the resource inventory to decrease the resource inventory below the port request. This is needed as the way to increasing the port request will be different when the extended resource request extension is enabled. Change-Id: Iec9d3bb4fef7b6b18a13517872f46afcce02520c blueprint: qos-minimum-guaranteed-packet-rate
1 parent e812113 commit 9cb92e8

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

nova/tests/functional/test_servers_resource_request.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,11 +1017,16 @@ def test_interface_attach_with_resource_request_no_candidates(self):
10171017
networks=[{'port': self.neutron.port_1['id']}])
10181018
self._wait_for_state_change(server, 'ACTIVE')
10191019

1020-
# attach an OVS port with too big resource request
1020+
# decrease the resource inventory so that the OVS port will not fit
1021+
self._set_provider_inventories(
1022+
self.ovs_bridge_rp_per_host[self.compute1_rp_uuid],
1023+
{"inventories": {
1024+
orc.NET_BW_IGR_KILOBIT_PER_SEC: {"total": 10},
1025+
orc.NET_BW_EGR_KILOBIT_PER_SEC: {"total": 10},
1026+
}})
1027+
1028+
# try to attach an OVS port with too big resource request
10211029
ovs_port = self.neutron.port_with_resource_request
1022-
resources = self.neutron._ports[
1023-
ovs_port['id']]['resource_request']['resources']
1024-
resources['NET_BW_IGR_KILOBIT_PER_SEC'] = 1000000
10251030

10261031
post = {
10271032
'interfaceAttachment': {
@@ -1033,6 +1038,9 @@ def test_interface_attach_with_resource_request_no_candidates(self):
10331038

10341039
self.assertEqual(400, ex.response.status_code)
10351040
self.assertIn('Failed to allocate additional resources', str(ex))
1041+
self.assertNotIn(
1042+
'Failed to retrieve allocation candidates from placement API',
1043+
self.stdlog.logger.output)
10361044

10371045
def test_interface_attach_with_resource_request_pci_claim_fails(self):
10381046
# boot a server with a single SRIOV port that has no resource request

0 commit comments

Comments
 (0)