* [PATCH 0/2] Add functional test for ACPI PCI hotplug
@ 2025-05-27 15:02 Gustavo Romero
2025-05-27 15:02 ` [PATCH 1/2] tests/functional/test_aarch64_hotplug_pci: Update SHA Gustavo Romero
2025-05-27 15:02 ` [PATCH 2/2] tests/functional/test_aarch64_hotplug_pci: Add test for ACPI PCI hotplug Gustavo Romero
0 siblings, 2 replies; 6+ messages in thread
From: Gustavo Romero @ 2025-05-27 15:02 UTC (permalink / raw)
To: qemu-devel, eric.auger; +Cc: qemu-arm, thuth, gustavo.romero, alex.bennee
This series update the current functional test for PCI hotplug to
support testing the ACPI PCI hotplug.
The SHAs for the linux and initrd images are also update, but probably
we need to point them to immutable images instead of updating the SHAs.
This series must be applied on top of the ACPI PCI hotplug for ARM64
series (yet under review):
https://lists.nongnu.org/archive/html/qemu-devel/2025-05/msg03487.html
Cheers,
Gustavo
Gustavo Romero (2):
tests/functional/test_aarch64_hotplug_pci: Update SHA
tests/functional/test_aarch64_hotplug_pci: Add test for ACPI PCI
hotplug
tests/functional/test_aarch64_hotplug_pci.py | 28 +++++++++++++++++---
1 file changed, 25 insertions(+), 3 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] tests/functional/test_aarch64_hotplug_pci: Update SHA
2025-05-27 15:02 [PATCH 0/2] Add functional test for ACPI PCI hotplug Gustavo Romero
@ 2025-05-27 15:02 ` Gustavo Romero
2025-05-27 15:11 ` Thomas Huth
2025-05-27 15:02 ` [PATCH 2/2] tests/functional/test_aarch64_hotplug_pci: Add test for ACPI PCI hotplug Gustavo Romero
1 sibling, 1 reply; 6+ messages in thread
From: Gustavo Romero @ 2025-05-27 15:02 UTC (permalink / raw)
To: qemu-devel, eric.auger; +Cc: qemu-arm, thuth, gustavo.romero, alex.bennee
Update SHA for 'linux' and 'initrd.gz' images.
Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
---
tests/functional/test_aarch64_hotplug_pci.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/functional/test_aarch64_hotplug_pci.py b/tests/functional/test_aarch64_hotplug_pci.py
index fa1bb62c8f..bb2c121503 100755
--- a/tests/functional/test_aarch64_hotplug_pci.py
+++ b/tests/functional/test_aarch64_hotplug_pci.py
@@ -20,12 +20,12 @@ class HotplugPCI(LinuxKernelTest):
ASSET_KERNEL = Asset(
('https://ftp.debian.org/debian/dists/stable/main/installer-arm64/'
'current/images/netboot/debian-installer/arm64/linux'),
- '3821d4db56d42c6a4eac62f31846e35465940afd87746b4cfcdf5c9eca3117b2')
+ 'd92a60392ce1e379ca198a1a820899f8f0d39a62d047c41ab79492f81541a9d9')
ASSET_INITRD = Asset(
('https://ftp.debian.org/debian/dists/stable/main/installer-arm64/'
'current/images/netboot/debian-installer/arm64/initrd.gz'),
- '2583ec22b45265ad69e82f198674f53d4cd85be124fe012eedc2fd91156bc4b4')
+ '9f817f76951f3237bca8216bee35267bfb826815687f4b2fcdd5e6c2a917790c')
def test_hotplug_pci(self):
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] tests/functional/test_aarch64_hotplug_pci: Add test for ACPI PCI hotplug
2025-05-27 15:02 [PATCH 0/2] Add functional test for ACPI PCI hotplug Gustavo Romero
2025-05-27 15:02 ` [PATCH 1/2] tests/functional/test_aarch64_hotplug_pci: Update SHA Gustavo Romero
@ 2025-05-27 15:02 ` Gustavo Romero
2025-05-28 2:13 ` Gustavo Romero
1 sibling, 1 reply; 6+ messages in thread
From: Gustavo Romero @ 2025-05-27 15:02 UTC (permalink / raw)
To: qemu-devel, eric.auger; +Cc: qemu-arm, thuth, gustavo.romero, alex.bennee
Currently, test_aarch64_hotplug_pci only tests PCI hotplug using the
native PCI hotplug mechanism. Now that aarch64 supports PCI hotplug via
the ACPI mechanism it's time to support it in the test as well.
Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
---
tests/functional/test_aarch64_hotplug_pci.py | 24 +++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/tests/functional/test_aarch64_hotplug_pci.py b/tests/functional/test_aarch64_hotplug_pci.py
index bb2c121503..862bb6746b 100755
--- a/tests/functional/test_aarch64_hotplug_pci.py
+++ b/tests/functional/test_aarch64_hotplug_pci.py
@@ -27,11 +27,26 @@ class HotplugPCI(LinuxKernelTest):
'current/images/netboot/debian-installer/arm64/initrd.gz'),
'9f817f76951f3237bca8216bee35267bfb826815687f4b2fcdd5e6c2a917790c')
- def test_hotplug_pci(self):
+ def run_vm_and_test_hotplug_pci(self, use_acpi_pci_hotplug=False):
+ """
+ Run an aarch64 VM and test the PCI hotplug mechanism by plugging and
+ unplugging a PCI network adapter to the VM. Proper plug and unplug of
+ the adapter is verified by checking if the network device is correctly
+ added and removed in Linux.
+
+ Parameters
+ ----------
+ use_acpi_pci_hotplug : bool
+ If true the ACPI PCI hotplug mechanim is used, otherwise the
+ Native PCIe Hotplug mechanism is used.
+ """
+
+ acpi_pci_hotplug = "on" if use_acpi_pci_hotplug else "off"
self.set_machine('virt')
self.vm.add_args('-m', '512M')
self.vm.add_args('-cpu', 'cortex-a57')
+ self.vm.add_args('-machine', f"acpi-pcihp={acpi_pci_hotplug}")
self.vm.add_args('-append',
'console=ttyAMA0,115200 init=/bin/sh')
self.vm.add_args('-device',
@@ -70,5 +85,12 @@ def test_hotplug_pci(self):
'ls -l /sys/class/net | wc -l',
'2')
+ def test_native_pci_hotplug(self):
+ self.run_vm_and_test_hotplug_pci(use_acpi_pci_hotplug=False)
+
+ def test_acpi_pci_hotplug(self):
+ self.run_vm_and_test_hotplug_pci(use_acpi_pci_hotplug=True)
+
+
if __name__ == '__main__':
LinuxKernelTest.main()
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] tests/functional/test_aarch64_hotplug_pci: Update SHA
2025-05-27 15:02 ` [PATCH 1/2] tests/functional/test_aarch64_hotplug_pci: Update SHA Gustavo Romero
@ 2025-05-27 15:11 ` Thomas Huth
2025-05-28 2:09 ` Gustavo Romero
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Huth @ 2025-05-27 15:11 UTC (permalink / raw)
To: Gustavo Romero, qemu-devel, eric.auger; +Cc: qemu-arm, alex.bennee
On 27/05/2025 17.02, Gustavo Romero wrote:
> Update SHA for 'linux' and 'initrd.gz' images.
>
> Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
> ---
> tests/functional/test_aarch64_hotplug_pci.py | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tests/functional/test_aarch64_hotplug_pci.py b/tests/functional/test_aarch64_hotplug_pci.py
> index fa1bb62c8f..bb2c121503 100755
> --- a/tests/functional/test_aarch64_hotplug_pci.py
> +++ b/tests/functional/test_aarch64_hotplug_pci.py
> @@ -20,12 +20,12 @@ class HotplugPCI(LinuxKernelTest):
> ASSET_KERNEL = Asset(
> ('https://ftp.debian.org/debian/dists/stable/main/installer-arm64/'
> 'current/images/netboot/debian-installer/arm64/linux'),
> - '3821d4db56d42c6a4eac62f31846e35465940afd87746b4cfcdf5c9eca3117b2')
> + 'd92a60392ce1e379ca198a1a820899f8f0d39a62d047c41ab79492f81541a9d9')
>
> ASSET_INITRD = Asset(
> ('https://ftp.debian.org/debian/dists/stable/main/installer-arm64/'
> 'current/images/netboot/debian-installer/arm64/initrd.gz'),
> - '2583ec22b45265ad69e82f198674f53d4cd85be124fe012eedc2fd91156bc4b4')
> + '9f817f76951f3237bca8216bee35267bfb826815687f4b2fcdd5e6c2a917790c')
If the images reside in a subfolder of a folder called "current" there, and
are changed in the course of time, that's a good indication that we should
use different location for the test images instead, otherwise we'll continue
to play SHA-updating-whack-a-mole forever here.
Could you please try whether it works with the images from the "20230607" or
the "20230607+deb12u11" folder, too, instead? (see
https://ftp.debian.org/debian/dists/stable/main/installer-arm64/ ).
Thanks,
Thomas
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] tests/functional/test_aarch64_hotplug_pci: Update SHA
2025-05-27 15:11 ` Thomas Huth
@ 2025-05-28 2:09 ` Gustavo Romero
0 siblings, 0 replies; 6+ messages in thread
From: Gustavo Romero @ 2025-05-28 2:09 UTC (permalink / raw)
To: Thomas Huth, qemu-devel, eric.auger; +Cc: qemu-arm, alex.bennee
Hi Thomas,
On 5/27/25 12:11, Thomas Huth wrote:
> On 27/05/2025 17.02, Gustavo Romero wrote:
>> Update SHA for 'linux' and 'initrd.gz' images.
>>
>> Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
>> ---
>> tests/functional/test_aarch64_hotplug_pci.py | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/tests/functional/test_aarch64_hotplug_pci.py b/tests/functional/test_aarch64_hotplug_pci.py
>> index fa1bb62c8f..bb2c121503 100755
>> --- a/tests/functional/test_aarch64_hotplug_pci.py
>> +++ b/tests/functional/test_aarch64_hotplug_pci.py
>> @@ -20,12 +20,12 @@ class HotplugPCI(LinuxKernelTest):
>> ASSET_KERNEL = Asset(
>> ('https://ftp.debian.org/debian/dists/stable/main/installer-arm64/'
>> 'current/images/netboot/debian-installer/arm64/linux'),
>> - '3821d4db56d42c6a4eac62f31846e35465940afd87746b4cfcdf5c9eca3117b2')
>> + 'd92a60392ce1e379ca198a1a820899f8f0d39a62d047c41ab79492f81541a9d9')
>> ASSET_INITRD = Asset(
>> ('https://ftp.debian.org/debian/dists/stable/main/installer-arm64/'
>> 'current/images/netboot/debian-installer/arm64/initrd.gz'),
>> - '2583ec22b45265ad69e82f198674f53d4cd85be124fe012eedc2fd91156bc4b4')
>> + '9f817f76951f3237bca8216bee35267bfb826815687f4b2fcdd5e6c2a917790c')
>
> If the images reside in a subfolder of a folder called "current" there, and are changed in the course of time, that's a good indication that we should use different location for the test images instead, otherwise we'll continue to play SHA-updating-whack-a-mole forever here.
>
> Could you please try whether it works with the images from the "20230607" or the "20230607+deb12u11" folder, too, instead? (see https://ftp.debian.org/debian/dists/stable/main/installer-arm64/ ).
Thanks for the review. "20230607+deb12u11" works fine and I chose it.
I decided to split these two patches so this one can get merged first
and doesn't need to wait for the ACPI PCI hotplug series:
https://lists.nongnu.org/archive/html/qemu-devel/2025-05/msg06331.html
Cheers,
Gustavo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] tests/functional/test_aarch64_hotplug_pci: Add test for ACPI PCI hotplug
2025-05-27 15:02 ` [PATCH 2/2] tests/functional/test_aarch64_hotplug_pci: Add test for ACPI PCI hotplug Gustavo Romero
@ 2025-05-28 2:13 ` Gustavo Romero
0 siblings, 0 replies; 6+ messages in thread
From: Gustavo Romero @ 2025-05-28 2:13 UTC (permalink / raw)
To: qemu-devel, eric.auger; +Cc: qemu-arm, thuth, alex.bennee
On 5/27/25 12:02, Gustavo Romero wrote:
> Currently, test_aarch64_hotplug_pci only tests PCI hotplug using the
> native PCI hotplug mechanism. Now that aarch64 supports PCI hotplug via
> the ACPI mechanism it's time to support it in the test as well.
>
> Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
> ---
> tests/functional/test_aarch64_hotplug_pci.py | 24 +++++++++++++++++++-
> 1 file changed, 23 insertions(+), 1 deletion(-)
>
> diff --git a/tests/functional/test_aarch64_hotplug_pci.py b/tests/functional/test_aarch64_hotplug_pci.py
> index bb2c121503..862bb6746b 100755
> --- a/tests/functional/test_aarch64_hotplug_pci.py
> +++ b/tests/functional/test_aarch64_hotplug_pci.py
> @@ -27,11 +27,26 @@ class HotplugPCI(LinuxKernelTest):
> 'current/images/netboot/debian-installer/arm64/initrd.gz'),
> '9f817f76951f3237bca8216bee35267bfb826815687f4b2fcdd5e6c2a917790c')
>
> - def test_hotplug_pci(self):
> + def run_vm_and_test_hotplug_pci(self, use_acpi_pci_hotplug=False):
> + """
> + Run an aarch64 VM and test the PCI hotplug mechanism by plugging and
> + unplugging a PCI network adapter to the VM. Proper plug and unplug of
> + the adapter is verified by checking if the network device is correctly
> + added and removed in Linux.
> +
> + Parameters
> + ----------
> + use_acpi_pci_hotplug : bool
> + If true the ACPI PCI hotplug mechanim is used, otherwise the
> + Native PCIe Hotplug mechanism is used.
> + """
> +
> + acpi_pci_hotplug = "on" if use_acpi_pci_hotplug else "off"
>
> self.set_machine('virt')
> self.vm.add_args('-m', '512M')
> self.vm.add_args('-cpu', 'cortex-a57')
> + self.vm.add_args('-machine', f"acpi-pcihp={acpi_pci_hotplug}")
> self.vm.add_args('-append',
> 'console=ttyAMA0,115200 init=/bin/sh')
> self.vm.add_args('-device',
> @@ -70,5 +85,12 @@ def test_hotplug_pci(self):
> 'ls -l /sys/class/net | wc -l',
> '2')
>
> + def test_native_pci_hotplug(self):
> + self.run_vm_and_test_hotplug_pci(use_acpi_pci_hotplug=False)
> +
> + def test_acpi_pci_hotplug(self):
> + self.run_vm_and_test_hotplug_pci(use_acpi_pci_hotplug=True)
> +
> +
> if __name__ == '__main__':
> LinuxKernelTest.main()
Re-posted here as a single patch:
https://lists.nongnu.org/archive/html/qemu-devel/2025-05/msg06332.html
I missed the Based-on: 20250527074224.1197793-1-eric.auger@redhat.com tag :-/
Cheers,
Gustavo
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-05-28 2:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-27 15:02 [PATCH 0/2] Add functional test for ACPI PCI hotplug Gustavo Romero
2025-05-27 15:02 ` [PATCH 1/2] tests/functional/test_aarch64_hotplug_pci: Update SHA Gustavo Romero
2025-05-27 15:11 ` Thomas Huth
2025-05-28 2:09 ` Gustavo Romero
2025-05-27 15:02 ` [PATCH 2/2] tests/functional/test_aarch64_hotplug_pci: Add test for ACPI PCI hotplug Gustavo Romero
2025-05-28 2:13 ` Gustavo Romero
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).