summaryrefslogtreecommitdiff
path: root/ironic_python_agent/tests/unit
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Improve efficiency of storage cleaning in mixed media envsJacob Anders2022-03-151-4/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://storyboard.openstack.org/#!/story/2008290 added support for NVMe-native storage cleaning, greatly improving storage clean times on NVMe-based nodes as well as reducing device wear. This is a follow up change which aims to make further improvements to cleaning efficiency in mixed NVMe-HDD environments. This is achieved by combining NVMe-native cleaning methods on NVMe devices with traditional metadata clean on non-NVMe devices. Story: 2009264 Task: 43498 Change-Id: I445d8f4aaa6cd191d2e540032aed3148fdbff341
* | | Merge "Create fstab entry with appropriate label"Zuul2022-03-113-4/+76
|\ \ \
| * | | Create fstab entry with appropriate labelJulia Kreger2022-03-103-4/+76
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Depending on the how the stars align with partition images being written to a remote system, we *may* end up with *either* a Partition UUID value, or a Partition's UUID value. Which are distinctly different. This is becasue the value, when collected as a result of writing an image to disk *falls* back and passes the value to enable partition discovery and matching. Later on, when we realized we ought to create an fstab entry, we blindly re-used the value thinking it was, indeed, always a Partition's UUID and not the Partition UUID. Obviously, the label type is quite explicit, either UUID or PARTUUID respectively, when initial ramdisk utilities such as dracut are searching and mounting filesystems. Adds capability to identify the correct label to utilize based upon the current state of the block devices on disk. Granted, we are likely only exposed to this because of IO race conditions under high concurrecy load operations. Normally this would only be seen on test VMs, but systems being backed by a Storage Area Network *can* exibit the same IO race conditions as virtual machines. Change-Id: I953c936cbf8fad889108cbf4e50b1a15f511b38c Resolves: rhbz#2058717 Story: #2009881 Task: 44623
* | | Merge "Run partx in verbose mode to simplify debugging"Zuul2022-03-083-54/+54
|\ \ \
| * | | Run partx in verbose mode to simplify debuggingDmitry Tantsur2022-02-143-54/+54
| | |/ | |/| | | | | | | | | | | | | Otherwise the actual failure cause is not recorded. Change-Id: If66ee97016ddf0e5c3f40ad9400ff3bc6fdebedc
* | | Merge "Add `mount` and `parted -l` to the collected commands"Zuul2022-03-081-4/+8
|\ \ \
| * | | Add `mount` and `parted -l` to the collected commandsDmitry Tantsur2022-02-141-4/+8
| |/ / | | | | | | | | | Change-Id: I1c759552220291890704d0002a62ea3f51701691
* | | Merge "Rescan device after filesystem creation"Zuul2022-03-071-4/+13
|\ \ \ | |_|/ |/| |
| * | Rescan device after filesystem creationVanou Ishii2022-02-111-4/+13
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | In work_on_disk function, IPA runs mkfs commands without following device rescan operation. This leads to incorrect content of uuids_to_return to be returned. These mkfs commands modify partition label but IPA fails to catch such changes because of no following device rescan operation. This commit adds call of device rescan function before uuids_to_return construction. Change-Id: I4e8b30deb5e2247f51ce8f10bd3271f64a264089
* | Move prepare_boot_partitions_for_softraid to raid_utilsArne Wiebalck2022-02-143-210/+222
|/ | | | | | | | | | | prepare_boot_partitions_for_softraid() is used in BIOS and UEFI modes to prepare the partitions for the bootloader. Move it from the image extensions to raid_utils to reflect this and avoid the import of an extension to efi_utils. Follow-up to 62c5674a600baeeef0af3b12baeab486870eb103. Change-Id: I9f5974fbbfea5e8cdfbb7e49bea375e5cbfdd145
* Use canonical device name for RAID device for ESPDmitry Tantsur2022-02-012-15/+53
| | | | | | | | | | It seems like tinyIPA silently replaces /dev/md/esp with /dev/md127. Find the next free /dev/md device and use it instead. Also rescan the resulting device before copying files. Change-Id: Ie04f530be434c4b1561e75f387b9da679e4607e0 Depends-On: https://review.opendev.org/c/openstack/ironic/+/827129/
* SoftwareRAID: Use efibootmgr (and drop grub2-install)Arne Wiebalck2022-01-263-27/+94
| | | | | | | | | | | | | | | Move the software RAID code path from grub2-install to efibootmgr: - remove the UEFI efibootmgr exception for software RAID - create and populate the ESPs on the holder disks - update the NVRAM with all ESPs (the component devices of the ESP mirror, use unique labels to avoid unintentional deduplication of entries in the NVRAM) Story: #2009794 Change-Id: I7ed34e595215194a589c2f1cd0b39ff0336da8f1
* Burn-in: Dynamic network pairingArne Wiebalck2022-01-101-0/+136
| | | | | | | | | | | | | Pair nodes dynamically via a distributed coordination backend for network burn-in. The algorithm uses a group to pair nodes: after acquiring a lock, a first node joins the group, releases the lock, waits for a second node, then they both leave, and release the lock for the next pair. Story: #2007523 Task: #42796 Change-Id: I572093b144bc90a49cd76929c7e8685ed45d9f6e
* Merge "Burn-in: Add options for named log files"8.3.0Zuul2021-12-091-14/+77
|\
| * Burn-in: Add options for named log filesArne Wiebalck2021-12-081-14/+77
| | | | | | | | | | | | | | | | | | | | | | | | In order to ease logging of the various burn-in steps, this patch proposes options to define the outpout files for all burn-in steps: {'agent_burnin_cpu', 'agent_burnin_vm', 'agent_burnin_fio_network', 'agent_burnin_fio_disk'}_outputfile via a node's driver-info. Story: #2007523 Task: #44102 Change-Id: I327cae5949d38e738d3c535487b3795d00ad8f1e
* | Merge "Instruct qemu-img to write image zeros to disk."Zuul2021-12-091-1/+2
|\ \
| * | Instruct qemu-img to write image zeros to disk.Derek Higgins2021-12-081-1/+2
| |/ | | | | | | | | | | | | | | | | | | Doing this will cause it not to zero out the entire block device which can be very costly on a slow HDD. Story: 2009227 Task: 43315 Change-Id: I62ba2afc037d9844387e6b0984fe5008779d95d2
* | Merge "Burn-in: Add SMART self test to disk burn-in"Zuul2021-12-091-0/+77
|\ \ | |/ |/|
| * Burn-in: Add SMART self test to disk burn-inArne Wiebalck2021-12-061-0/+77
| | | | | | | | | | | | | | | | | | | | | | Add the option to run a SMART self test right after the disk burn-in. The disk burn-in step will fail if the SMART test on any of the disk fails. Story: #2007523 Task: #43383 Change-Id: I1312d5b71bedd044581a136af0b4c43769d21877
* | Get rid of lambda in RealFilePartitioningTestCaseIury Gregory Melo Ferreira2021-11-251-10/+14
|/ | | | | | | This commit changes the lambda usage in the RealFilePartitioningTestCase to autospec to avoid problems with unexpected args. Change-Id: I21356a7783f105dde9ff0d3777e2a06f3f28a786
* Merge "Call execute from ironic-lib in hardware.py"Zuul2021-11-221-131/+127
|\
| * Call execute from ironic-lib in hardware.pyRiccardo Pittau2021-11-181-131/+127
| | | | | | | | | | | | | | | | | | Replace the execute wrapper from utils with execute from ironic-lib in hardware.py Adjust unit tests as needed. Change-Id: I63a3b0407b2ca2246bd0e6624bfa0f748c0d73f7
* | Fix compatibility with disk_utils.find_efi_partitionDmitry Tantsur2021-11-192-10/+10
| | | | | | | | | | | | | | | | | | | | This function returns the complete block device record, not just number. Fixes regression in 89bc73aa0105850c6ae44428642e31802bba3b20. Also fix the incorrect job in the gate queue, which prevented us from catching this issue on merging. Change-Id: I4cbc359ceabfc193ce18fed14a1952359460e7d9
* | Use two more functions from disk_utilsDmitry Tantsur2021-11-183-96/+13
|/ | | | Change-Id: If01c9cd7f95b4495509369786360741b731161db
* Move manage_uefi from the image extension to a public locationDmitry Tantsur2021-11-163-455/+459
| | | | | | | | | | This call is very useful for custom deploy implementations, such as one we maintain for OpenShift. Splitting it out also makes image.py slightly more manageable. The get_partition call is moved to partition_utils. Change-Id: I60a6a2823d3eb27a4ae78e913e3655dae7b54ffe
* Merge "Simplify error messages when running clean/deploy step"Zuul2021-11-132-2/+50
|\
| * Simplify error messages when running clean/deploy stepDmitry Tantsur2021-11-092-2/+50
| | | | | | | | | | | | | | | | | | | | | | The caller knows what step it invokes, there is no point in repeating it in the error message. There is also no need to wrap the exception if it's a RESTError or an ironic-lib exception already since they are normally detailed enough. Only leave a detailed message when an unexpected exception happens. Change-Id: I1d8ca1e7ed1462159e4ae5f0bcf58686f6a2681c
* | Move rescan device function to general utilsRiccardo Pittau2021-11-101-111/+185
| | | | | | | | | | | | | | We use basically the same function in two modules in the same way, let's put that in a common place. Change-Id: I4016e43f2cb102d4327bafcc8a2f90112a6f944a
* | Re-read the partition table with partx -a, part 2Riccardo Pittau2021-11-091-42/+42
|/ | | | | | | | | | | | Use add instead of update to re-read the partition table with partx. See [1] for more details. Co-authored-by: Arne Wiebalck <arne.wiebalck@cern.ch> [1] https: //opendev.org/openstack/ironic-python-agent/commit/dc8c1f16f9a00e2bff21612d1a9cf0ea0f3addf0 Change-Id: I2336e22dadc790cfbde87904612fcaa3b8c501db
* Re-read the partition table with partx -aArne Wiebalck2021-11-061-16/+16
| | | | | | | | | | | Re-read the partition table with 'partx -a', rather than 'partx -u'. This should fix an timing issue where the bootloader installation fails to mount the EFI partition from a whole disk image since it is not yet aware of the new partitions (observed with both, the iscsi and the direct deploy interface). Change-Id: If5da3075e813ae01df3decf8f0647aba111b0515
* Merge "Fix UEFI record regex"Zuul2021-11-051-5/+67
|\
| * Fix UEFI record regexJulia Kreger2021-11-041-5/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | I accidently put colons on the test data and remembered taking the colon character out of the regex I was working on, but apparently left it in, and accounted for the active entry indicator flag which appears to have inconsistent support across vendors. The regex has been fixed, and a test added from a Lenovo SR650 which has some additional string entry data in the UEFI output which may separate entries. Change-Id: I1f67b0fb1f645fa82e98bd7c7bba3ffc7755cc74
* | Merge "Always include the oslo_log log file in ramdisk logs"Zuul2021-11-043-3/+59
|\ \ | |/ |/|
| * Always include the oslo_log log file in ramdisk logsDmitry Tantsur2021-10-283-3/+59
| | | | | | | | | | | | | | Even if journald is present, there is no guarantee that IPA logs there (this is the case in container-based ramdisks). Change-Id: Iceeab0010827728711e19e5b031ccac55fe1efde
* | Merge "Stop requiring mocking of utils.execute if ironic-lib execute is mocked"Zuul2021-11-032-17/+1
|\ \
| * | Stop requiring mocking of utils.execute if ironic-lib execute is mockedDmitry Tantsur2021-10-272-17/+1
| |/ | | | | | | | | | | | | | | | | | | 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
* | Delete EFI boot entry duplicate labels firstJulia Kreger2021-11-011-9/+26
|/ | | | | | | | | | | | | | | | | | | | | | | Some firmware seems to take an objection with EFI nvram entries being deleted after one is added, resulting in the entire entry table being reset to the last known good state. This is problematic, as ultimately deployments can time out if we previously booted with Networking, and the machine, while commanded to do other wise, reboots back to networking regardless. We will now delete entries first, before proceeding. Additionally, for general use, this pattern may serve the community better by avoiding cases where we would have previously just relied upon efibootmgr[0] to warn us of duplicate entries. [0]: https://github.com/rhboot/efibootmgr/blob/103aa22ece98f09fe3ea2a0c83988f0ee2d0e5a8/src/efibootmgr.c#L228 Change-Id: Ib61a7100a059e79a8b0901fd8f46b9bc41d657dc Story: 2009649 Task: 43808
* Respect global parameters when downloading a configdriveDmitry Tantsur2021-10-201-6/+59
| | | | | | | | * Use the same TLS parameters as everything else * Respect image_download_connection_timeout * Do not ignore HTTP errors Change-Id: I84f8021f731186d82e44ac3d4ef2d12df13f830a
* Merge "Check the network burnin roles and partner"Zuul2021-09-021-0/+21
|\
| * Check the network burnin roles and partnerArne Wiebalck2021-08-101-0/+21
| | | | | | | | | | | | | | | | The network burnin roles are 'reader' and 'writer'. Raise an error if the role is not provided or if the role is unknown. Equally, raise an error if the partner is not provided. Change-Id: I6259a7b0d15d62e68b1dc27f0cb511f8563c02ce
* | Merge "Move loading of IPMI module loading to a single point"Zuul2021-08-232-51/+48
|\ \
| * | Move loading of IPMI module loading to a single pointJonas Schäfer2021-08-062-51/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | This means we do not have to rely on modprobe idempotency as much and it's less code duplication, which is always nice. Signed-off-by: Jonas Schäfer <jonas.schaefer@cloudandheat.com> Change-Id: I996aba47bc54309e15e7d56e4a96b23b8deb5c9c
* | | Merge "Output verbose info from efibootmgr"Zuul2021-08-111-19/+19
|\ \ \
| * | | Output verbose info from efibootmgrDerek Higgins2021-08-031-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When debugging boot manager problems it can be advantageous to see all the full entries rather then just their labels. Change-Id: I6a1bb78acaf5a4284727bdf533d4be6db2099f50
* | | | Merge "Increase version of hacking and pycodestyle"Zuul2021-08-111-2/+2
|\ \ \ \ | |_|_|/ |/| | |
| * | | Increase version of hacking and pycodestyleRiccardo Pittau2021-07-301-2/+2
| |/ / | | | | | | | | | | | | | | | Fix H904 "Delay string interpolations at logging calls" errors Change-Id: I331808d0132094faf739998a6984440787d3ebf8
* | | Merge "Expose BMC MAC address in inventory data"Zuul2021-08-081-0/+63
|\ \ \ | |/ / |/| / | |/
| * Expose BMC MAC address in inventory dataJonas Schäfer2021-08-061-0/+63
| | | | | | | | | | | | | | | | | | | | This exposes the MAC address of the first LAN channel with an assigned IP address in the inventory data. This is useful for inventory processes where the asset number is not discoverable from the software side: the BMC MAC is going to be unique (at least within an organization). Change-Id: I8a4bee0c25743befd7f2033e4e0cba26895c8926
* | Merge "Force immediate NTP time sync with chronyd at IPA startup"8.1.0Zuul2021-07-202-31/+8
|\ \ | |/ |/|
| * Force immediate NTP time sync with chronyd at IPA startupArne Wiebalck2021-07-162-31/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to make sure we have the correct time early, e.g. by the time we create a TLS certificate, this patch proposes to force an immediate NTP update when using chronyd. While the previous approach uses the passed NTP server as well, the update may happen only after chronyd has performed measurements (which may be too late). Story: #2009058 Task: #42843 Change-Id: I6edafe8edeb8549f324959e7a1ec175c3049a515