Skip to content

Commit

Permalink
Use the new-style fields in action object for RBD tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lmlg committed Aug 14, 2024
1 parent 3b8450f commit fcdcc81
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions zaza/openstack/charm_tests/ceph/rbd_mirror/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def run_status_action(self, application_name=None, model_name=None,
if result.status == "failed":
logging.error("status action failed: %s", result.message)
return
return json.loads(result.results['output'])
return json.loads(result.get('Stdout'))

def get_pools(self):
"""Retrieve list of pools from both sites.
Expand Down Expand Up @@ -503,11 +503,11 @@ def execute_failover_juju_actions(self,
'pools': ','.join(primary_site_pools)
})
logging.info(result.results)
self.assertEqual(int(result.results['Code']), 0)
self.assertEqual(int(result.get('Code')), 0)

# Validate that the demoted pools count matches the total primary site
# pools count.
n_pools_demoted = len(result.results['output'].split('\n'))
n_pools_demoted = len(result.get('Stdout').split('\n'))
self.assertEqual(len(primary_site_pools), n_pools_demoted)

# At this point, both primary and secondary sites are demoted. Validate
Expand Down Expand Up @@ -537,11 +537,11 @@ def execute_failover_juju_actions(self,
'pools': ','.join(secondary_site_pools)
})
logging.info(result.results)
self.assertEqual(int(result.results['Code']), 0)
self.assertEqual(int(result.get('Code')), 0)

# Validate that the promoted pools count matches the total secondary
# site pools count.
n_pools_promoted = len(result.results['output'].split('\n'))
n_pools_promoted = len(result.get('Stdout').split('\n'))
self.assertEqual(len(secondary_site_pools), n_pools_promoted)

# Validate that the Ceph images from the newly promoted site
Expand Down Expand Up @@ -711,7 +711,7 @@ def test_203_juju_resync(self):
'i-really-mean-it': True,
})
logging.info(result.results)
self.assertEqual(int(result.results['Code']), 0)
self.assertEqual(int(result.get('Code')), 0)

# Validate that the Ceph images from site-b report 'up+replaying'
# (which is reported by secondary Ceph images). And check that images
Expand Down Expand Up @@ -801,7 +801,7 @@ def test_100_forced_juju_failover(self):
action_params={
'pools': ','.join(site_b_pools),
})
self.assertEqual(int(result.results['Code']), 0)
self.assertEqual(int(result.get('Code')), 0)

# The action may not show up as 'failed' if there are no pools that
# needed to be promoted.
Expand All @@ -816,7 +816,7 @@ def test_100_forced_juju_failover(self):
'force': True,
'pools': ','.join(site_b_pools),
})
self.assertEqual(int(result.results['Code']), 0)
self.assertEqual(int(result.get('Code')), 0)

# Validate successful Juju action execution
self.assertEqual(result.status, 'completed')
Expand Down

0 comments on commit fcdcc81

Please sign in to comment.