From 9d702453be1cbeb90ed520a31216d0d65307337a Mon Sep 17 00:00:00 2001 From: Riccardo Pittau Date: Tue, 31 Mar 2020 10:03:02 +0200 Subject: [PATCH] Bump hacking to 3.0.0 This patch also aligns the version of ironic-inspector used for functional tests to a one that also supports hacking 3.0.0 and adapts the tests to the recent changes to drop ironicclient from ironic-inspector. Change-Id: Id48bc3d0c79e1523b75b0495003e4f48522c3ec9 --- functest-requirements.txt | 6 +-- ironic_inspector_client/test/functional.py | 44 +++++++++++----------- lower-constraints.txt | 2 +- test-requirements.txt | 2 +- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/functest-requirements.txt b/functest-requirements.txt index ad7d23e..e699f45 100644 --- a/functest-requirements.txt +++ b/functest-requirements.txt @@ -1,4 +1,4 @@ # NOTE(jroll) these are pinned to the same SHA, update when needed. -# Last updated: Sep 26, 2019 (Train cycle). -git+https://opendev.org/openstack/ironic-inspector@0c154991cebeab0abfd2499f95dc704ef046e09f#egg=ironic-inspector --r https://opendev.org/openstack/ironic-inspector/raw/commit/0c154991cebeab0abfd2499f95dc704ef046e09f/test-requirements.txt +# Last updated: Apr 2, 2020 (Ussuri cycle). +git+https://opendev.org/openstack/ironic-inspector@75437072da66686509d4b7fa80589f5b4966a858#egg=ironic-inspector +-r https://opendev.org/openstack/ironic-inspector/raw/commit/75437072da66686509d4b7fa80589f5b4966a858/test-requirements.txt diff --git a/ironic_inspector_client/test/functional.py b/ironic_inspector_client/test/functional.py index 86cd3f1..71a050c 100644 --- a/ironic_inspector_client/test/functional.py +++ b/ironic_inspector_client/test/functional.py @@ -46,8 +46,8 @@ class TestV1PythonAPI(functional.Base): def test_introspect_get_status(self): self.client.introspect(self.uuid) eventlet.greenthread.sleep(functional.DEFAULT_SLEEP) - self.cli.node.set_power_state.assert_called_once_with(self.uuid, - 'reboot') + self.cli.set_node_power_state.assert_called_once_with(self.uuid, + 'rebooting') status = self.client.get_status(self.uuid) self.check_status(status, finished=False, state=istate.States.waiting) @@ -56,10 +56,10 @@ class TestV1PythonAPI(functional.Base): self.assertEqual({'uuid': self.uuid}, res) eventlet.greenthread.sleep(functional.DEFAULT_SLEEP) - self.assertCalledWithPatch(self.patch, self.cli.node.update) - self.cli.port.create.assert_called_once_with( + self.assertCalledWithPatch(self.patch, self.cli.patch_node) + self.cli.create_port.assert_called_once_with( node_uuid=self.uuid, address='11:22:33:44:55:66', - pxe_enabled=True, extra={}) + is_pxe_enabled=True, extra={}) status = self.client.get_status(self.uuid) self.check_status(status, finished=True, state=istate.States.finished) @@ -67,8 +67,8 @@ class TestV1PythonAPI(functional.Base): def test_introspect_list_statuses(self): self.client.introspect(self.uuid) eventlet.greenthread.sleep(functional.DEFAULT_SLEEP) - self.cli.node.set_power_state.assert_called_once_with(self.uuid, - 'reboot') + self.cli.set_node_power_state.assert_called_once_with(self.uuid, + 'rebooting') statuses = self.client.list_statuses() my_status = statuses[self.my_status_index(statuses)] @@ -79,10 +79,10 @@ class TestV1PythonAPI(functional.Base): self.assertEqual({'uuid': self.uuid}, res) eventlet.greenthread.sleep(functional.DEFAULT_SLEEP) - self.assertCalledWithPatch(self.patch, self.cli.node.update) - self.cli.port.create.assert_called_once_with( + self.assertCalledWithPatch(self.patch, self.cli.patch_node) + self.cli.create_port.assert_called_once_with( node_uuid=self.uuid, address='11:22:33:44:55:66', - pxe_enabled=True, extra={}) + is_pxe_enabled=True, extra={}) statuses = self.client.list_statuses() my_status = statuses[self.my_status_index(statuses)] @@ -117,7 +117,7 @@ class TestV1PythonAPI(functional.Base): def test_reprocess_stored_introspection_data(self): port_create_call = mock.call(node_uuid=self.uuid, address='11:22:33:44:55:66', - pxe_enabled=True, extra={}) + is_pxe_enabled=True, extra={}) # assert reprocessing doesn't work before introspection self.assertRaises(client.ClientError, self.client.reprocess, @@ -125,8 +125,8 @@ class TestV1PythonAPI(functional.Base): self.client.introspect(self.uuid) eventlet.greenthread.sleep(functional.DEFAULT_SLEEP) - self.cli.node.set_power_state.assert_called_once_with(self.uuid, - 'reboot') + self.cli.set_node_power_state.assert_called_once_with(self.uuid, + 'rebooting') status = self.client.get_status(self.uuid) self.check_status(status, finished=False, state=istate.States.waiting) @@ -136,7 +136,7 @@ class TestV1PythonAPI(functional.Base): status = self.client.get_status(self.uuid) self.check_status(status, finished=True, state=istate.States.finished) - self.cli.port.create.assert_has_calls([port_create_call], + self.cli.create_port.assert_has_calls([port_create_call], any_order=True) res = self.client.reprocess(self.uuid) @@ -145,7 +145,7 @@ class TestV1PythonAPI(functional.Base): eventlet.greenthread.sleep(functional.DEFAULT_SLEEP) self.check_status(status, finished=True, state=istate.States.finished) - self.cli.port.create.assert_has_calls([port_create_call, + self.cli.create_port.assert_has_calls([port_create_call, port_create_call], any_order=True) @@ -156,8 +156,8 @@ class TestV1PythonAPI(functional.Base): self.client.introspect(self.uuid) eventlet.greenthread.sleep(functional.DEFAULT_SLEEP) - self.cli.node.set_power_state.assert_called_once_with(self.uuid, - 'reboot') + self.cli.set_node_power_state.assert_called_once_with(self.uuid, + 'rebooting') status = self.client.get_status(self.uuid) self.check_status(status, finished=False, state=istate.States.waiting) @@ -332,8 +332,8 @@ class TestCLI(BaseCLITest): def test_introspect_get_status(self): self.run_cli('start', self.uuid) eventlet.greenthread.sleep(functional.DEFAULT_SLEEP) - self.cli.node.set_power_state.assert_called_once_with(self.uuid, - 'reboot') + self.cli.set_node_power_state.assert_called_once_with(self.uuid, + 'rebooting') status = self.run_cli('status', self.uuid, parse_json=True) self.check_status(status, finished=False, state=istate.States.waiting) @@ -342,10 +342,10 @@ class TestCLI(BaseCLITest): self.assertEqual({'uuid': self.uuid}, res) eventlet.greenthread.sleep(functional.DEFAULT_SLEEP) - self.assertCalledWithPatch(self.patch, self.cli.node.update) - self.cli.port.create.assert_called_once_with( + self.assertCalledWithPatch(self.patch, self.cli.patch_node) + self.cli.create_port.assert_called_once_with( node_uuid=self.uuid, address='11:22:33:44:55:66', - pxe_enabled=True, extra={}) + is_pxe_enabled=True, extra={}) status = self.run_cli('status', self.uuid, parse_json=True) self.check_status(status, finished=True, state=istate.States.finished) diff --git a/lower-constraints.txt b/lower-constraints.txt index de7f678..d6b39a4 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -19,7 +19,7 @@ extras==1.0.0 fasteners==0.7.0 fixtures==3.0.0 flake8==2.5.5 -hacking==1.0.0 +hacking==3.0.0 idna==2.6 imagesize==0.7.1 iso8601==0.1.11 diff --git a/test-requirements.txt b/test-requirements.txt index 7228d9e..5b2f9f8 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -5,7 +5,7 @@ coverage!=4.4,>=4.0 # Apache-2.0 doc8>=0.6.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD flake8-import-order>=0.13 # LGPLv3 -hacking>=1.0.0,<1.2.0 # Apache-2.0 +hacking>=3.0.0,<3.1.0 # Apache-2.0 mock>=2.0.0 # BSD requests-mock>=1.2.0 # Apache-2.0 oslo.concurrency>=3.25.0 # Apache-2.0