358 Commits

Author SHA1 Message Date
Doug Goldstein
b5c52e7cb0
add pyproject.toml to support pip 23.1
pip 23.1 removed the "setup.py install" for projects that do not have
their own pyproject.toml by having a hardcoded one within pip.

To address that, this change adds the minimal pyproject.toml
to enable pbr to be properly used to build editable wheels.

See https://pip.pypa.io/en/stable/news/#v23-1
and https://github.com/pypa/pip/issues/8368 for more info.

Change-Id: Id513bfda09688fc9ba7ea8dc7ae7304bf06994e6
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2024-10-28 11:23:49 -05:00
Mohammed Boukhalfa
7ca193c79d Add TLS option to external notifier
This is needed when fakeIPA is needed is running with TLS

Change-Id: Ida70590ac464992be61076ae1f2e5e9c13862983
Signed-off-by: Mohammed Boukhalfa <mohammed.boukhalfa@est.tech>
2024-10-28 12:00:56 +02:00
Takashi Kajinami
41b9683e27 Drop unnecessary 'x' bit from doc config file
This file is not actually executable.

Trivial-Fix

Change-Id: Ife7eec7b056e95ab0e7d2f38d277c38881dcad61
2024-10-24 22:58:11 +09:00
Mahnoor Asghar
84c1e8a804 Reject node power off requests to align with ironic supporting NCSI
Change-Id: I99b0c934ab97b01672d304900a54631db6401a87
2024-10-20 19:33:04 -04:00
Zuul
c5b64a27e1 Merge "Update irrelevant-files for sushy-jobs" 2024-08-07 13:44:39 +00:00
Zuul
5fea636ecb Merge "Translate VM name to UUID to avoid redirect issue" 1.3.0 2024-07-31 00:05:45 +00:00
Jacob Anders
4ff52c56f1 Translate VM name to UUID to avoid redirect issue
This change attempts to resolve redirect issue triggered by passing VM
name to UpdateService.SimpleUpdate by making an additional call to
libvirtdriver uuid method.

Change-Id: Ie20846b5c0fcce51465feeefb59ec521de7b2770
2024-07-30 23:09:33 +10:00
Mohammed Boukhalfa
4268005227 Extend the fake systems driver with external systems status notifier
The fake driver can now share the status of fake systems with any external component expected to run on the VMs. This update adds a function to notify an external API when the power status of a fake VM changes. The notification is sent via a PUT API method with the system object as a JSON parameter. This allows the receiver to implement an endpoint that triggers some process based on the new status.

Change-Id: I8897c4ce03fc02b3fec4152ff6d52a4e8e81013a
Signed-off-by: Mohammed Boukhalfa <mohammed.boukhalfa@est.tech>
2024-07-30 11:27:33 +03:00
Iury Gregory Melo Ferreira
b75d4cdb54 Update irrelevant-files for sushy-jobs
Currently the sushy-tools jobs will not run if the changes are made
in test-requirement or unit tests, this improve the config of our
jobs to not run when changes are made to:

- tox.ini
- setup.cfg
- doc/*
- releasenotes
- rst files

Change-Id: If2b683195212441a5d227f4c8a3af193f78f1b1c
2024-07-28 22:17:36 -03:00
Mohammed Boukhalfa
6958f7afef Add fake system driver docs
Co-authored-by: Dmitry Tantsur <dtantsur@protonmail.com>
Change-Id: I38b7e4d8c532d2158b7ab19ce40d76cc4e9450f3
2024-07-26 20:20:54 +03:00
Zuul
e402462e30 Merge "Add support for BIOS update emulation" 2024-07-12 13:37:58 +00:00
Jacob Anders
57e560f76a Add support for BIOS update emulation
This change adds UpdateService resource and SimpleUpdate action to
sushy-tools. The goal behind this addition is enabling support for
automated testing of firmware update functionality in virtualized
environments. Note: no actual firmware update is performed with these
API calls, the only result is incrementing the BiosVersion value stored
in instance metadata.

Change-Id: I22d9b7614a5a7243e08d40392a0a49a31ee00034
2024-07-12 21:24:32 +10:00
Zuul
bf4dbdbc53 Merge "Fix httpboot handling and unit tests" 2024-07-09 16:50:30 +00:00
Zuul
c4fb8531f9 Merge "Replace hardcoded BiosVersion with an updatable field" 2024-07-09 01:09:50 +00:00
Julia Kreger
fa0d9a357a Fix httpboot handling and unit tests
Turns out some of the unit tests needed some additional fixes which
were spotted when I ran my change to main.py, so those fixes
are included as well. Likely just rooted in brain typo-ing.

Change-Id: Ib9e30b6dc54dd7476dd854e1c4214ea3e235909e
2024-07-05 17:04:39 -07:00
Jacob Anders
bab6feb3a0 Replace hardcoded BiosVersion with an updatable field
Currently, BiosVersion value returned in respose to GET /System/
comes from a value hardcoded in template. This change replaces the
hardcoded value with a variable stored in sushy:bios metadata in the
libvirt xml definition of the VM.

Change-Id: Iaefc695c6cb177bc232112515c7b33c7b9af8b68
2024-07-04 07:17:51 +10:00
Cyril Roelandt
15b685886c Python 3.12: do not use ssl.wrap_socket
The ssl.wrap_socket method has been removed in 3.12.
SSLContext.wrap_socket should now be used.

Change-Id: Ic5acb1028ae702150b02f53c08e1b209ddf04dd8
2024-07-03 21:44:52 +02:00
Zuul
bb08bb4605 Merge "Add virtual-media-boot to openstack driver" 2024-05-29 10:01:56 +00:00
cid
4e3e3e9258 Fix codespell reported errors
Fix and ignore spelling errors raised by codespell

Change-Id: I745e4c0ba3d282232eb8853831407fbad6c8163f
2024-05-25 07:18:44 +01:00
Piotr Czarnik
240e8d754e Normalize relative path for emulator config file
Previously we couldn't use a relative path in --config option
because it was interpreted as a path relative to the package dir.

Task: 49792
Story: 2011082
Change-Id: I59664991079a969a5af93114a0ab45fd36a4bcbe
2024-03-29 13:45:38 +02:00
Harald Jensås
cc738adf26 [Libvirt] Support firmware auto-selection
Firmware auto-slection in Libvirt uses the QEMU firmware
description files to ease the burden on users.

This change adds support for get/set boot mode and secure
boot for domains created with firmware auto-selection.

Prior to this change operations on fw auto-selection domains
with errors such as:

  libvirt: Domain Config error : loader attribute 'readonly'
           cannot be specified when firmware autoselection is
           enabled

Change-Id: I533edb7a2a296026bb98977f7dd0de2acf553b7e
2024-03-27 04:44:15 +01:00
Steve Baker
fafb4b0b86 Add virtual-media-boot to openstack driver
The implementation does the following.

On insert:
- Upload the image directly to glance from the URL (long running)
- Create and attach a new volume the same size as the root disk
- Rebuild the server with the image, replacing the contents of the root
  disk
- Delete the image

On eject:
- Assume the attached volume has been rewritten with a new image (an ISO
  installer or IPA)
- Detach the volume
- Create an image from the volume (long running)
- Rebuild the server with the new image
- Delete the volume
- Delete the image

The long running operations are performed in a background thread task.
Only one long running operation (insert or eject) can be performed
concurrently for each server. If a long running operation fails, the
only way to feed that back to the user is by re-raising the error during
the next insert/eject request for that server.

The documentation is updated to describe OpenStack driver specifics.
Also the Redfish spec has deprecated accessing VirtualMedia via Managers
so the documentation is updated to refer via Systems.

Change-Id: I24ea943325a23a06887a185801211b4a9570e284
2024-03-13 09:41:54 +13:00
Zuul
cbc7e29ca8 Merge "Force constraints when installing a package during tox test" 1.2.0 2024-03-05 13:00:52 +00:00
Jacob Anders
ec49ec035c Add missing whitespaces in test_virtual_media_certificates()
Change-Id: I1fbfd873ca79950304d04e70baad83dd562197d2
2024-02-15 14:40:32 +10:00
Riccardo Pittau
0f9c9dc0c6 Force constraints when installing a package during tox test
The tox deps option grants installation of single dependencies and
requirements, optionally pinned using constraints, before installing
a package, therefore not granting installation of the correct
constraint during the package installation.
To fix that tox 4.4.0 has introduced the constrain_package_deps
option [1]

[1] https://tox.wiki/en/4.12.1/faq.html#using-constraint-files

Change-Id: I98e55372488fb0acc24d08b23ca6b41f7cb2764a
2024-02-12 15:01:49 +01:00
Steve Baker
382a548e31 Handle nova instance having no image
There will be no image when the instance boots from volume. In the
future there could be a fallback to fetch the metadata from the volume
but for now just return None for boot mode and secure boot.

Change-Id: I00576ee19571bd91683fd6c1754e0624e469b2c9
2024-02-01 18:08:53 +13:00
Sharpz7
905a39b4eb [codespell] Adding CI target for Tox Codespell
Third in a series of commits to add Codespell to Ironic Repos. This commit adds the Tox Target to CI

A future commit could potentially add a git-blame-ignore-revs file if their are lots of spelling mistakes that could clutter git blame.

Change-Id: I384db875eb9090e9d9e711af3479021bdbed5a26
2024-01-29 23:02:47 +00:00
Sharpz7
a4f23f3472 [codespell] Adding Tox Target for Codespell
Second in a series of commits to add Codespell to Ironic Repos. This one adds the command that was used to fix the spelling errors.

Future Commits will add CI support and potentially a git-blame-ignore-revs file if their are lots of spelling mistakes that could clutter git blame.

Change-Id: I3ab0d3acd2e008038605ea0fbfc4b199b312a6e5
2024-01-29 23:02:33 +00:00
Sharpz7
244620d8f5 [codespell] Fixing Spelling Mistakes
This is the first in a series of commits to add support for codespell. This is continuning the process completed in ironic-python-agent.

Future Commits will add a Tox Target, CI support and potentially a git-blame-ignore-revs file if their are lots of spelling mistakes that could clutter git blame.

Change-Id: I563e316ba9955766e28d9cec702387fac472c414
2024-01-29 19:12:47 +00:00
Zuul
5868dab414 Merge "Remove translation sections from setup.cfg" 2024-01-23 21:50:52 +00:00
Takashi Kajinami
70c119e381 Add Python 3.10 and 3.11 to supported versions
... according to the current PTI.

Change-Id: I6bc64d56a4d925ded50d5389723df1d9363f540b
2024-01-22 07:36:29 +00:00
Takashi Kajinami
70f037b1d9 Remove translation sections from setup.cfg
These translation sections are not needed anymore, Babel can generate
translation files without them.

Change-Id: Ief444d81e6a70960d40463568ab608c0991eba61
2024-01-22 07:36:22 +00:00
Takashi Kajinami
f907ec9c27 Fix broken unit tests with Werkzeug>=2.3.0
Werkzeug>=2.3.0 introduced a logic to detect incorrect Content-Type and
now returns 415 instead of 400 if an application tries to load request
body as json but Content-Type is not `application/json`.

This fixes the unit test broken by that change.

Change-Id: I3470813661be312eac7bbead91af7913aa15ac9d
2024-01-22 07:36:10 +00:00
Dmitry Tantsur
0e18baab40
Add feature sets to test with different available feature
* "full" is the default and provides all features
* "minimum" only provides boot settings
* "vmedia" is "minimum" plus virtual media and NICs

Closes-Bug: #2046153
Change-Id: I57cff90b1327104f65264d3fb87dafc89f3be521
1.1.0
2023-12-11 17:48:04 +01:00
Dmitry Tantsur
a654a033de
Expose VirtualMedia on Systems in addition to Managers
VirtualMedia on Managers is deprecated, so make System the primary
source while keeping compatibility.

Change-Id: I933d0d5c9f78109f46eb314bef05cc8d653d7137
2023-12-11 13:44:30 +01:00
Zuul
19acb66e91 Merge "Use WAL mode for SQLite cache" 2023-12-07 16:01:46 +00:00
Zuul
e901c91f62 Merge "Add new ironic driver" 2023-12-07 11:33:41 +00:00
Zuul
84fd13e14a Merge "Use a UUID instead of a named identity for httpboot" 2023-12-07 11:33:40 +00:00
Jakob Meng
361e0eef99 Use existing nvram path in libvirt driver to support session daemon mode
When libvirtd is started as a non-root user it does not have access to
folder /var/lib/libvirt. By default, libvirtd in session daemon mode
creates a nvram file at path ~/.config/libvirt/qemu/nvram/\
[DOMAIN]_VARS[EXT] instead [0],[1].

Querying the nvram path in session daemon mode is difficult because
libvirtd does not expose it nor $HOME of the user that runs the daemon.
As a workaround, this change will let libvirtd create the nvram file
path if it has not been previously defined [2]. However, if it had been
defined earlier then the path will be changed to enforce regenerating
it from the template.

[0] 2b148748c2/src/qemu/qemu_conf.c (L203)
[1] 2b148748c2/src/qemu/qemu_firmware.c (L1124)
[2] 2b148748c2/src/qemu/qemu_firmware.c (L1065)

Change-Id: Id78101f5c1f5fdf4b365d2d270dbde8877b05dbf
2023-12-04 21:24:30 +01:00
Julia Kreger
6b4e418d6d Use a UUID instead of a named identity for httpboot
This is an alternative to https://review.opendev.org/c/openstack/sushy-tools/+/902015
The tl;dr is we can leak the uuid out in some weird cases and
while things will just keep working, some methods internally
really just want a UUID and not a name. The other patch
is the name fix.

This, explicitly uses a UUID for httpboot, in the event
it is still happilly working with a name up until that point.

Change-Id: I52121f7e6148aaa3739bc9900b4480b7b3dff8fc
2023-11-28 09:05:12 -08:00
Julia Kreger
feb88a5c46 Simplify UEFI logic and change the UefiHttp flow
In trying to test the Redfish UEFI Http interface logic, it was
observed that we were not getting the values out of the emulator we
expected. So this change simplifies the logic which wasn't quite
working for us.

We also realized the code was trying to set the boot interface before
actually creating it. Doh!

It seems, also I might have had some other issues in the original patch
which we couldn't detect without fully getting everything working, so
some additional refactoring exists with this patch.

Change-Id: Ibfe5a560a25251965e8bad87012f64e89d9640be
2023-11-21 08:32:19 -08:00
Zuul
b5edaadd8d Merge "Add Support testing for HttpBootUri" 2023-11-13 10:03:20 +00:00
Julia Kreger
e14cfe361d Add Support testing for HttpBootUri
Maps the HttpBootUri to the virtual media functionality, so we can
leverage sushy-tools for testing HttpBootUri functionality.

Change-Id: I51a7e684bafdb6b3aa9adda35ae438c747c9847a
2023-11-03 07:12:46 -07:00
Iury Gregory Melo Ferreira
37f118237a Add BiosVersion field to System
Currently we don't have the BiosVersion information when
we query the System resource in sushy-tools, this cause
problems when checking the information with Firmware Interface

Change-Id: I8b5bf1387f32bd4d4bd91d3211782d900320b319
1.0.1
2023-10-25 09:44:21 -03:00
Derek Higgins
79cd737e65 Add new ironic driver
Add a driver to provide a limited emulated redfish
API to ironic nodes. This would be needed in cases
where a redfish compatible endpoint is needed but
but don't have direct access to the BMC (you only
have access via Ironic) or the BMC doesn't support
redfish.

Change-Id: I9a3f6a178978ef25efe5129d8bf5f94e031d9751
2023-10-09 17:56:31 +01:00
Dmitry Tantsur
259671612a Use WAL mode for SQLite cache
Change-Id: Idcca63c5365ef741a9f137a2b3b500b0c6cb7cef
2023-09-14 15:08:35 +02:00
Jay Faulkner
0246649c06 Update pep8 deps - now on latest hacking v6
Hacking bumped to 6.0.0.
No code changes needed for flake8.

Change-Id: I2bd57cd682081687f93baf4ffdd23b7332edb05c
1.0.0
2023-04-21 12:59:39 -07:00
Michele Costa
4357bf2347 Ignore FileNotFoundError when ejecting virtual media image
As these files are in /tmp the can be garbage collected
causing a FileNotFoundError. As it is trying to remove
the file anyway there is no reason to propogate this
error as the end result is the same.

Change-Id: If44be26e3fba70b89aec6ba88743d740276e7560
2023-02-21 14:14:33 +00:00
Zuul
7115db2f3a Merge "Save previous hd boot device when setting Pxe" 2023-02-17 17:45:33 +00:00
Zuul
e15cd2c2b4 Merge "Add mac address to the fakedriver node" 2023-02-16 16:29:37 +00:00