Make sure microversion < 2.62 does not show host(Id) for instance actions
This adds a simple assertion that when microversion < 2.62, the "nova instance-action" CLI does not show host or hostId output. Related to blueprint add-host-to-instance-action-events Change-Id: I6e0866d9daff75046a5e82f57ff745d494b4b5ed
This commit is contained in:
parent
5483be7fe7
commit
460638436e
@ -66,6 +66,8 @@ class TestInstanceActionCLIV258(TestInstanceActionCLI):
|
|||||||
"""Instance action functional tests for v2.58 nova-api microversion."""
|
"""Instance action functional tests for v2.58 nova-api microversion."""
|
||||||
|
|
||||||
COMPUTE_API_VERSION = "2.58"
|
COMPUTE_API_VERSION = "2.58"
|
||||||
|
# Does this microversion return a hostId field in the event response?
|
||||||
|
expect_event_hostId_field = False
|
||||||
|
|
||||||
def test_list_instance_action_with_marker_and_limit(self):
|
def test_list_instance_action_with_marker_and_limit(self):
|
||||||
server = self._create_server()
|
server = self._create_server()
|
||||||
@ -86,6 +88,13 @@ class TestInstanceActionCLIV258(TestInstanceActionCLI):
|
|||||||
action = self._get_list_of_values_from_single_column_table(
|
action = self._get_list_of_values_from_single_column_table(
|
||||||
output, "Action")
|
output, "Action")
|
||||||
self.assertEqual(action, ['create'])
|
self.assertEqual(action, ['create'])
|
||||||
|
if not self.expect_event_hostId_field:
|
||||||
|
# Make sure host and hostId are not in the response when
|
||||||
|
# microversion is less than 2.62.
|
||||||
|
output = self.nova("instance-action %s %s" % (
|
||||||
|
server.id, marker_req))
|
||||||
|
self.assertNotIn("'host'", output)
|
||||||
|
self.assertNotIn("'hostId'", output)
|
||||||
|
|
||||||
def test_list_instance_action_with_changes_since(self):
|
def test_list_instance_action_with_changes_since(self):
|
||||||
# Ignore microseconds to make this a deterministic test.
|
# Ignore microseconds to make this a deterministic test.
|
||||||
@ -120,6 +129,7 @@ class TestInstanceActionCLIV262(TestInstanceActionCLIV258,
|
|||||||
"""Instance action functional tests for v2.62 nova-api microversion."""
|
"""Instance action functional tests for v2.62 nova-api microversion."""
|
||||||
|
|
||||||
COMPUTE_API_VERSION = "2.62"
|
COMPUTE_API_VERSION = "2.62"
|
||||||
|
expect_event_hostId_field = True
|
||||||
|
|
||||||
def test_show_actions_with_host(self):
|
def test_show_actions_with_host(self):
|
||||||
name = self.name_generate()
|
name = self.name_generate()
|
||||||
|
Loading…
Reference in New Issue
Block a user