diff --git a/.gitreview b/.gitreview index a424128c..a7fd6932 100644 --- a/.gitreview +++ b/.gitreview @@ -2,4 +2,4 @@ host=review.opendev.org port=29418 project=openstack/ironic-lib.git -defaultbranch=stable/yoga +defaultbranch=unmaintained/yoga diff --git a/ironic_lib/tests/test_mdns.py b/ironic_lib/tests/test_mdns.py index 3e212198..f02c5ce1 100644 --- a/ironic_lib/tests/test_mdns.py +++ b/ironic_lib/tests/test_mdns.py @@ -11,6 +11,7 @@ # under the License. import socket +import sys from unittest import mock from oslo_config import cfg @@ -37,7 +38,7 @@ class RegisterServiceTestCase(base.IronicLibTestCase): self.assertEqual('_openstack._tcp.local.', info.type) self.assertEqual('baremetal._openstack._tcp.local.', info.name) self.assertEqual('127.0.0.1', socket.inet_ntoa(info.addresses[0])) - self.assertEqual({'path': '/baremetal'}, info.properties) + self.assertByteDictEqual({'path': '/baremetal'}, info.properties) def test_with_params(self, mock_zc): CONF.set_override('params', {'answer': 'none', 'foo': 'bar'}, @@ -50,10 +51,10 @@ class RegisterServiceTestCase(base.IronicLibTestCase): self.assertEqual('_openstack._tcp.local.', info.type) self.assertEqual('baremetal._openstack._tcp.local.', info.name) self.assertEqual('127.0.0.1', socket.inet_ntoa(info.addresses[0])) - self.assertEqual({'path': '/baremetal', - 'answer': 42, - 'foo': 'bar'}, - info.properties) + self.assertByteDictEqual({'path': '/baremetal', + 'answer': 42, + 'foo': 'bar'}, + info.properties) @mock.patch.object(mdns.time, 'sleep', autospec=True) def test_with_race(self, mock_sleep, mock_zc): @@ -81,7 +82,17 @@ class RegisterServiceTestCase(base.IronicLibTestCase): self.assertEqual('_openstack._tcp.local.', info.type) self.assertEqual('baremetal._openstack._tcp.local.', info.name) self.assertEqual('127.0.0.1', socket.inet_ntoa(info.addresses[0])) - self.assertEqual({'path': '/baremetal'}, info.properties) + self.assertByteDictEqual({'path': '/baremetal'}, info.properties) + + def assertByteDictEqual(self, expected, actual): + # Python 3.9+ returns bytes for keys and values + if sys.version_info.major == 3 and sys.version_info.minor <= 8: + self.assertEqual(expected, actual) + return + self.assertEqual( + {k.encode(): str(v).encode() for k, v in expected.items()}, + actual + ) @mock.patch.object(mdns.time, 'sleep', autospec=True) def test_failure(self, mock_sleep, mock_zc): diff --git a/tox.ini b/tox.ini index 47c85521..c6c976f9 100644 --- a/tox.ini +++ b/tox.ini @@ -13,7 +13,7 @@ setenv = VIRTUAL_ENV={envdir} LANGUAGE=en_US TESTS_DIR=./ironic_lib/tests/ deps = - -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/yoga} + -c{env:TOX_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/unmaintained/yoga/upper-constraints.txt} -r{toxinidir}/test-requirements.txt -r{toxinidir}/extra-requirements.txt -r{toxinidir}/requirements.txt diff --git a/zuul.d/ironic-lib-jobs.yaml b/zuul.d/ironic-lib-jobs.yaml index 614ce407..cc322eaa 100644 --- a/zuul.d/ironic-lib-jobs.yaml +++ b/zuul.d/ironic-lib-jobs.yaml @@ -16,6 +16,7 @@ vars: tempest_test_timeout: 1800 devstack_localrc: + IRONIC_RAMDISK_TYPE: tinyipa BUILD_TIMEOUT: 900 IRONIC_BUILD_DEPLOY_RAMDISK: True IRONIC_TEMPEST_BUILD_TIMEOUT: 900