summaryrefslogtreecommitdiff
path: root/ironic_python_agent/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove nvme-cli warning and delay on nvme-formatJacob Anders2021-03-021-2/+2
| | | | | | | | | | This change adds '-f' flag to nvme-cli calls during NVMe Secure Erase. This removes nvme-cli output warning that the device is about to be irreversibly deleted as well as the related 10 second delay which is pointlessly increasing NVMe cleaning time. Story: 2008290 Change-Id: I7b7b8b7d4f643b07d5c9dcf7ec35cf7ebedf44d1
* Merge "Use try_execute from ironic-lib"Zuul2021-03-011-35/+40
|\
| * Use try_execute from ironic-libRiccardo Pittau2021-02-251-35/+40
| | | | | | | | | | | | Also adapt unit tests Change-Id: I37d050877daabc9dc0a5821cf20a689652b26f34
* | Allow clean_configuration to run against full-device arraysMohammed Naser2021-02-272-0/+42
|/ | | | | | | | | | | | At the moment, it is not possible for Ironic to clean up a RAID array that is built from an entire device. This patch allows it to do so by overriding the behaviour of attempting to find the device name if the device names does not end with a number and is a real block device. Story: #2008663 Task: #41948 Change-Id: I66b0990acaec45b1635795563987b99f9fa04ac7
* Merge "New deploy step for injecting arbitrary files"Zuul2021-02-222-0/+452
|\
| * New deploy step for injecting arbitrary filesDmitry Tantsur2021-02-162-0/+452
| | | | | | | | | | | | | | | | | | This change adds a deploy step inject_files that adds a flexible way to inject files into the instance. Change-Id: I0e70a2cbc13744195c9493a48662e465ec010dbe Story: #2008611 Task: #41794
* | Merge "Add support for using NVMe specific cleaning"Zuul2021-02-192-0/+527
|\ \
| * | Add support for using NVMe specific cleaningJacob Anders2021-02-182-0/+527
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds support for utilising NVMe specific cleaning tools on supported devices. This will remove the neccessity of using shred to securely delete the contents of a NVMe drive and enable using nvme-cli tools instead, improving cleaning performance and reducing wear on the device. Story: 2008290 Task: 41168 Change-Id: I2f63db9b739e53699bd5f164b79640927bf757d7
* | | Move some raid specific functions to raid_utilsRiccardo Pittau2021-02-172-24/+124
|/ / | | | | | | | | | | | | To reduce size of the hardware module and separate the raid specific code in raid_utils, we move some functions and adapt the tests. Change-Id: I73f6cf118575b627e66727d88d5567377c1999a0
* | Remove samples from the hardware test moduleRiccardo Pittau2021-02-122-887/+905
|/ | | | | | | They take a lot of space and tehy're mainly static data. Move them to a separate module that can also be shared with other tests. Change-Id: I9c76c014430d524da7fa331c922976d283b870c3
* Fix error message with UEFI-incompatible imagesDmitry Tantsur2021-02-101-0/+10
| | | | | | | | It's somewhat confusing at the moment, since we're trying to find a UEFI partition by UUID "None". Don't search for partition if we don't know its UUID, and provide a better error message. Change-Id: Ief874084132797a445ddae8009264712a05facfd
* Merge "Use variable for lsblk columns device info"Zuul2021-02-081-31/+40
|\
| * Use variable for lsblk columns device infoRiccardo Pittau2021-02-031-31/+40
| | | | | | | | | | | | | | | | Adjusted unit tests accordingly. Also removed redundant parenthesis. Change-Id: I8e2cac5172f009d5204f83bd83e1f27cfd721f09
* | Mock tests to return bios boot modeIury Gregory Melo Ferreira2021-02-031-0/+3
|/ | | | | | | | When running IPA unit tests on machines configured with UEFI and GPT partition table, some tests will fail. Change-Id: I155a47242b526b8f243a5e94bc14da8431f1ab91
* Merge "Handle situation when a configdrive is already mounted"6.5.0Zuul2020-12-211-1/+53
|\
| * Handle situation when a configdrive is already mountedDmitry Tantsur2020-12-161-1/+53
| | | | | | | | | | | | | | Glean mounts the configdrive and does not unmount it afterwards. If a mount point already exists, just use it. Change-Id: Ia62279afbb9fd9770864942dc40629b69ae8f4ae
* | Fix boot mode detection for partition imagesJulia Kreger2020-12-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Previously, partition images were hard coded to be bios based as opposed to consulting all of the values AND the node itself before making the most appropriate determination. Now the agent utilises the internal helper to properly determine the boot mode when calling ironic-lib. Story: 2008070 Task: 41265 Change-Id: Id5eeda69d5b9de2b393af414472d57b0d4380c43
* | Merge "Add fstab pointer to EFI partition"Zuul2020-12-171-7/+238
|\ \
| * | Add fstab pointer to EFI partitionJulia Kreger2020-12-171-7/+238
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds support for the EFI partition to be appended to fstab so the filesystem can be automounted and EFI loader updated should the deployed operating system need to do so. This should enable bootloaders to be upgraded by linux based operating systems after the instance has been deployed when a partition image was utilized for the initial deployment. Change-Id: Iec28a8841cc01ec8b01a3f5cca070c934c7a2531 Story: 2008070 Task: 40754
* | | Merge "Prevent broken partition image UEFI deploys"Zuul2020-12-171-5/+474
|\ \ \ | |/ /
| * | Prevent broken partition image UEFI deploysJulia Kreger2020-12-141-5/+474
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Partition images can sometimes contain a /boot folder structure event he assets for EFI booting on that filesystem. Which is a good thing. The conundrum is that Ironic does not handle this properly and potentially replaces the bootloader in this sequence such that grub2-install is used instead of signed bootloader assets. As such, we should be preserving the assets and using them from a partition image much like we do when we have a wholedisk image and can identify the assets. Now we will preserve the EFI boot assets, copy them to the new EFI boot partition, and call the EFI setup methods to manage the EFI nvram. Note, this change also splits the logic path out that performs the end call of the EFI boot manager into a reusable method but does not retool all of the testing as it is intertwined in the install_grub2 testing. Also adds some additional debug logging, as much of the bootloader installation code has multiple fallback/cleanup points which makes it difficult to debug from logs. Story: 2008070 Task: 40753 Change-Id: If17d4b4c06df5504987e61a1fde6662e9acd6989
* | | Merge "Fix default disk label with partition images"Zuul2020-12-171-0/+58
|\ \ \ | |/ / | | / | |/ |/|
| * Fix default disk label with partition imagesJulia Kreger2020-12-141-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | Partition images through the agent have the unfortunate side effect of being executed without full node context by default. Luckilly we've had a similar problem and cache the node. This patch changes the lookup from a default of msdos partitions to use the cached node object. Change-Id: I002816c9372fdf1cc32f3c67f420073551479fd9
* | Merge "Correctly decode error messages from ironic API"Zuul2020-12-161-5/+57
|\ \
| * | Correctly decode error messages from ironic APIDmitry Tantsur2020-12-071-5/+57
| | | | | | | | | | | | | | | | | | Knowing a status code is simply not enough for debugging. Change-Id: If1d3f182ab028948ff05aea7e8024d4e7bc3d53c
* | | Merge "Generate TLS certificates with validity time in the past"Zuul2020-12-151-0/+7
|\ \ \
| * | | Generate TLS certificates with validity time in the pastDmitry Tantsur2020-12-101-0/+7
| |/ / | | | | | | | | | | | | | | | | | | Otherwise a slight clock skew may prevent them from working, see e.g. https://bugzilla.redhat.com/show_bug.cgi?id=1906448. Change-Id: Icea103af06edef16c0dc4578877dc04cd6ec3b0c
* | | Merge "Copy any configuration from the virtual media"Zuul2020-12-141-74/+129
|\ \ \ | |_|/ |/| |
| * | Copy any configuration from the virtual mediaDmitry Tantsur2020-11-231-74/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For ramdisk TLS (and other potential future enhancements) we need to be able to inject configuration and certificates into the ramdisk. Since we cannot pass files through kernel parameters, we need to put them on the generated ISO or (in the future) config drive. This change detects IPA configuration and copies it into the ramdisk early enough for any configuration files to get picked. Changed /dev/disk/by-label to blkid since the former may not exist on all ramdisks (e.g. tinyIPA). Change-Id: Ic64d7842a59795bbf02f194221dedc07c6b56e8c
* | | Option to enable bootloader config failure bypassJulia Kreger2020-12-101-0/+121
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some hardware is very well intentioned. However this intention can result in the UEFI NVRAM table being full which prevents us from adding new records to the table. We can't be sure what to delete, so in this case some operators just need the ability to tell ironic "it is okay if this fails, it will still work." The added ``ignore_bootloader_failure`` option adds this capability which can be set per-node either in the agent configuation via the ramdisk image, or in the pxe_append_params configuration parameter for the node itself with a ``ipa-ignore-bootloader-failure`` option in order to prevent the failure from being raised. Change-Id: If3c83fb2ea2025fce092d495a64f32077c70d2d6 Story: 2008386 Task: 41309
* | Merge "Bring up VLAN interfaces and include in introspection report"Zuul2020-12-021-0/+180
|\ \ | |/ |/|
| * Bring up VLAN interfaces and include in introspection reportBob Fournier2020-11-201-0/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the ability to bring up VLAN interfaces and include them in the introspection report. A new configuration field is added - ``ipa-enable-vlan-interfaces``, which defines either the VLAN interface to enable, the interface to use, or 'all' - which indicates all interfaces. If the particular VLAN is not provided, IPA will use the lldp info for the interface to determine which VLANs should be enabled. Change-Id: Icb4f66a02b298b4d165ebb58134cd31029e535cc Story: 2008298 Task: 41183
* | Merge "Add clean step 'erase_pstore'"Zuul2020-11-181-0/+64
|\ \
| * | Add clean step 'erase_pstore'Arne Wiebalck2020-11-171-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an automatic clean step to clean the Linux kernel's pstore. The step is disabled by default. Story: #2008317 Task: #41214 Change-Id: Ie1a42dfff4c7e1c7abeaf39feca956bb9e2ea497
* | | Fix vendor info retrieval for some versions of lshwVladyslav Drok2020-11-161-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is one more place that relies on lshw json output being a dict, so let's fix the function that gets the dict rather than places it is being used in. Change-Id: Ia1c2c2e6a32c76ac0249e6a46e4cced18d6093a9 Task: 39527 Story: 2007588
* | | Merge "Log configuration options on start-up"Zuul2020-11-121-0/+2
|\ \ \
| * | | Log configuration options on start-upDmitry Tantsur2020-11-111-0/+2
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | This is very convenient for debugging and is something ironic and ironic-inspector already do. Register SSL options earlier so that they're accounted for. Change-Id: I56aca8eec1dfeb065ac657452a7076a9e3d17cc3
* | | Merge "Add UUID to BlockDevice object"Zuul2020-11-111-37/+37
|\ \ \ | |/ / |/| |
| * | Add UUID to BlockDevice objectVladyslav Drok2020-11-111-37/+37
| |/ | | | | | | | | | | | | | | | | It'd allow for example custom ansible playbooks to use UUIDs of the introspected node's disks. In future it might also enable agent to use UUID (or by_path value) to refer to a device instead of name, as it happens currently. Change-Id: Id00437d2295c39fb12f3c25a92b30b56a58eef13
* | Merge "Support using LABEL as identifier for rootfs"Zuul2020-11-101-5/+25
|\ \
| * | Support using LABEL as identifier for rootfsFedor Tarasenko2020-11-031-5/+25
| |/ | | | | | | | | | | | | | | | | Add possibility to use disk LABEL to identify rootfs uuid for Software RAID deployment Change-Id: I77f36e70ddc539af0190db1c1abe0fb2c66f34b4 Story: 2008303 Task: 41188
* | Fix physical memory calculation with new lshwVladyslav Drok2020-11-061-0/+10
|/ | | | | | | | | | | | | | It seems that fix Id5a30028b139c51cae6232cac73a50b917fea233 was dealing with a different issue. According to the description in the story, and the linked commit there, the problem is the fact that output is changed from dictionary to a list (with just one value supposedly?). This commit changes the isinstance call to check if an output of lshw is a list, and if so, we just use the first element of the list. Story: 2007588 Task: 39527 Change-Id: I87d87fd035701303e7d530a47b682db84e72ccb9
* Merge "Don't run os-prober from grub2-mkconfig"Zuul2020-11-011-8/+19
|\
| * Don't run os-prober from grub2-mkconfigJulia Kreger2020-10-221-8/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, grub2-mkconfig scans everything to look for other environments and then load those into the grub configuration. It makes sense, but on newer versions of grub2 in distribution images, os-prober is taking an exceptionally long time in some cases where more than one storage device exists with other filesystems. As a result, of the os-prober execution by grub2-mkconfig, the bootloader installation can completely time out and fail the deployment. This is presently experienced with metalsmith on centos8. There are numerous sporatic reports of issues like this issue where grub2-mkconfig hangs for some period of time, and this is observable on Centos8.2 in our CI. While one report[0] mentions this issue, Another bug [1] has the dialog that actually helps us frame the context as to what we likely should do. Also, fixes the unit testing so we actually test if we're running with grub2. :\ [0]: https://bugzilla.redhat.com/show_bug.cgi?id=1744693 [1]: https://bugzilla.redhat.com/show_bug.cgi?id=1709682 Depends-On: https://review.opendev.org/#/c/748315 Change-Id: I14bf299afef3a1ddb2006fe5f182d7f0d249e734
* | Allow manual setting of Ironic API VersionJay Faulkner2020-10-231-0/+13
|/ | | | | | | | | | Typically, the Ironic API client in IPA will autodetect the API version based on the output of a GET of the root of the API. If for some reason this API endpoint is restricted, or the operator wishes to limit the Ironic API version IPA uses, they can now set CONF.ironic_api_version to avoid autodetection and force a version. Change-Id: Ib96a1057792f45f2e4554671e32c436140463ee8
* Merge "Software RAID: Re-add missing devices"Zuul2020-10-121-10/+94
|\
| * Software RAID: Re-add missing devicesArne Wiebalck2020-10-061-10/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | Upon md device creation, component devices are sometimes removed immediately again due to a "disk failure". The disks seem healthy, though. This patch re-adds compoenent devices in such cases to prevent that the md device will remain in a degraded state (which would cause issues later, e.g. during ESP creation). Story: #2008164 Task: #40914 Change-Id: I2ac7cb4a546de84686d5c3435e850c14b3f6c1d7
* | Do not silently swallow errors in the write_image deploy stepDmitry Tantsur2020-10-091-0/+11
| | | | | | | | | | | | | | | | Calling join() does not raise, we need to explicitly check the result. Change-Id: I81d3d727af220c2b50358edab8139f07874611f0 Story: #2008240 Task: #41083
* | Merge "Reduce the duration of retries in the inspector tests"Zuul2020-10-081-0/+1
|\ \
| * | Reduce the duration of retries in the inspector testsDmitry Tantsur2020-10-071-0/+1
| | | | | | | | | | | | | | | | | | | | | Currently the test takes 5*5=25 seconds. Re-arrange the code so that it's possible to change the retry delay in tests. Change-Id: Ia559dad4bc656f8ad6b2cb8cb0137a97e2614db7