19
19
import logging
20
20
import tenacity
21
21
22
- from manilaclient import client as manilaclient
23
-
24
22
import zaza .model
25
23
import zaza .openstack .configure .guest as guest
24
+ from zaza .openstack .utilities import retry_on_connect_failure
26
25
import zaza .openstack .utilities .generic as generic_utils
27
26
import zaza .openstack .utilities .openstack as openstack_utils
28
27
import zaza .openstack .charm_tests .test_utils as test_utils
@@ -67,8 +66,9 @@ class ManilaTests(test_utils.OpenStackBaseTest):
67
66
def setUpClass (cls ):
68
67
"""Run class setup for running tests."""
69
68
super (ManilaTests , cls ).setUpClass ()
70
- cls .manila_client = manilaclient .Client (
71
- session = cls .keystone_session , client_version = '2' )
69
+ cls .manila_client = retry_on_connect_failure (
70
+ openstack_utils .get_manila_session_client (
71
+ session = cls .keystone_session ))
72
72
73
73
def test_manila_api (self ):
74
74
"""Test that the Manila API is working."""
@@ -132,8 +132,8 @@ def setUpClass(cls):
132
132
super (ManilaBaseTest , cls ).setUpClass ()
133
133
cls .nova_client = openstack_utils .get_nova_session_client (
134
134
session = cls .keystone_session )
135
- cls .manila_client = manilaclient . Client (
136
- session = cls .keystone_session , client_version = '2' )
135
+ cls .manila_client = openstack_utils . get_manila_session_client (
136
+ session = cls .keystone_session )
137
137
cls .share_name = 'test-manila-share'
138
138
cls .share_type_name = 'default_share_type'
139
139
cls .share_protocol = 'nfs'
@@ -221,7 +221,7 @@ def _mount_share_on_instance(self, instance_ip, ssh_user_name,
221
221
222
222
for attempt in tenacity .Retrying (
223
223
stop = tenacity .stop_after_attempt (5 ),
224
- wait = tenacity .wait_exponential (multiplier = 3 , min = 2 , max = 10 )):
224
+ wait = tenacity .wait_exponential (multiplier = 5 , min = 2 , max = 60 )):
225
225
with attempt :
226
226
openstack_utils .ssh_command (
227
227
vm_name = "instance-{}" .format (instance_ip ),
@@ -233,7 +233,7 @@ def _mount_share_on_instance(self, instance_ip, ssh_user_name,
233
233
234
234
@tenacity .retry (
235
235
stop = tenacity .stop_after_attempt (5 ),
236
- wait = tenacity .wait_exponential (multiplier = 3 , min = 2 , max = 10 ))
236
+ wait = tenacity .wait_exponential (multiplier = 5 , min = 2 , max = 60 ))
237
237
def _write_testing_file_on_instance (self , instance_ip , ssh_user_name ,
238
238
ssh_private_key ):
239
239
"""Write a file on a Manila share mounted into a Nova instance.
@@ -260,7 +260,7 @@ def _write_testing_file_on_instance(self, instance_ip, ssh_user_name,
260
260
261
261
@tenacity .retry (
262
262
stop = tenacity .stop_after_attempt (5 ),
263
- wait = tenacity .wait_exponential (multiplier = 3 , min = 2 , max = 10 ))
263
+ wait = tenacity .wait_exponential (multiplier = 5 , min = 2 , max = 60 ))
264
264
def _clear_testing_file_on_instance (self , instance_ip , ssh_user_name ,
265
265
ssh_private_key ):
266
266
"""Clear a file on a Manila share mounted into a Nova instance.
@@ -287,7 +287,7 @@ def _clear_testing_file_on_instance(self, instance_ip, ssh_user_name,
287
287
288
288
@tenacity .retry (
289
289
stop = tenacity .stop_after_attempt (5 ),
290
- wait = tenacity .wait_exponential (multiplier = 3 , min = 2 , max = 10 ))
290
+ wait = tenacity .wait_exponential (multiplier = 5 , min = 2 , max = 60 ))
291
291
def _validate_testing_file_from_instance (self , instance_ip , ssh_user_name ,
292
292
ssh_private_key ):
293
293
"""Validate a file from the Manila share mounted into a Nova instance.
0 commit comments