9 Commits

Author SHA1 Message Date
Zuul
a4b73058ee Merge "Always include the oslo_log log file in ramdisk logs" 2021-11-04 15:14:33 +00:00
Dmitry Tantsur
2cedaa53c2 Always include the oslo_log log file in ramdisk logs
Even if journald is present, there is no guarantee that IPA logs there
(this is the case in container-based ramdisks).

Change-Id: Iceeab0010827728711e19e5b031ccac55fe1efde
2021-10-28 18:32:40 +02:00
Dmitry Tantsur
b360214cf2 Stop requiring mocking of utils.execute if ironic-lib execute is mocked
Based on unit tests, this was done intentionally, but I don't see
reasons for that. It makes refactoring much harder, because sometimes
you need to mock both execute functions and test them separately.

In the end, utils.execute should be removed.

Change-Id: I5a9c694ebe626c54f219d4870eab0a592777518d
2021-10-27 14:24:00 +02:00
Julia Kreger
c76b8b2c21 Limit Inspection->Lookup->Heartbeat lag
Caches hardware information collected during inspection
so that the initial lookup can occur without any delay.

Also adds logging to track how long inventory collection takes.

Co-Authored-By: Dmitry Tantsur <dtantsur@protonmail.com>
Change-Id: I3e0d237d37219e783d81913fa6cc490492b3f96a
2020-07-03 10:32:26 +02:00
Dmitry Tantsur
9d4cf5532f Add a deploy step for writing an image
The new step just invokes the appropriate method of the standby extension.

Change-Id: Ic74f83ab2b7e58f8e4b46e0abfab79e221afeb3e
Story: 2006963
2020-06-02 15:23:54 +02:00
John L. Villalovos
fc3de87469 Fix issue with double mocking of utils.execute functions
An issue was discovered if we mock an already mock-ed function. This
was happening in our execute() detection code. Change it to not use a
mock and instead a function.

Add unit tests to show it works as intended.

Change-Id: Ia116b355e7adb3cbfb8ae34f4d59bf527f2889bb
2017-12-01 07:42:02 -08:00
Vasyl Saienko
c4f10dce13 Use oslo_config.fixture in unit tests
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
2017-11-09 17:01:26 +02:00
John L. Villalovos
ef838dd6bb Improve the catching of calls to 'execute' related functions
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
2017-10-23 08:44:23 -07:00
Julian Edwards
f57cbccf8b Prevent tests' unmocked access to utils.execute()
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
2017-05-15 10:48:43 +10:00