Browse Source

Merge "Remove functional test specific nova code"

changes/17/694717/3
Zuul 2 weeks ago
parent
commit
79c6fb5d48
4 changed files with 2 additions and 38 deletions
  1. +1
    -1
      lower-constraints.txt
  2. +0
    -6
      nova/compute/rpcapi.py
  3. +0
    -30
      nova/tests/functional/regressions/test_bug_1843090.py
  4. +1
    -1
      requirements.txt

+ 1
- 1
lower-constraints.txt View File

@@ -80,7 +80,7 @@ oslo.context==2.21.0
oslo.db==4.44.0
oslo.i18n==3.15.3
oslo.log==3.36.0
oslo.messaging==7.0.0
oslo.messaging==10.3.0
oslo.middleware==3.31.0
oslo.policy==1.38.0
oslo.privsep==1.33.2

+ 0
- 6
nova/compute/rpcapi.py View File

@@ -18,7 +18,6 @@ Client side of the compute RPC API.
from oslo_concurrency import lockutils
from oslo_log import log as logging
import oslo_messaging as messaging
from oslo_serialization import jsonutils
from oslo_utils import excutils

import nova.conf
@@ -868,11 +867,6 @@ class ComputeAPI(object):
# compute but that also requires plumbing changes through the resize
# flow for other methods like resize_instance and finish_resize.
image_p = objects_base.obj_to_primitive(image)
# FIXME(sbauza): Serialize/Unserialize the legacy dict because of
# oslo.messaging #1529084 to transform datetime values into strings.
# tl;dr: datetimes in dicts are not accepted as correct values by the
# rpc fake driver.
image_p = jsonutils.loads(jsonutils.dumps(image_p))
msg_args = {'instance': instance,
'instance_type': instance_type,
'image': image_p,

+ 0
- 30
nova/tests/functional/regressions/test_bug_1843090.py View File

@@ -9,11 +9,8 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import fixtures
import mock

from oslo_serialization import jsonutils

import nova.compute
from nova import exception
from nova.tests import fixtures as nova_fixtures
@@ -22,31 +19,6 @@ from nova.tests.unit import fake_notifier
from nova.tests.unit.image import fake as fake_image


class RequestSpecImageSerializationFixture(fixtures.Fixture):
"""A fixture to temporary fix oslo.messaging bug #1529084 by serializing
datetime objects into strings in legacy dicts.

It seems that the fake rpc driver does not accept datetimes as
serializable. So we need to hack around in nova to be able to run test with
fake RPC.
"""
def __init__(self, test):
self.test = test

def setUp(self):
super(RequestSpecImageSerializationFixture, self).setUp()
orig_legacy_image = (
nova.objects.request_spec.RequestSpec._to_legacy_image)

def wrap_legacy_image(*args, **kwargs):
image_p = orig_legacy_image(*args, **kwargs)
return jsonutils.loads(jsonutils.dumps(image_p))

self.test.stub_out(
'nova.objects.request_spec.RequestSpec._to_legacy_image',
wrap_legacy_image)


class PinnedComputeRpcTests(integrated_helpers.ProviderUsageBaseTestCase):

compute_driver = 'fake.MediumFakeDriver'
@@ -60,8 +32,6 @@ class PinnedComputeRpcTests(integrated_helpers.ProviderUsageBaseTestCase):
fake_notifier.stub_notifier(self)
self.addCleanup(fake_notifier.reset)

self.useFixture(RequestSpecImageSerializationFixture(self))

self.compute1 = self._start_compute(host='host1')
self.compute2 = self._start_compute(host='host2')
self.compute3 = self._start_compute(host='host3')

+ 1
- 1
requirements.txt View File

@@ -45,7 +45,7 @@ oslo.upgradecheck>=0.1.1
oslo.utils>=3.40.2 # Apache-2.0
oslo.db>=4.44.0 # Apache-2.0
oslo.rootwrap>=5.8.0 # Apache-2.0
oslo.messaging>=7.0.0 # Apache-2.0
oslo.messaging>=10.3.0 # Apache-2.0
oslo.policy>=1.38.0 # Apache-2.0
oslo.privsep>=1.33.2 # Apache-2.0
oslo.i18n>=3.15.3 # Apache-2.0

Loading…
Cancel
Save