diff --git a/nova/tests/functional/notification_sample_tests/notification_sample_base.py b/nova/tests/functional/notification_sample_tests/notification_sample_base.py index 44517a205a3c..596f1ab8c5d8 100644 --- a/nova/tests/functional/notification_sample_tests/notification_sample_base.py +++ b/nova/tests/functional/notification_sample_tests/notification_sample_base.py @@ -61,6 +61,15 @@ class NotificationSampleTestBase(test.TestCase, self.api = api_fixture.api self.admin_api = api_fixture.admin_api + + # NOTE(gibi): Notification payloads always reflect the data needed + # for every supported API microversion so we can safe to use the latest + # API version in the tests. This helps the test to use the new API + # features too. + max_version = 'latest' + self.api.microversion = max_version + self.admin_api.microversion = max_version + fake_notifier.stub_notifier(self) self.addCleanup(fake_notifier.reset) @@ -156,6 +165,10 @@ class NotificationSampleTestBase(test.TestCase, image_uuid='155d900f-4e14-4e4c-a73d-069cbf4541e6', flavor_id=flavor_id) + # NOTE(gibi): from microversion 2.19 the description is not set to the + # instance name automatically but can be provided at boot. + server['description'] = 'some-server' + if extra_params: extra_params['return_reservation_id'] = True server.update(extra_params) diff --git a/nova/tests/functional/notification_sample_tests/test_service_update.py b/nova/tests/functional/notification_sample_tests/test_service_update.py index a0e81a631a23..87ead09bb073 100644 --- a/nova/tests/functional/notification_sample_tests/test_service_update.py +++ b/nova/tests/functional/notification_sample_tests/test_service_update.py @@ -58,7 +58,6 @@ class TestServiceUpdateNotificationSample( body = {'host': 'host1', 'binary': 'nova-compute', 'forced_down': True} - self.admin_api.microversion = '2.12' self.admin_api.api_put('os-services/force-down', body) self._verify_notification('service-update', replacements={'forced_down': True,