diff mbox series

[1/5] tests/functional: Introduce a new test routine for OpenBMC images

Message ID 20250129071820.1258133-2-clg@redhat.com (mailing list archive)
State New
Headers show
Series tests/functional: Update Aspeed OpenBMC images (resend) | expand

Commit Message

Cédric Le Goater Jan. 29, 2025, 7:18 a.m. UTC
The OpenBMC images currently used by QEMU to test the Aspeed machines
are rather old. To prepare an update to the latest builds, we need to
adjust the console patterns. Introduce a new routine to preserve the
current tests.

Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
 tests/functional/aspeed.py | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comments

Thomas Huth Jan. 29, 2025, 7:58 a.m. UTC | #1
On 29/01/2025 08.18, Cédric Le Goater wrote:
> The OpenBMC images currently used by QEMU to test the Aspeed machines
> are rather old. To prepare an update to the latest builds, we need to
> adjust the console patterns. Introduce a new routine to preserve the
> current tests.
> 
> Signed-off-by: Cédric Le Goater <clg@redhat.com>
> ---
>   tests/functional/aspeed.py | 18 ++++++++++++++++++
>   1 file changed, 18 insertions(+)
> 
> diff --git a/tests/functional/aspeed.py b/tests/functional/aspeed.py
> index b52358bb8c61..51c821944842 100644
> --- a/tests/functional/aspeed.py
> +++ b/tests/functional/aspeed.py
> @@ -23,6 +23,24 @@ def do_test_arm_aspeed(self, machine, image):
>           self.wait_for_console_pattern("ftgmac100 1e660000.ethernet eth0: irq ")
>           self.wait_for_console_pattern("systemd[1]: Set hostname to")
>   
> +    def do_test_arm_aspeed_openbmc(self, machine, image, uboot='2019.04',
> +                                   cpu_id='0x0', soc='AST2500 rev A1'):
> +        hostname = machine.removesuffix('-bmc')
> +
> +        self.set_machine(machine)
> +        self.vm.set_console()
> +        self.vm.add_args('-drive', 'file=' + image + ',if=mtd,format=raw',
> +                         '-net', 'nic', '-snapshot')

"-net nic" is the default anyway, so unless you also use "-nodefaults", I 
think you can simply drop that?

> +        self.vm.launch()
> +
> +        self.wait_for_console_pattern(f'U-Boot {uboot}')
> +        self.wait_for_console_pattern('## Loading kernel from FIT Image')
> +        self.wait_for_console_pattern('Starting kernel ...')
> +        self.wait_for_console_pattern(f'Booting Linux on physical CPU {cpu_id}')
> +        self.wait_for_console_pattern(f'ASPEED {soc}')
> +        self.wait_for_console_pattern('/init as init process')
> +        self.wait_for_console_pattern(f'systemd[1]: Hostname set to <{hostname}>.')
> +
>       def do_test_arm_aspeed_buildroot_start(self, image, cpu_id, pattern='Aspeed EVB'):
>           self.require_netdev('user')
>           self.vm.set_console()

Anyway,
Reviewed-by: Thomas Huth <thuth@redhat.com>
Cédric Le Goater Jan. 29, 2025, 4:28 p.m. UTC | #2
On 1/29/25 08:58, Thomas Huth wrote:
> On 29/01/2025 08.18, Cédric Le Goater wrote:
>> The OpenBMC images currently used by QEMU to test the Aspeed machines
>> are rather old. To prepare an update to the latest builds, we need to
>> adjust the console patterns. Introduce a new routine to preserve the
>> current tests.
>>
>> Signed-off-by: Cédric Le Goater <clg@redhat.com>
>> ---
>>   tests/functional/aspeed.py | 18 ++++++++++++++++++
>>   1 file changed, 18 insertions(+)
>>
>> diff --git a/tests/functional/aspeed.py b/tests/functional/aspeed.py
>> index b52358bb8c61..51c821944842 100644
>> --- a/tests/functional/aspeed.py
>> +++ b/tests/functional/aspeed.py
>> @@ -23,6 +23,24 @@ def do_test_arm_aspeed(self, machine, image):
>>           self.wait_for_console_pattern("ftgmac100 1e660000.ethernet eth0: irq ")
>>           self.wait_for_console_pattern("systemd[1]: Set hostname to")
>> +    def do_test_arm_aspeed_openbmc(self, machine, image, uboot='2019.04',
>> +                                   cpu_id='0x0', soc='AST2500 rev A1'):
>> +        hostname = machine.removesuffix('-bmc')
>> +
>> +        self.set_machine(machine)
>> +        self.vm.set_console()
>> +        self.vm.add_args('-drive', 'file=' + image + ',if=mtd,format=raw',
>> +                         '-net', 'nic', '-snapshot')
> 
> "-net nic" is the default anyway, so unless you also use "-nodefaults", I think you can simply drop that?

OK. Will do.

Do you want a resend for that ? Unless you prefer this series
to go through you tree, I will amend before sending PR.


> 
>> +        self.vm.launch()
>> +
>> +        self.wait_for_console_pattern(f'U-Boot {uboot}')
>> +        self.wait_for_console_pattern('## Loading kernel from FIT Image')
>> +        self.wait_for_console_pattern('Starting kernel ...')
>> +        self.wait_for_console_pattern(f'Booting Linux on physical CPU {cpu_id}')
>> +        self.wait_for_console_pattern(f'ASPEED {soc}')
>> +        self.wait_for_console_pattern('/init as init process')
>> +        self.wait_for_console_pattern(f'systemd[1]: Hostname set to <{hostname}>.')
>> +
>>       def do_test_arm_aspeed_buildroot_start(self, image, cpu_id, pattern='Aspeed EVB'):
>>           self.require_netdev('user')
>>           self.vm.set_console()
> 
> Anyway,
> Reviewed-by: Thomas Huth <thuth@redhat.com>

Thanks,

C.
Thomas Huth Jan. 30, 2025, 6:40 a.m. UTC | #3
On 29/01/2025 17.28, Cédric Le Goater wrote:
> On 1/29/25 08:58, Thomas Huth wrote:
>> On 29/01/2025 08.18, Cédric Le Goater wrote:
>>> The OpenBMC images currently used by QEMU to test the Aspeed machines
>>> are rather old. To prepare an update to the latest builds, we need to
>>> adjust the console patterns. Introduce a new routine to preserve the
>>> current tests.
>>>
>>> Signed-off-by: Cédric Le Goater <clg@redhat.com>
>>> ---
>>>   tests/functional/aspeed.py | 18 ++++++++++++++++++
>>>   1 file changed, 18 insertions(+)
>>>
>>> diff --git a/tests/functional/aspeed.py b/tests/functional/aspeed.py
>>> index b52358bb8c61..51c821944842 100644
>>> --- a/tests/functional/aspeed.py
>>> +++ b/tests/functional/aspeed.py
>>> @@ -23,6 +23,24 @@ def do_test_arm_aspeed(self, machine, image):
>>>           self.wait_for_console_pattern("ftgmac100 1e660000.ethernet 
>>> eth0: irq ")
>>>           self.wait_for_console_pattern("systemd[1]: Set hostname to")
>>> +    def do_test_arm_aspeed_openbmc(self, machine, image, uboot='2019.04',
>>> +                                   cpu_id='0x0', soc='AST2500 rev A1'):
>>> +        hostname = machine.removesuffix('-bmc')
>>> +
>>> +        self.set_machine(machine)
>>> +        self.vm.set_console()
>>> +        self.vm.add_args('-drive', 'file=' + image + ',if=mtd,format=raw',
>>> +                         '-net', 'nic', '-snapshot')
>>
>> "-net nic" is the default anyway, so unless you also use "-nodefaults", I 
>> think you can simply drop that?
> 
> OK. Will do.
> 
> Do you want a resend for that ? Unless you prefer this series
> to go through you tree, I will amend before sending PR.

No, no need for a v2 just because of this. And yes, please take it through 
the aspeed tree!

  Thanks,
   Thomas
Cédric Le Goater Jan. 30, 2025, 8:01 a.m. UTC | #4
On 1/30/25 07:40, Thomas Huth wrote:
> On 29/01/2025 17.28, Cédric Le Goater wrote:
>> On 1/29/25 08:58, Thomas Huth wrote:
>>> On 29/01/2025 08.18, Cédric Le Goater wrote:
>>>> The OpenBMC images currently used by QEMU to test the Aspeed machines
>>>> are rather old. To prepare an update to the latest builds, we need to
>>>> adjust the console patterns. Introduce a new routine to preserve the
>>>> current tests.
>>>>
>>>> Signed-off-by: Cédric Le Goater <clg@redhat.com>
>>>> ---
>>>>   tests/functional/aspeed.py | 18 ++++++++++++++++++
>>>>   1 file changed, 18 insertions(+)
>>>>
>>>> diff --git a/tests/functional/aspeed.py b/tests/functional/aspeed.py
>>>> index b52358bb8c61..51c821944842 100644
>>>> --- a/tests/functional/aspeed.py
>>>> +++ b/tests/functional/aspeed.py
>>>> @@ -23,6 +23,24 @@ def do_test_arm_aspeed(self, machine, image):
>>>>           self.wait_for_console_pattern("ftgmac100 1e660000.ethernet eth0: irq ")
>>>>           self.wait_for_console_pattern("systemd[1]: Set hostname to")
>>>> +    def do_test_arm_aspeed_openbmc(self, machine, image, uboot='2019.04',
>>>> +                                   cpu_id='0x0', soc='AST2500 rev A1'):
>>>> +        hostname = machine.removesuffix('-bmc')
>>>> +
>>>> +        self.set_machine(machine)
>>>> +        self.vm.set_console()
>>>> +        self.vm.add_args('-drive', 'file=' + image + ',if=mtd,format=raw',
>>>> +                         '-net', 'nic', '-snapshot')
>>>
>>> "-net nic" is the default anyway, so unless you also use "-nodefaults", I think you can simply drop that?
>>
>> OK. Will do.
>>
>> Do you want a resend for that ? Unless you prefer this series
>> to go through you tree, I will amend before sending PR.
> 
> No, no need for a v2 just because of this. And yes, please take it through the aspeed tree!


OK. I also added the extra 2 empty lines between the imports and
the class statements in the tests being modified.


Thanks,

C.
diff mbox series

Patch

diff --git a/tests/functional/aspeed.py b/tests/functional/aspeed.py
index b52358bb8c61..51c821944842 100644
--- a/tests/functional/aspeed.py
+++ b/tests/functional/aspeed.py
@@ -23,6 +23,24 @@  def do_test_arm_aspeed(self, machine, image):
         self.wait_for_console_pattern("ftgmac100 1e660000.ethernet eth0: irq ")
         self.wait_for_console_pattern("systemd[1]: Set hostname to")
 
+    def do_test_arm_aspeed_openbmc(self, machine, image, uboot='2019.04',
+                                   cpu_id='0x0', soc='AST2500 rev A1'):
+        hostname = machine.removesuffix('-bmc')
+
+        self.set_machine(machine)
+        self.vm.set_console()
+        self.vm.add_args('-drive', 'file=' + image + ',if=mtd,format=raw',
+                         '-net', 'nic', '-snapshot')
+        self.vm.launch()
+
+        self.wait_for_console_pattern(f'U-Boot {uboot}')
+        self.wait_for_console_pattern('## Loading kernel from FIT Image')
+        self.wait_for_console_pattern('Starting kernel ...')
+        self.wait_for_console_pattern(f'Booting Linux on physical CPU {cpu_id}')
+        self.wait_for_console_pattern(f'ASPEED {soc}')
+        self.wait_for_console_pattern('/init as init process')
+        self.wait_for_console_pattern(f'systemd[1]: Hostname set to <{hostname}>.')
+
     def do_test_arm_aspeed_buildroot_start(self, image, cpu_id, pattern='Aspeed EVB'):
         self.require_netdev('user')
         self.vm.set_console()