[Qemu-devel] [PATCH v2 3/6] tests/acceptance: Test OpenBIOS on the PReP/40p

Philippe Mathieu-Daudé posted 6 patches 6 years, 1 month ago
There is a newer version of this series
[Qemu-devel] [PATCH v2 3/6] tests/acceptance: Test OpenBIOS on the PReP/40p
Posted by Philippe Mathieu-Daudé 6 years, 1 month ago
User case from:
https://mail.coreboot.org/pipermail/openbios/2018-May/010360.html

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 tests/acceptance/ppc_prep_40p.py | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/tests/acceptance/ppc_prep_40p.py b/tests/acceptance/ppc_prep_40p.py
index a0eac40d9f..87b5311b89 100644
--- a/tests/acceptance/ppc_prep_40p.py
+++ b/tests/acceptance/ppc_prep_40p.py
@@ -82,3 +82,35 @@ class IbmPrep40pMachine(Test):
         self.wait_for_console_pattern(fw_banner)
         prompt_msg = 'Type any key to interrupt automatic startup'
         self.wait_for_console_pattern(prompt_msg)
+
+    def test_openbios_192m(self):
+        """
+        :avocado: tags=arch:ppc
+        :avocado: tags=machine:40p
+        """
+        self.vm.set_machine('40p')
+        self.vm.set_console()
+        self.vm.add_args('-m', '192')
+
+        self.vm.launch()
+        self.wait_for_console_pattern('>> OpenBIOS')
+        self.wait_for_console_pattern('>> Memory: 192M')
+        self.wait_for_console_pattern('>> CPU type PowerPC,604')
+
+    def test_openbios_and_netbsd(self):
+        """
+        :avocado: tags=arch:ppc
+        :avocado: tags=machine:40p
+        """
+        drive_url = ('https://ftp.netbsd.org/pub/NetBSD/iso/7.1.2/'
+                     'NetBSD-7.1.2-prep.iso')
+        drive_hash = '78734c1bdda79778f0b6f391969ad2458ed8981c'
+        drive_path = self.fetch_asset(drive_url, asset_hash=drive_hash)
+
+        self.vm.set_machine('40p')
+        self.vm.set_console()
+        self.vm.add_args('-cdrom', drive_path,
+                         '-boot', 'd')
+
+        self.vm.launch()
+        self.wait_for_console_pattern('NetBSD/prep BOOT, Revision 1.9')
-- 
2.20.1


Re: [Qemu-devel] [PATCH v2 3/6] tests/acceptance: Test OpenBIOS on the PReP/40p
Posted by Cleber Rosa 6 years, 1 month ago
On Sun, Sep 15, 2019 at 11:19:37PM +0200, Philippe Mathieu-Daudé wrote:
> User case from:
> https://mail.coreboot.org/pipermail/openbios/2018-May/010360.html
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  tests/acceptance/ppc_prep_40p.py | 32 ++++++++++++++++++++++++++++++++
>  1 file changed, 32 insertions(+)
> 
> diff --git a/tests/acceptance/ppc_prep_40p.py b/tests/acceptance/ppc_prep_40p.py
> index a0eac40d9f..87b5311b89 100644
> --- a/tests/acceptance/ppc_prep_40p.py
> +++ b/tests/acceptance/ppc_prep_40p.py
> @@ -82,3 +82,35 @@ class IbmPrep40pMachine(Test):
>          self.wait_for_console_pattern(fw_banner)
>          prompt_msg = 'Type any key to interrupt automatic startup'
>          self.wait_for_console_pattern(prompt_msg)
> +
> +    def test_openbios_192m(self):
> +        """
> +        :avocado: tags=arch:ppc
> +        :avocado: tags=machine:40p
> +        """
> +        self.vm.set_machine('40p')
> +        self.vm.set_console()
> +        self.vm.add_args('-m', '192')

Is 192 a magic number (some kind of limit)?  Or just a value to check
against later?

> +
> +        self.vm.launch()
> +        self.wait_for_console_pattern('>> OpenBIOS')
> +        self.wait_for_console_pattern('>> Memory: 192M')
> +        self.wait_for_console_pattern('>> CPU type PowerPC,604')
> +

On my testing, this is a very stable test, I'm only getting PASSes.

> +    def test_openbios_and_netbsd(self):
> +        """
> +        :avocado: tags=arch:ppc
> +        :avocado: tags=machine:40p
> +        """
> +        drive_url = ('https://ftp.netbsd.org/pub/NetBSD/iso/7.1.2/'
> +                     'NetBSD-7.1.2-prep.iso')
> +        drive_hash = '78734c1bdda79778f0b6f391969ad2458ed8981c'

According to https://ftp.netbsd.org/pub/NetBSD/iso/7.1.2/MD5 :

  MD5 (NetBSD-7.1.2-prep.iso) = ac6fa2707d888b36d6fa64de6e7fe48e

Which would require either:

  drive_hash = 'ac6fa2707d888b36d6fa64de6e7fe48e'
  drive_path = self.fetch_asset(drive_url, asset_hash=drive_hash,
                                algorithm='md5')

Or, if you want to use sha1:

  drive_hash = '467ba366e4574d32b060532660369542d607ec5d'

- Cleber.

> +        drive_path = self.fetch_asset(drive_url, asset_hash=drive_hash)
> +
> +        self.vm.set_machine('40p')
> +        self.vm.set_console()
> +        self.vm.add_args('-cdrom', drive_path,
> +                         '-boot', 'd')
> +
> +        self.vm.launch()
> +        self.wait_for_console_pattern('NetBSD/prep BOOT, Revision 1.9')
> -- 
> 2.20.1
> 
> 

Re: [Qemu-devel] [PATCH v2 3/6] tests/acceptance: Test OpenBIOS on the PReP/40p
Posted by Alex Bennée 6 years, 1 month ago
Cleber Rosa <crosa@redhat.com> writes:

> On Sun, Sep 15, 2019 at 11:19:37PM +0200, Philippe Mathieu-Daudé wrote:
>> User case from:
>> https://mail.coreboot.org/pipermail/openbios/2018-May/010360.html
>>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>>  tests/acceptance/ppc_prep_40p.py | 32 ++++++++++++++++++++++++++++++++
>>  1 file changed, 32 insertions(+)
>>
>> diff --git a/tests/acceptance/ppc_prep_40p.py b/tests/acceptance/ppc_prep_40p.py
>> index a0eac40d9f..87b5311b89 100644
>> --- a/tests/acceptance/ppc_prep_40p.py
>> +++ b/tests/acceptance/ppc_prep_40p.py
>> @@ -82,3 +82,35 @@ class IbmPrep40pMachine(Test):
>>          self.wait_for_console_pattern(fw_banner)
>>          prompt_msg = 'Type any key to interrupt automatic startup'
>>          self.wait_for_console_pattern(prompt_msg)
>> +
>> +    def test_openbios_192m(self):
>> +        """
>> +        :avocado: tags=arch:ppc
>> +        :avocado: tags=machine:40p
>> +        """
>> +        self.vm.set_machine('40p')
>> +        self.vm.set_console()
>> +        self.vm.add_args('-m', '192')
>
> Is 192 a magic number (some kind of limit)?  Or just a value to check
> against later?

Just the memory configured for the machine, checked bellow. Or are you
wondering why 192m and not any other amount?

>> +
>> +        self.vm.launch()
>> +        self.wait_for_console_pattern('>> OpenBIOS')
>> +        self.wait_for_console_pattern('>> Memory: 192M')
>> +        self.wait_for_console_pattern('>> CPU type PowerPC,604')
>> +
>
> On my testing, this is a very stable test, I'm only getting PASSes.
<snip>

--
Alex Bennée

Re: [Qemu-devel] [PATCH v2 3/6] tests/acceptance: Test OpenBIOS on the PReP/40p
Posted by Philippe Mathieu-Daudé 6 years, 1 month ago
On 9/17/19 11:31 AM, Alex Bennée wrote:
> Cleber Rosa <crosa@redhat.com> writes:
>> On Sun, Sep 15, 2019 at 11:19:37PM +0200, Philippe Mathieu-Daudé wrote:
>>> User case from:
>>> https://mail.coreboot.org/pipermail/openbios/2018-May/010360.html
>>>
>>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>>> ---
>>>  tests/acceptance/ppc_prep_40p.py | 32 ++++++++++++++++++++++++++++++++
>>>  1 file changed, 32 insertions(+)
>>>
>>> diff --git a/tests/acceptance/ppc_prep_40p.py b/tests/acceptance/ppc_prep_40p.py
>>> index a0eac40d9f..87b5311b89 100644
>>> --- a/tests/acceptance/ppc_prep_40p.py
>>> +++ b/tests/acceptance/ppc_prep_40p.py
>>> @@ -82,3 +82,35 @@ class IbmPrep40pMachine(Test):
>>>          self.wait_for_console_pattern(fw_banner)
>>>          prompt_msg = 'Type any key to interrupt automatic startup'
>>>          self.wait_for_console_pattern(prompt_msg)
>>> +
>>> +    def test_openbios_192m(self):
>>> +        """
>>> +        :avocado: tags=arch:ppc
>>> +        :avocado: tags=machine:40p
>>> +        """
>>> +        self.vm.set_machine('40p')
>>> +        self.vm.set_console()
>>> +        self.vm.add_args('-m', '192')
>>
>> Is 192 a magic number (some kind of limit)?  Or just a value to check
>> against later?
> 
> Just the memory configured for the machine, checked bellow. Or are you
> wondering why 192m and not any other amount?

The machine default is 128MiB. The firmware asks the memory controller
how many SIMMs of 8MiB are inserted. We can run OpenBIOS with 128MiB,
but by specifying a different default in this test, we also test the
memory controller device :)

Since this is not obvious I'll add a comment.

>>> +
>>> +        self.vm.launch()
>>> +        self.wait_for_console_pattern('>> OpenBIOS')
>>> +        self.wait_for_console_pattern('>> Memory: 192M')
>>> +        self.wait_for_console_pattern('>> CPU type PowerPC,604')
>>> +
>>
>> On my testing, this is a very stable test, I'm only getting PASSes.
> <snip>
> 
> --
> Alex Bennée
> 

Re: [Qemu-devel] [PATCH v2 3/6] tests/acceptance: Test OpenBIOS on the PReP/40p
Posted by Artyom Tarasenko 6 years, 1 month ago
On Tue, Sep 17, 2019 at 11:44 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> On 9/17/19 11:31 AM, Alex Bennée wrote:
> > Cleber Rosa <crosa@redhat.com> writes:
> >> On Sun, Sep 15, 2019 at 11:19:37PM +0200, Philippe Mathieu-Daudé wrote:
> >>> User case from:
> >>> https://mail.coreboot.org/pipermail/openbios/2018-May/010360.html
> >>>
> >>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> >>> ---
> >>>  tests/acceptance/ppc_prep_40p.py | 32 ++++++++++++++++++++++++++++++++
> >>>  1 file changed, 32 insertions(+)
> >>>
> >>> diff --git a/tests/acceptance/ppc_prep_40p.py b/tests/acceptance/ppc_prep_40p.py
> >>> index a0eac40d9f..87b5311b89 100644
> >>> --- a/tests/acceptance/ppc_prep_40p.py
> >>> +++ b/tests/acceptance/ppc_prep_40p.py
> >>> @@ -82,3 +82,35 @@ class IbmPrep40pMachine(Test):
> >>>          self.wait_for_console_pattern(fw_banner)
> >>>          prompt_msg = 'Type any key to interrupt automatic startup'
> >>>          self.wait_for_console_pattern(prompt_msg)
> >>> +
> >>> +    def test_openbios_192m(self):
> >>> +        """
> >>> +        :avocado: tags=arch:ppc
> >>> +        :avocado: tags=machine:40p
> >>> +        """
> >>> +        self.vm.set_machine('40p')
> >>> +        self.vm.set_console()
> >>> +        self.vm.add_args('-m', '192')
> >>
> >> Is 192 a magic number (some kind of limit)?  Or just a value to check
> >> against later?
> >
> > Just the memory configured for the machine, checked bellow. Or are you
> > wondering why 192m and not any other amount?
>
> The machine default is 128MiB. The firmware asks the memory controller
> how many SIMMs of 8MiB are inserted. We can run OpenBIOS with 128MiB,
> but by specifying a different default in this test, we also test the
> memory controller device :)
>
> Since this is not obvious I'll add a comment.

Are you sure OpenBIOS does it? Doesn't it get the info from the qemu fw device?
At least when making OFW I haven't found a way to the info from the
memory controller. I think it's not implemented. Or at least wasn't
back then.
And since I wanted to be compatible with the real hw, which doesn't
have a fw device, I just kept the hardcoded value in OFW.
If it's in the MC meanwhile, I can add the check to OFW as well.

> >>> +
> >>> +        self.vm.launch()
> >>> +        self.wait_for_console_pattern('>> OpenBIOS')
> >>> +        self.wait_for_console_pattern('>> Memory: 192M')
> >>> +        self.wait_for_console_pattern('>> CPU type PowerPC,604')
> >>> +
> >>
> >> On my testing, this is a very stable test, I'm only getting PASSes.
> > <snip>
> >
> > --
> > Alex Bennée
> >



-- 
Regards,
Artyom Tarasenko

SPARC and PPC PReP under qemu blog: http://tyom.blogspot.com/search/label/qemu