Ensure list_with_limit tests pass

Currently the list_with_limit tests are passing by luck due to concurrent tests
running, since they require 3 resources to be present in order for the 'next'
marker to be included in the response. Well done to Ruby Loo for spotting this
in the deploy templates tests.

Change-Id: I67f6737c6bc1bdef22dac5a24c577a3d450233a6
This commit is contained in:
Mark Goddard 2019-03-01 16:01:11 +00:00
parent c34f9b7372
commit 1824c0f40e
3 changed files with 17 additions and 0 deletions

View File

@ -105,6 +105,9 @@ class TestPorts(base.BaseBaremetalTest):
@decorators.idempotent_id('324a910e-2f80-4258-9087-062b5ae06240')
def test_list_with_limit(self):
for i in range(2):
self.create_port(self.node['uuid'], data_utils.rand_mac_address())
_, body = self.client.list_ports(limit=3)
next_marker = body['ports'][-1]['uuid']

View File

@ -107,6 +107,12 @@ class TestVolumeConnector(base.BaseBaremetalTest):
@decorators.idempotent_id('1d0459ad-01c0-46db-b930-7301bc2a3c98')
def test_list_with_limit(self):
"""List volume connectors with limit."""
for i in range(2):
_, self.volume_connector = self.create_volume_connector(
self.node['uuid'], type='iqn',
connector_id=data_utils.rand_name('connector_id'),
extra=self.extra)
_, body = self.client.list_volume_connectors(limit=3)
next_marker = body['connectors'][-1]['uuid']

View File

@ -104,6 +104,14 @@ class TestVolumeTarget(base.BaseBaremetalTest):
@decorators.idempotent_id('9da25447-0370-4b33-9c1f-d4503f5950ae')
def test_list_with_limit(self):
"""List volume targets with limit."""
for i in range(2):
_, self.volume_target = self.create_volume_target(
self.node['uuid'],
volume_type=data_utils.rand_name('volume_type'),
volume_id=data_utils.rand_name('volume_id'),
boot_index=11 + i,
extra=self.extra)
_, body = self.client.list_volume_targets(limit=3)
next_marker = body['targets'][-1]['uuid']