ironic-inspector/ironic_inspector/test/unit
dparalen 7e72ceffd1 Terminal state transitions in transactions
Multiple spots were not using DB transactions when processing the terminal
state transitions (error, abort, finish, timeout). The pattern looked like
this:

    node_info.fsm_event(istate.Events.error)
    # more code
    node_info.finished(error='Oops!')

which led to brief periodes of state inconsistency of NodeInfo records in
the DB.

This patch refactors the NodeInfo.finished() method to require a terminal state
transition to perform as part of the NodeInfo state update:

   NodeInfo().finished(istate.Events.finish)
   NodeInfo().finished(istate.Events.abort, 'Canceled by operator')

This patch also introduces a new state: aborting to allow the inspector to
try call power-off the node before marking the introspection aborted.

There's a new DB migration since the new state implies a schema change too
(Enum).

Closes-Bug: #1721233
Closes-Bug: #1721230
Closes-Bug: #1723384

Change-Id: I0bb051d1956a996ed006d55a5ca2d670d9455047
2017-12-19 18:15:31 +01:00
..
__init__.py Move unit tests to "unit" directory 2016-04-05 11:15:29 +03:00
policy_fixture.py Add request context and policy enforcement 2017-10-13 11:55:52 +00:00
test_api_tools.py Add API for listing all introspection statuses 2016-11-21 15:58:24 +01:00
test_common_ironic.py Use flake8-import-order 2017-02-16 10:11:06 -08:00
test_db.py Use new oslo db EngineFacade 2017-06-15 14:25:55 +03:00
test_introspect.py Terminal state transitions in transactions 2017-12-19 18:15:31 +01:00
test_iptables.py Refactoring the firewall 2017-10-19 16:38:15 +02:00
test_keystone.py Clean up deprecated configuration options 2017-01-27 10:22:55 +01:00
test_main.py pep8: Add 'application-import-names = ironic_inspector' 2017-10-16 14:24:48 -07:00
test_migrations.py Use new oslo db EngineFacade 2017-06-15 14:25:55 +03:00
test_node_cache.py Terminal state transitions in transactions 2017-12-19 18:15:31 +01:00
test_plugins_base.py Allow hooks to have dependencies on other hooks 2017-04-26 19:13:52 +02:00
test_plugins_capabilities.py Add a plugin for capabilities detection 2016-06-06 13:18:09 +00:00
test_plugins_discovery.py Use flake8-import-order 2017-02-16 10:11:06 -08:00
test_plugins_extra_hardware.py Changed an assert to more specific assert method 2016-08-30 08:07:31 +07:00
test_plugins_lldp_basic.py Add plugin to process basic management LLDP TLVs 2017-01-31 19:51:39 -05:00
test_plugins_local_link_connection.py Use processed lldp data, if available, for local_link_connection plugin 2017-04-10 14:34:22 -04:00
test_plugins_pci_devices.py Use assertEqual() instead of assertDictEqual() 2016-09-26 11:07:27 +07:00
test_plugins_raid_device.py Remove deprecated alias "root_device_hint" for "raid_device" hook 2016-06-06 19:07:24 +02:00
test_plugins_rules.py Replace assertRaisesRegexp with assertRaisesRegex 2016-09-05 08:57:47 -04:00
test_plugins_standard.py add disabled option to VALID_ADD_PORTS_VALUES 2017-06-23 10:09:45 -07:00
test_process.py Terminal state transitions in transactions 2017-12-19 18:15:31 +01:00
test_pxe_filter.py Support manage_firewall during deprecation period 2017-10-19 17:10:27 +02:00
test_rules.py Merge "Remove rollback support from introspection rules" 2017-05-18 15:24:48 +00:00
test_swift.py Just "import mock" as it works for Python 2 and 3 2017-10-13 10:27:05 -07:00
test_utils.py Merge "Add request context and policy enforcement" 2017-10-19 21:40:24 +00:00
test_wsgi_service.py Refactoring the firewall 2017-10-19 16:38:15 +02:00