File tree Expand file tree Collapse file tree
zaza/openstack/charm_tests/pacemaker_remote Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818
1919import unittest
2020
21+ import tenacity
22+ import zaza .model
2123import zaza .openstack .configure .hacluster
24+ import zaza .openstack .utilities .generic as generic_utils
2225
2326
2427class PacemakerRemoteTest (unittest .TestCase ):
2528 """Encapsulate pacemaker-remote tests."""
2629
2730 def test_check_nodes_online (self ):
2831 """Test that all nodes are online."""
32+ for attempt in tenacity .Retrying (
33+ reraise = True ,
34+ stop = tenacity .stop_after_attempt (5 ),
35+ wait = tenacity .wait_fixed (5 ),
36+ ):
37+ with attempt :
38+ zaza .openstack .configure .hacluster .check_all_nodes_online (
39+ 'api'
40+ )
41+ units = zaza .model .get_units ('pacemaker-remote' )
42+ last_unit = units [- 1 ]
43+ node_names = generic_utils .get_unit_hostnames (units )
44+ node_name = node_names [last_unit .entity_id ]
2945 zaza .openstack .configure .hacluster .remove_node (
3046 'api' ,
31- 'node1' )
32- self .assertTrue (
33- zaza .openstack .configure .hacluster .check_all_nodes_online ('api' ))
47+ node_name )
48+ for attempt in tenacity .Retrying (
49+ reraise = True ,
50+ stop = tenacity .stop_after_attempt (5 ),
51+ wait = tenacity .wait_fixed (5 ),
52+ ):
53+ with attempt :
54+ self .assertTrue (
55+ zaza .openstack .configure .hacluster .check_all_nodes_online (
56+ 'api'
57+ )
58+ )
You can’t perform that action at this time.
0 commit comments