diff options
author | Greg Lucas <glucas@tesora.com> | 2014-07-07 14:12:19 -0400 |
---|---|---|
committer | Greg Lucas <glucas@tesora.com> | 2014-08-25 10:11:01 -0400 |
commit | 87b621b2d904ef531e4e9d33679c6d67de21ef7b (patch) | |
tree | 338bc3ff460414f82954b273a9daf302fdd5f83d /trove/tests/api/instances.py | |
parent | 315c20cc8c7fd61043ee27ae995539c43626cee0 (diff) | |
download | trove-87b621b2d904ef531e4e9d33679c6d67de21ef7b.tar.gz |
Add replication slave info to instance show
Update the 'show' response for an instance:
- If the instance is a replication slave, include the slave_of id.
- If the instance is a replication master, include the list of slave
instance ids.
Update the 'list' response to include the slave_of id.
Add CheckInstance tests for slave/slave_of info.
(Unrelated: remove a #TODO comment that has already been addressed.)
Partially Implements: blueprint replication-v1
Closes-Bug: #1340359
Change-Id: If8a154083d0095606fb3ee115cc9b66ab788cbb4
Diffstat (limited to 'trove/tests/api/instances.py')
-rw-r--r-- | trove/tests/api/instances.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/trove/tests/api/instances.py b/trove/tests/api/instances.py index 27c88e23..bd09b263 100644 --- a/trove/tests/api/instances.py +++ b/trove/tests/api/instances.py @@ -1459,6 +1459,24 @@ class CheckInstance(AttrCheck): self.attrs_exist(self.instance['volume'], expected_attrs, msg="Volume") + def slave_of(self): + if 'slave_of' not in self.instance: + self.fail("'slave_of' not found in instance.") + else: + expected_attrs = ['id', 'links'] + self.attrs_exist(self.instance['slave_of'], expected_attrs, + msg="Slave Of") + self.links(self.instance['slave_of']['links']) + + def slaves(self): + if 'slaves' not in self.instance: + self.fail("'slaves' not found in instance.") + else: + expected_attrs = ['id', 'links'] + for slave in self.instance['slaves']: + self.attrs_exist(slave, expected_attrs, msg="Slave") + self.links(slave['links']) + @test(groups=[GROUP]) class BadInstanceStatusBug(): |