"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "ironic/tests/unit/conductor/test_manager.py" between
ironic-16.0.2.tar.gz and ironic-16.0.3.tar.gz

About: OpenStack Ironic (Optional Service: Bare-Metal Provisioning) aims to provision bare metal machines instead of virtual machines, forked from the Nova baremetal driver.
The "Victoria" series (latest release).

test_manager.py  (ironic-16.0.2):test_manager.py  (ironic-16.0.3)
skipping to change at line 39 skipping to change at line 39
from oslo_config import cfg from oslo_config import cfg
import oslo_messaging as messaging import oslo_messaging as messaging
from oslo_utils import uuidutils from oslo_utils import uuidutils
from oslo_versionedobjects import base as ovo_base from oslo_versionedobjects import base as ovo_base
from oslo_versionedobjects import fields from oslo_versionedobjects import fields
from ironic.common import boot_devices from ironic.common import boot_devices
from ironic.common import components from ironic.common import components
from ironic.common import driver_factory from ironic.common import driver_factory
from ironic.common import exception from ironic.common import exception
from ironic.common import faults
from ironic.common import images from ironic.common import images
from ironic.common import indicator_states from ironic.common import indicator_states
from ironic.common import nova from ironic.common import nova
from ironic.common import states from ironic.common import states
from ironic.conductor import cleaning from ironic.conductor import cleaning
from ironic.conductor import deployments from ironic.conductor import deployments
from ironic.conductor import manager from ironic.conductor import manager
from ironic.conductor import notification_utils from ironic.conductor import notification_utils
from ironic.conductor import steps as conductor_steps from ironic.conductor import steps as conductor_steps
from ironic.conductor import task_manager from ironic.conductor import task_manager
skipping to change at line 1954 skipping to change at line 1955
provision_updated_at=datetime.datetime(2000, 1, 1, 0, 0)) provision_updated_at=datetime.datetime(2000, 1, 1, 0, 0))
self.service._check_deploy_timeouts(self.context) self.service._check_deploy_timeouts(self.context)
self._stop_service() self._stop_service()
node.refresh() node.refresh()
self.assertEqual(states.DEPLOYFAIL, node.provision_state) self.assertEqual(states.DEPLOYFAIL, node.provision_state)
self.assertEqual(states.ACTIVE, node.target_provision_state) self.assertEqual(states.ACTIVE, node.target_provision_state)
self.assertIsNotNone(node.last_error) self.assertIsNotNone(node.last_error)
mock_cleanup.assert_called_once_with(mock.ANY, mock.ANY) mock_cleanup.assert_called_once_with(mock.ANY, mock.ANY)
def _check_cleanwait_timeouts(self, manual=False): def _check_cleanwait_timeouts(self, manual=False, with_step=True):
self._start_service() self._start_service()
CONF.set_override('clean_callback_timeout', 1, group='conductor') CONF.set_override('clean_callback_timeout', 1, group='conductor')
tgt_prov_state = states.MANAGEABLE if manual else states.AVAILABLE tgt_prov_state = states.MANAGEABLE if manual else states.AVAILABLE
node = obj_utils.create_test_node( node = obj_utils.create_test_node(
self.context, driver='fake-hardware', self.context, driver='fake-hardware',
provision_state=states.CLEANWAIT, provision_state=states.CLEANWAIT,
target_provision_state=tgt_prov_state, target_provision_state=tgt_prov_state,
provision_updated_at=datetime.datetime(2000, 1, 1, 0, 0), provision_updated_at=datetime.datetime(2000, 1, 1, 0, 0),
clean_step={ clean_step={
'interface': 'deploy', 'interface': 'deploy',
'step': 'erase_devices'}, 'step': 'erase_devices'} if with_step else {},
driver_internal_info={ driver_internal_info={
'cleaning_reboot': manual, 'cleaning_reboot': manual,
'clean_step_index': 0}) 'clean_step_index': 0})
self.service._check_cleanwait_timeouts(self.context) self.service._check_cleanwait_timeouts(self.context)
self._stop_service() self._stop_service()
node.refresh() node.refresh()
self.assertEqual(states.CLEANFAIL, node.provision_state) self.assertEqual(states.CLEANFAIL, node.provision_state)
self.assertEqual(tgt_prov_state, node.target_provision_state) self.assertEqual(tgt_prov_state, node.target_provision_state)
self.assertIsNotNone(node.last_error) self.assertIsNotNone(node.last_error)
self.assertEqual(with_step, node.maintenance)
self.assertEqual(faults.CLEAN_FAILURE if with_step else None,
node.fault)
# Test that cleaning parameters have been purged in order # Test that cleaning parameters have been purged in order
# to prevent looping of the cleaning sequence # to prevent looping of the cleaning sequence
self.assertEqual({}, node.clean_step) self.assertEqual({}, node.clean_step)
self.assertNotIn('clean_step_index', node.driver_internal_info) self.assertNotIn('clean_step_index', node.driver_internal_info)
self.assertNotIn('cleaning_reboot', node.driver_internal_info) self.assertNotIn('cleaning_reboot', node.driver_internal_info)
def test__check_cleanwait_timeouts_automated_clean(self): def test__check_cleanwait_timeouts_automated_clean(self):
self._check_cleanwait_timeouts() self._check_cleanwait_timeouts()
def test__check_cleanwait_timeouts_manual_clean(self): def test__check_cleanwait_timeouts_manual_clean(self):
self._check_cleanwait_timeouts(manual=True) self._check_cleanwait_timeouts(manual=True)
def test__check_cleanwait_timeouts_boot_timeout(self):
self._check_cleanwait_timeouts(with_step=False)
@mock.patch('ironic.drivers.modules.fake.FakeRescue.clean_up', @mock.patch('ironic.drivers.modules.fake.FakeRescue.clean_up',
autospec=True) autospec=True)
@mock.patch.object(conductor_utils, 'node_power_action', autospec=True) @mock.patch.object(conductor_utils, 'node_power_action', autospec=True)
def test_check_rescuewait_timeouts(self, node_power_mock, def test_check_rescuewait_timeouts(self, node_power_mock,
mock_clean_up): mock_clean_up):
self._start_service() self._start_service()
CONF.set_override('rescue_callback_timeout', 1, group='conductor') CONF.set_override('rescue_callback_timeout', 1, group='conductor')
tgt_prov_state = states.RESCUE tgt_prov_state = states.RESCUE
node = obj_utils.create_test_node( node = obj_utils.create_test_node(
self.context, driver='fake-hardware', self.context, driver='fake-hardware',
 End of changes. 5 change blocks. 
2 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)