Check seeded file in update-status

Change-Id: I7174c24c36ea878d3c4e509beff688871937ecd4
Closes-Bug: #1867458
Func-Test-Pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/203
This commit is contained in:
Felipe Reyes 2020-03-19 14:39:55 -03:00
parent 1f56c36b9f
commit 4978615782
2 changed files with 7 additions and 0 deletions

View File

@ -721,6 +721,9 @@ def charm_check_func():
# and has the required peers
if not is_bootstrapped():
return ('waiting', 'Unit waiting for cluster bootstrap')
elif not seeded():
return ('waiting',
"Unit waiting to bootstrap ('seeded' file missing)")
elif cluster_ready():
try:
_cluster_in_sync()

View File

@ -535,6 +535,7 @@ class UtilsTestsStatus(CharmTestCase):
'is_clustered',
'distributed_wait',
'cluster_ready',
'seeded',
]
def setUp(self):
@ -566,6 +567,7 @@ class UtilsTestsStatus(CharmTestCase):
self.is_sufficient_peers.return_value = True
self.is_bootstrapped.return_value = True
self.cluster_in_sync.return_value = True
self.seeded.return_value = True
stat, _ = percona_utils.charm_check_func()
assert stat == 'active'
@ -575,6 +577,7 @@ class UtilsTestsStatus(CharmTestCase):
self.is_sufficient_peers.return_value = True
self.is_bootstrapped.return_value = True
self.cluster_in_sync.return_value = False
self.seeded.return_value = True
stat, _ = percona_utils.charm_check_func()
assert stat == 'blocked'
@ -584,6 +587,7 @@ class UtilsTestsStatus(CharmTestCase):
self.is_sufficient_peers.return_value = True
self.is_bootstrapped.return_value = True
self.cluster_in_sync.side_effect = [False, False, True]
self.seeded.return_value = True
stat, _ = percona_utils.charm_check_func()
assert stat == 'active'