"Fossies" - the Fresh Open Source Software Archive

Member "nova-22.0.1/nova/tests/functional/regressions/test_bug_1902925.py" (19 Nov 2020, 1715 Bytes) of package /linux/misc/openstack/nova-22.0.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 # Licensed under the Apache License, Version 2.0 (the "License"); you may
    2 # not use this file except in compliance with the License. You may obtain
    3 # a copy of the License at
    4 #
    5 #      http://www.apache.org/licenses/LICENSE-2.0
    6 #
    7 # Unless required by applicable law or agreed to in writing, software
    8 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
    9 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
   10 # License for the specific language governing permissions and limitations
   11 # under the License.
   12 from nova.tests.functional import integrated_helpers
   13 from nova.tests.unit import cast_as_call
   14 
   15 
   16 class ComputeVersion5xPinnedRpcTests(integrated_helpers._IntegratedTestBase):
   17 
   18     compute_driver = 'fake.MediumFakeDriver'
   19     ADMIN_API = True
   20     api_major_version = 'v2.1'
   21     microversion = 'latest'
   22 
   23     def setUp(self):
   24         super(ComputeVersion5xPinnedRpcTests, self).setUp()
   25         self.useFixture(cast_as_call.CastAsCall(self))
   26 
   27         self.compute1 = self._start_compute(host='host1')
   28 
   29     def _test_rebuild_instance_with_compute_rpc_pin(self, version_cap):
   30         self.flags(compute=version_cap, group='upgrade_levels')
   31 
   32         server_req = self._build_server(networks='none')
   33         server = self.api.post_server({'server': server_req})
   34         server = self._wait_for_state_change(server, 'ACTIVE')
   35 
   36         self.api.post_server_action(server['id'], {'rebuild': {
   37             'imageRef': '155d900f-4e14-4e4c-a73d-069cbf4541e6'
   38         }})
   39 
   40     def test_rebuild_instance_5_0(self):
   41         self._test_rebuild_instance_with_compute_rpc_pin('5.0')
   42 
   43     def test_rebuild_instance_5_12(self):
   44         self._test_rebuild_instance_with_compute_rpc_pin('5.12')