It provides cleaner per-tests config objects, with more options to
configure the fixture.
Also, allow overriding config fixture in particular test cases if
needed.
Change-Id: I2e9945b6168d97d7ee861924ac2f4ca5cd03dde2
Improve the catching of calls to 'execute' related functions in unit
tests. Before we only caught calls to utils.execute(). Now we catch
calls to:
ironic_lib.utils.execute()
processutils.execute()
subprocess.call()
subprocess.check_call()
subprocess.check_output()
utils.execute()
Change-Id: If4720ebed00f15c2a19cb8badbe4dc3c808eeece
This change introduces a new base test class that mocks out
utils.execute and forces an exception if it gets called.
This has rooted out many tests that were doing this as a side effect of
calling other functions, doing things like modprobe and running iscsi
on the host's actual machine.
The tests are all now appropriately patched in places where this was
happening, and the new base class permanently prevents this from
accidentally happening again.
If you really want to call utils.execute() then you need to re-mock it
in your unit test.
Change-Id: Idf87d09a9c01a6bfe2767f8becabe65c02983518