Switch to use test_utils.call_until_true
test.call_until_true has been deprecated since Newton on Tempest side, and now Tempest provides test_utils.call_until_true as the stable library method. So this patch switches to use the stable method before removing old test.call_until_true on Tempest side. Change-Id: I30bc8a18aafb1822896e5b3b67b080e06c7e308f Needed-by: Ide11a7434a4714e5d2211af1803333535f557370
This commit is contained in:
parent
88937db141
commit
65c49f1876
|
@ -15,6 +15,7 @@
|
|||
|
||||
from oslo_log import log as logging
|
||||
from tempest import config
|
||||
from tempest.lib.common.utils import test_utils
|
||||
from tempest.lib import exceptions
|
||||
from tempest import test
|
||||
|
||||
|
@ -93,7 +94,7 @@ class TestAodhDriver(manager_congress.ScenarioPolicyBase):
|
|||
return False
|
||||
return True
|
||||
|
||||
if not test.call_until_true(func=_check_data_table_aodh_alarms,
|
||||
duration=100, sleep_for=5):
|
||||
if not test_utils.call_until_true(func=_check_data_table_aodh_alarms,
|
||||
duration=100, sleep_for=5):
|
||||
raise exceptions.TimeoutException("Data did not converge in time "
|
||||
"or failure in server")
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
from oslo_log import log as logging
|
||||
from tempest import config
|
||||
from tempest.lib.common.utils import test_utils
|
||||
from tempest.lib import exceptions
|
||||
from tempest import test
|
||||
|
||||
|
@ -71,7 +72,8 @@ class TestCeilometerDriver(manager_congress.ScenarioPolicyBase):
|
|||
return False
|
||||
return True
|
||||
|
||||
if not test.call_until_true(func=_check_data_table_ceilometer_meters,
|
||||
duration=100, sleep_for=5):
|
||||
if not test_utils.call_until_true(
|
||||
func=_check_data_table_ceilometer_meters,
|
||||
duration=100, sleep_for=5):
|
||||
raise exceptions.TimeoutException("Data did not converge in time "
|
||||
"or failure in server")
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
from oslo_log import log as logging
|
||||
from tempest import clients
|
||||
from tempest import config
|
||||
from tempest.lib.common.utils import test_utils
|
||||
from tempest.lib import exceptions
|
||||
from tempest import test
|
||||
|
||||
|
@ -99,7 +100,8 @@ class TestCinderDriver(manager_congress.ScenarioPolicyBase):
|
|||
# return False
|
||||
return True
|
||||
|
||||
if not test.call_until_true(func=_check_data_table_cinder_volumes,
|
||||
duration=100, sleep_for=5):
|
||||
if not test_utils.call_until_true(
|
||||
func=_check_data_table_cinder_volumes,
|
||||
duration=100, sleep_for=5):
|
||||
raise exceptions.TimeoutException("Data did not converge in time "
|
||||
"or failure in server")
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from tempest.lib.common.utils import test_utils
|
||||
from tempest.lib import exceptions
|
||||
from tempest import test
|
||||
|
||||
|
@ -71,8 +72,8 @@ class TestDoctorDriver(manager_congress.ScenarioPolicyBase):
|
|||
self.client.list_datasource_status(self.datasource_id)
|
||||
return True
|
||||
|
||||
if not test.call_until_true(func=_check_service,
|
||||
duration=60, sleep_for=1):
|
||||
if not test_utils.call_until_true(func=_check_service,
|
||||
duration=60, sleep_for=1):
|
||||
raise exceptions.TimeoutException("Doctor dataservice is not up")
|
||||
|
||||
self.client.update_datasource_row(self.datasource_id, 'events', rows)
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
from oslo_log import log as logging
|
||||
from tempest import clients
|
||||
from tempest import config
|
||||
from tempest.lib.common.utils import test_utils
|
||||
from tempest.lib import exceptions
|
||||
from tempest import test
|
||||
|
||||
|
@ -89,8 +90,9 @@ class TestGlanceV2Driver(manager_congress.ScenarioPolicyBase):
|
|||
return False
|
||||
return True
|
||||
|
||||
if not test.call_until_true(func=_check_data_table_glancev2_images,
|
||||
duration=100, sleep_for=4):
|
||||
if not test_utils.call_until_true(
|
||||
func=_check_data_table_glancev2_images,
|
||||
duration=100, sleep_for=4):
|
||||
raise exceptions.TimeoutException("Data did not converge in time "
|
||||
"or failure in server")
|
||||
|
||||
|
@ -119,7 +121,8 @@ class TestGlanceV2Driver(manager_congress.ScenarioPolicyBase):
|
|||
return False
|
||||
return True
|
||||
|
||||
if not test.call_until_true(func=_check_data_table_glance_images,
|
||||
duration=100, sleep_for=5):
|
||||
if not test_utils.call_until_true(
|
||||
func=_check_data_table_glance_images,
|
||||
duration=100, sleep_for=5):
|
||||
raise exceptions.TimeoutException("Data did not converge in time "
|
||||
"or failure in server")
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
from oslo_log import log as logging
|
||||
from tempest import clients
|
||||
from tempest import config
|
||||
from tempest.lib.common.utils import test_utils
|
||||
from tempest.lib import exceptions
|
||||
from tempest import test
|
||||
|
||||
|
@ -84,8 +85,9 @@ class TestKeystoneV2Driver(manager_congress.ScenarioPolicyBase):
|
|||
return False
|
||||
return True
|
||||
|
||||
if not test.call_until_true(func=_check_data_table_keystone_users,
|
||||
duration=100, sleep_for=4):
|
||||
if not test_utils.call_until_true(
|
||||
func=_check_data_table_keystone_users,
|
||||
duration=100, sleep_for=4):
|
||||
raise exceptions.TimeoutException("Data did not converge in time "
|
||||
"or failure in server")
|
||||
|
||||
|
@ -119,8 +121,9 @@ class TestKeystoneV2Driver(manager_congress.ScenarioPolicyBase):
|
|||
return False
|
||||
return True
|
||||
|
||||
if not test.call_until_true(func=_check_data_table_keystone_roles,
|
||||
duration=100, sleep_for=4):
|
||||
if not test_utils.call_until_true(
|
||||
func=_check_data_table_keystone_roles,
|
||||
duration=100, sleep_for=4):
|
||||
raise exceptions.TimeoutException("Data did not converge in time "
|
||||
"or failure in server")
|
||||
|
||||
|
@ -154,7 +157,8 @@ class TestKeystoneV2Driver(manager_congress.ScenarioPolicyBase):
|
|||
return False
|
||||
return True
|
||||
|
||||
if not test.call_until_true(func=_check_data_table_keystone_tenants,
|
||||
duration=100, sleep_for=5):
|
||||
if not test_utils.call_until_true(
|
||||
func=_check_data_table_keystone_tenants,
|
||||
duration=100, sleep_for=5):
|
||||
raise exceptions.TimeoutException("Data did not converge in time "
|
||||
"or failure in server")
|
||||
|
|
|
@ -17,6 +17,7 @@ import time
|
|||
from oslo_log import log as logging
|
||||
from tempest import clients
|
||||
from tempest import config
|
||||
from tempest.lib.common.utils import test_utils
|
||||
from tempest.lib import exceptions
|
||||
from tempest import test
|
||||
|
||||
|
@ -83,8 +84,8 @@ class TestNeutronV2Driver(manager_congress.ScenarioPolicyBase):
|
|||
return False
|
||||
return True
|
||||
|
||||
if not test.call_until_true(func=_check_data,
|
||||
duration=200, sleep_for=10):
|
||||
if not test_utils.call_until_true(func=_check_data,
|
||||
duration=200, sleep_for=10):
|
||||
raise exceptions.TimeoutException("Data did not converge in time "
|
||||
"or failure in server")
|
||||
|
||||
|
@ -160,8 +161,8 @@ class TestNeutronV2Driver(manager_congress.ScenarioPolicyBase):
|
|||
return False
|
||||
return True
|
||||
|
||||
if not test.call_until_true(func=_check_data,
|
||||
duration=200, sleep_for=10):
|
||||
if not test_utils.call_until_true(func=_check_data,
|
||||
duration=200, sleep_for=10):
|
||||
raise exceptions.TimeoutException("Data did not converge in time "
|
||||
"or failure in server")
|
||||
|
||||
|
@ -255,8 +256,8 @@ class TestNeutronV2Driver(manager_congress.ScenarioPolicyBase):
|
|||
return False
|
||||
return True
|
||||
|
||||
if not test.call_until_true(func=_check_data,
|
||||
duration=200, sleep_for=10):
|
||||
if not test_utils.call_until_true(func=_check_data,
|
||||
duration=200, sleep_for=10):
|
||||
raise exceptions.TimeoutException("Data did not converge in time "
|
||||
"or failure in server")
|
||||
|
||||
|
@ -309,8 +310,8 @@ class TestNeutronV2Driver(manager_congress.ScenarioPolicyBase):
|
|||
return False
|
||||
return True
|
||||
|
||||
if not test.call_until_true(func=_check_data,
|
||||
duration=200, sleep_for=10):
|
||||
if not test_utils.call_until_true(func=_check_data,
|
||||
duration=200, sleep_for=10):
|
||||
raise exceptions.TimeoutException("Data did not converge in time "
|
||||
"or failure in server")
|
||||
|
||||
|
@ -346,8 +347,8 @@ class TestNeutronV2Driver(manager_congress.ScenarioPolicyBase):
|
|||
return False
|
||||
return True
|
||||
|
||||
if not test.call_until_true(func=_check_data,
|
||||
duration=200, sleep_for=10):
|
||||
if not test_utils.call_until_true(func=_check_data,
|
||||
duration=200, sleep_for=10):
|
||||
raise exceptions.TimeoutException("Data did not converge in time "
|
||||
"or failure in server")
|
||||
|
||||
|
@ -384,7 +385,7 @@ class TestNeutronV2Driver(manager_congress.ScenarioPolicyBase):
|
|||
return False
|
||||
return True
|
||||
|
||||
if not test.call_until_true(func=_check_data,
|
||||
duration=200, sleep_for=10):
|
||||
if not test_utils.call_until_true(func=_check_data,
|
||||
duration=200, sleep_for=10):
|
||||
raise exceptions.TimeoutException("Data did not converge in time "
|
||||
"or failure in server")
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
from oslo_log import log as logging
|
||||
from tempest import config
|
||||
from tempest.lib.common.utils import test_utils
|
||||
from tempest.lib import exceptions
|
||||
from tempest import test
|
||||
|
||||
|
@ -99,8 +100,8 @@ class TestNovaDriver(manager_congress.ScenarioPolicyBase):
|
|||
return True
|
||||
return False
|
||||
|
||||
if not test.call_until_true(func=_check_data_table_nova_servers,
|
||||
duration=100, sleep_for=5):
|
||||
if not test_utils.call_until_true(func=_check_data_table_nova_servers,
|
||||
duration=100, sleep_for=5):
|
||||
raise exceptions.TimeoutException("Data did not converge in time "
|
||||
"or failure in server")
|
||||
|
||||
|
@ -138,7 +139,7 @@ class TestNovaDriver(manager_congress.ScenarioPolicyBase):
|
|||
return True
|
||||
return False
|
||||
|
||||
if not test.call_until_true(func=_check_data_table_nova_flavors,
|
||||
duration=100, sleep_for=5):
|
||||
if not test_utils.call_until_true(func=_check_data_table_nova_flavors,
|
||||
duration=100, sleep_for=5):
|
||||
raise exceptions.TimeoutException("Data did not converge in time "
|
||||
"or failure in server")
|
||||
|
|
|
@ -21,6 +21,7 @@ import tempfile
|
|||
from oslo_log import log as logging
|
||||
from tempest.common import credentials_factory as credentials
|
||||
from tempest import config
|
||||
from tempest.lib.common.utils import test_utils
|
||||
from tempest.lib import exceptions
|
||||
from tempest import manager as tempestmanager
|
||||
from tempest import test
|
||||
|
@ -216,7 +217,7 @@ class TestHA(manager_congress.ScenarioPolicyBase):
|
|||
replica_client = self.create_client(CONF.congressha.replica_type)
|
||||
|
||||
# Check replica server status
|
||||
if not test.call_until_true(
|
||||
if not test_utils.call_until_true(
|
||||
func=lambda: self._check_replica_server_status(
|
||||
replica_client),
|
||||
duration=60, sleep_for=1):
|
||||
|
@ -229,13 +230,13 @@ class TestHA(manager_congress.ScenarioPolicyBase):
|
|||
# replica first
|
||||
|
||||
# Verify that replica server synced fake dataservice and policy
|
||||
if not test.call_until_true(
|
||||
if not test_utils.call_until_true(
|
||||
func=lambda: self._check_resource_exists(
|
||||
replica_client, 'datasource'),
|
||||
duration=60, sleep_for=1):
|
||||
raise exceptions.TimeoutException(
|
||||
"replica doesn't have fake dataservice, data sync failed")
|
||||
if not test.call_until_true(
|
||||
if not test_utils.call_until_true(
|
||||
func=lambda: self._check_resource_exists(
|
||||
replica_client, 'policy'),
|
||||
duration=60, sleep_for=1):
|
||||
|
@ -243,13 +244,13 @@ class TestHA(manager_congress.ScenarioPolicyBase):
|
|||
"replica doesn't have fake policy, policy sync failed")
|
||||
|
||||
# Verify that primary server synced fake dataservice and policy
|
||||
if not test.call_until_true(
|
||||
if not test_utils.call_until_true(
|
||||
func=lambda: self._check_resource_exists(
|
||||
self.client, 'datasource'),
|
||||
duration=90, sleep_for=1):
|
||||
raise exceptions.TimeoutException(
|
||||
"primary doesn't have fake dataservice, data sync failed")
|
||||
if not test.call_until_true(
|
||||
if not test_utils.call_until_true(
|
||||
func=lambda: self._check_resource_exists(
|
||||
self.client, 'policy'),
|
||||
duration=90, sleep_for=1):
|
||||
|
@ -261,13 +262,13 @@ class TestHA(manager_congress.ScenarioPolicyBase):
|
|||
self.client.delete_datasource(fake_id)
|
||||
|
||||
# Verify that replica server has no fake datasource and fake policy
|
||||
if not test.call_until_true(
|
||||
if not test_utils.call_until_true(
|
||||
func=lambda: self._check_resource_missing(
|
||||
replica_client, 'datasource'),
|
||||
duration=60, sleep_for=1):
|
||||
raise exceptions.TimeoutException(
|
||||
"replica still has fake dataservice, sync failed")
|
||||
if not test.call_until_true(
|
||||
if not test_utils.call_until_true(
|
||||
func=lambda: self._check_resource_missing(
|
||||
replica_client, 'policy'),
|
||||
duration=60, sleep_for=1):
|
||||
|
@ -277,13 +278,13 @@ class TestHA(manager_congress.ScenarioPolicyBase):
|
|||
LOG.debug("removed fake datasource from replica instance")
|
||||
|
||||
# Verify that primary server has no fake datasource and fake policy
|
||||
if not test.call_until_true(
|
||||
if not test_utils.call_until_true(
|
||||
func=lambda: self._check_resource_missing(
|
||||
self.client, 'datasource'),
|
||||
duration=90, sleep_for=1):
|
||||
raise exceptions.TimeoutException(
|
||||
"primary still has fake dataservice, sync failed")
|
||||
if not test.call_until_true(
|
||||
if not test_utils.call_until_true(
|
||||
func=lambda: self._check_resource_missing(
|
||||
self.client, 'policy'),
|
||||
duration=90, sleep_for=1):
|
||||
|
|
|
@ -20,10 +20,10 @@ from oslo_log import log as logging
|
|||
from tempest.common import credentials_factory as credentials
|
||||
from tempest import config
|
||||
from tempest.lib.common.utils import data_utils
|
||||
from tempest.lib.common.utils import test_utils
|
||||
from tempest.lib import exceptions
|
||||
from tempest import manager as tempestmanager
|
||||
from tempest.scenario import manager
|
||||
from tempest import test
|
||||
|
||||
from congress_tempest_tests.services.policy import policy_client
|
||||
|
||||
|
@ -210,8 +210,9 @@ class ScenarioPolicyBase(manager.NetworkScenarioTest):
|
|||
self.new_port_list = [port for port in ports if port != old_port]
|
||||
return len(self.new_port_list) == 1
|
||||
|
||||
if not test.call_until_true(check_ports, CONF.network.build_timeout,
|
||||
CONF.network.build_interval):
|
||||
if not test_utils.call_until_true(check_ports,
|
||||
CONF.network.build_timeout,
|
||||
CONF.network.build_interval):
|
||||
raise exceptions.TimeoutException("No new port attached to the "
|
||||
"server in time (%s sec) !"
|
||||
% CONF.network.build_timeout)
|
||||
|
@ -222,8 +223,9 @@ class ScenarioPolicyBase(manager.NetworkScenarioTest):
|
|||
self.diff_list = [n for n in new_nic_list if n not in old_nic_list]
|
||||
return len(self.diff_list) == 1
|
||||
|
||||
if not test.call_until_true(check_new_nic, CONF.network.build_timeout,
|
||||
CONF.network.build_interval):
|
||||
if not test_utils.call_until_true(check_new_nic,
|
||||
CONF.network.build_timeout,
|
||||
CONF.network.build_interval):
|
||||
raise exceptions.TimeoutException("Interface not visible on the "
|
||||
"guest after %s sec"
|
||||
% CONF.network.build_timeout)
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
from oslo_log import log as logging
|
||||
from tempest import config
|
||||
from tempest.lib.common.utils import test_utils
|
||||
from tempest.lib import exceptions
|
||||
from tempest import test
|
||||
|
||||
|
@ -215,7 +216,7 @@ class TestCongressDataSources(manager_congress.ScenarioPolicyBase):
|
|||
return False
|
||||
return True
|
||||
|
||||
if not test.call_until_true(
|
||||
if not test_utils.call_until_true(
|
||||
func=_check_all_datasources_are_initialized,
|
||||
duration=100, sleep_for=5):
|
||||
raise exceptions.TimeoutException("Data did not converge in time "
|
||||
|
@ -237,7 +238,7 @@ class TestCongressDataSources(manager_congress.ScenarioPolicyBase):
|
|||
return False
|
||||
return True
|
||||
|
||||
if not test.call_until_true(func=check_data,
|
||||
duration=100, sleep_for=5):
|
||||
if not test_utils.call_until_true(func=check_data,
|
||||
duration=100, sleep_for=5):
|
||||
raise exceptions.TimeoutException("Data did not converge in time "
|
||||
"or failure in server")
|
||||
|
|
Loading…
Reference in New Issue