tests/acceptance: Test Aspeed ARM machines
v2 cover tests/acceptance: Test Aspeed ARM machines
v2: Fix ast2600 test, thanks Cédric for the review.
This adds tests for the Aspeed ARM SoCs. The AST2400 and AST2500 tests use OpenBMC images from that project, fetched from github releases. The AST2600 test uses a Debian arm32 kernel.
Note that the ast2600 test will fail if [1] is not applied. I have tested locally and all seems good.
I note that checkpatch warns about a couple of lines over 80 columns in this file. Can we agree to relax this restriction for this file, as it helps the readability of the constants such as sha hashes and URLs?
[1] https://lore.kernel.org/qemu-devel/[email protected]/T/#u
Joel Stanley (2):
tests/acceptance: Test ast2400 and ast2500 machines tests/acceptance: Test ast2600 machine
tests/acceptance/boot_linux_console.py | 72 ++++++++++++++++++++++++++ 1 file changed, 72 insertions(+)
Signature · 1 line
2.30.1
PATCH v2 1/2 tests/acceptance: Test ast2400 and ast2500 machines
Test MTD images from the OpenBMC project on AST2400 and AST2500 SoCs from ASPEED, by booting Palmetto and Romulus BMC machines.
The images are fetched from OpenBMC's release directory on github.
--- tests/acceptance/boot_linux_console.py | 46 ++++++++++++++++++++++++++ 1 file changed, 46 insertions(+)
tests/acceptance/boot_linux_console.py +46 -0
@@ -1048,6 +1048,52 @@ def test_arm_vexpressa9(self): self.vm.add_args('-dtb', self.workdir + '/day16/vexpress-v2p-ca9.dtb') self.do_test_advcal_2018('16', tar_hash, 'winter.zImage') + def test_arm_ast2400_palmetto_openbmc_v2_9_0(self): + """ + :avocado: tags=arch:arm + :avocado: tags=machine:palmetto-bmc + """ + + image_url = ('https://github.com/openbmc/openbmc/releases/download/2.9.0/' + 'obmc-phosphor-image-palmetto.static.mtd') + image_hash = ('3e13bbbc28e424865dc42f35ad672b10f2e82cdb11846bb28fa625b48beafd0d') + image_path = self.fetch_asset(image_url, asset_hash=image_hash, + algorithm='sha256') + + self.do_test_arm_aspeed(image_path) + + def test_arm_ast2500_romulus_openbmc_v2_9_0(self): + """ + :avocado: tags=arch:arm + :avocado: tags=machine:romulus-bmc + """ + + image_url = ('https://github.com/openbmc/openbmc/releases/download/2.9.0/' + 'obmc-phosphor-image-romulus.static.mtd') + image_hash = ('820341076803f1955bc31e647a512c79f9add4f5233d0697678bab4604c7bb25') + image_path = self.fetch_asset(image_url, asset_hash=image_hash, + algorithm='sha256') + + self.do_test_arm_aspeed(image_path) + + def do_test_arm_aspeed(self, image): + self.vm.set_console() + self.vm.add_args('-drive', 'file=' + image + ',if=mtd,format=raw', + '-net', 'nic') + self.vm.launch() + + self.wait_for_console_pattern("U-Boot 2016.07") + self.wait_for_console_pattern("## Loading kernel from FIT Image at 20080000") + self.wait_for_console_pattern("Starting kernel ...") + self.wait_for_console_pattern("Booting Linux on physical CPU 0x0") + self.wait_for_console_pattern( + "aspeed-smc 1e620000.spi: read control register: 203b0641") + self.wait_for_console_pattern("ftgmac100 1e660000.ethernet eth0: irq ") + self.wait_for_console_pattern("systemd[1]: Set hostname to") + # This often takes longer than the 90s timeout + # self.wait_for_console_pattern("login:") + self.vm.shutdown() + def test_m68k_mcf5208evb(self): """ :avocado: tags=arch:m68k
Signature · 1 line
2.30.1
Re: [PATCH v2 1/2] tests/acceptance: Test ast2400 and ast2500 machines
Hi,
Quoted 55 lines · Joel Stanley
Test MTD images from the OpenBMC project on AST2400 and AST2500 SoCs from ASPEED, by booting Palmetto and Romulus BMC machines.
The images are fetched from OpenBMC's release directory on github.
Co-developed-by Cédric Le Goater <[email protected]>Reviewed-by Cédric Le Goater <[email protected]>Tested-by Cédric Le Goater <[email protected]>Signed-off-by Joel Stanley <[email protected]>--- tests/acceptance/boot_linux_console.py | 46 ++++++++++++++++++++++++++ 1 file changed, 46 insertions(+)tests/acceptance/boot_linux_console.py +34
-0@@ -1048,6 +1048,52 @@ def test_arm_vexpressa9(self): self.vm.add_args('-dtb', self.workdir + '/day16/vexpress-v2p-ca9.dtb') self.do_test_advcal_2018('16', tar_hash, 'winter.zImage') + def test_arm_ast2400_palmetto_openbmc_v2_9_0(self): + """ + :avocado: tags=arch:arm + :avocado: tags=machine:palmetto-bmc + """ + + image_url = ('https://github.com/openbmc/openbmc/releases/download/2.9.0/' + 'obmc-phosphor-image-palmetto.static.mtd') + image_hash = ('3e13bbbc28e424865dc42f35ad672b10f2e82cdb11846bb28fa625b48beafd0d') + image_path = self.fetch_asset(image_url, asset_hash=image_hash, + algorithm='sha256') + + self.do_test_arm_aspeed(image_path) + + def test_arm_ast2500_romulus_openbmc_v2_9_0(self): + """ + :avocado: tags=arch:arm + :avocado: tags=machine:romulus-bmc + """ + + image_url = ('https://github.com/openbmc/openbmc/releases/download/2.9.0/' + 'obmc-phosphor-image-romulus.static.mtd') + image_hash = ('820341076803f1955bc31e647a512c79f9add4f5233d0697678bab4604c7bb25') + image_path = self.fetch_asset(image_url, asset_hash=image_hash, + algorithm='sha256') + + self.do_test_arm_aspeed(image_path) + + def do_test_arm_aspeed(self, image): + self.vm.set_console() + self.vm.add_args('-drive', 'file=' + image + ',if=mtd,format=raw', + '-net', 'nic') + self.vm.launch() +
tests/acceptance/boot_linux_console.py def test_arm_vexpressa9(self): · line 1094
Quoted 10 lines
tests/acceptance/boot_linux_console.py +10
-0+ self.wait_for_console_pattern("U-Boot 2016.07") + self.wait_for_console_pattern("## Loading kernel from FIT Image at 20080000") + self.wait_for_console_pattern("Starting kernel ...") + self.wait_for_console_pattern("Booting Linux on physical CPU 0x0") + self.wait_for_console_pattern( + "aspeed-smc 1e620000.spi: read control register: 203b0641") + self.wait_for_console_pattern("ftgmac100 1e660000.ethernet eth0: irq ") + self.wait_for_console_pattern("systemd[1]: Set hostname to") + # This often takes longer than the 90s timeout + # self.wait_for_console_pattern("login:")
Maybe remove those commented lines?
tests/acceptance/boot_linux_console.py def test_arm_vexpressa9(self): · line 1095
Quoted 1 line
tests/acceptance/boot_linux_console.py +1
-0+ self.vm.shutdown()
Not needed explicit shutdown as I said on patch 02.
- Wainer
Quoted 4 lines
tests/acceptance/boot_linux_console.py +1
-0+ def test_m68k_mcf5208evb(self): """ :avocado: tags=arch:m68k
Re: [PATCH v2 1/2] tests/acceptance: Test ast2400 and ast2500 machines
In reply to Joel StanleyQuoted 5 lines · Joel Stanley
Test MTD images from the OpenBMC project on AST2400 and AST2500 SoCs from ASPEED, by booting Palmetto and Romulus BMC machines.
The images are fetched from OpenBMC's release directory on github.
Quoted 7 lines
Co-developed-by Cédric Le Goater <[email protected]>Reviewed-by Cédric Le Goater <[email protected]>Tested-by Cédric Le Goater <[email protected]>Signed-off-by Joel Stanley <[email protected]>--- tests/acceptance/boot_linux_console.py | 46 ++++++++++++++++++++++++++ 1 file changed, 46 insertions(+)
These seem quite stable, as not as slow as the comment on the seems to indicate. On a reasonbly low powered machine:
JOB ID : 01fb73b0f5f4612e95f9f2c2a791df9c11d226ca
JOB LOG : /home/cleber/avocado/job-results/job-2021-03-16T21.58-01fb73b/job.log
(1/6) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_ast2400_palmetto_openbmc_v2_9_0: STARTED (2/6) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_ast2500_romulus_openbmc_v2_9_0: STARTED (3/6) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_ast2400_palmetto_openbmc_v2_9_0: STARTED (4/6) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_ast2500_romulus_openbmc_v2_9_0: STARTED (1/6) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_ast2400_palmetto_openbmc_v2_9_0: PASS (32.70 s) (3/6) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_ast2400_palmetto_openbmc_v2_9_0: PASS (32.86 s) (5/6) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_ast2400_palmetto_openbmc_v2_9_0: STARTED (6/6) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_ast2500_romulus_openbmc_v2_9_0: STARTED (4/6) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_ast2500_romulus_openbmc_v2_9_0: PASS (42.46 s) (2/6) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_ast2500_romulus_openbmc_v2_9_0: PASS (42.64 s) (5/6) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_ast2400_palmetto_openbmc_v2_9_0: PASS (21.78 s) (6/6) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_ast2500_romulus_openbmc_v2_9_0: PASS (26.11 s)
RESULTS : PASS 6 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML : /home/cleber/avocado/job-results/job-2021-03-16T21.58-01fb73b/results.html
JOB TIME : 61.04 s
PATCH v2 2/2 tests/acceptance: Test ast2600 machine
In reply to Joel StanleyThis tests a Debian multi-soc arm32 Linux kernel on the AST2600 based Tacoma BMC machine.
There is no root file system so the test terminates when boot reaches the stage where it attempts and fails to mount something.
---
v2: Update expected strings so test passes
--- tests/acceptance/boot_linux_console.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
tests/acceptance/boot_linux_console.py +26 -0
@@ -1094,6 +1094,32 @@ def do_test_arm_aspeed(self, image): # self.wait_for_console_pattern("login:") self.vm.shutdown() + def test_arm_ast2600_debian(self): + """ + :avocado: tags=arch:arm + :avocado: tags=machine:tacoma-bmc + """ + deb_url = ('http://snapshot.debian.org/archive/debian/' + '20210302T203551Z/' + 'pool/main/l/linux/' + 'linux-image-5.10.0-3-armmp_5.10.13-1_armhf.deb') + deb_hash = 'db40d32fe39255d05482bea48d72467b67d6225bb2a2a4d6f618cb8976f1e09e' + deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash, + algorithm='sha256') + kernel_path = self.extract_from_deb(deb_path, '/boot/vmlinuz-5.10.0-3-armmp') + dtb_path = self.extract_from_deb(deb_path, + '/usr/lib/linux-image-5.10.0-3-armmp/aspeed-bmc-opp-tacoma.dtb') + + self.vm.set_console() + self.vm.add_args('-kernel', kernel_path, + '-dtb', dtb_path, + '-net', 'nic') + self.vm.launch() + self.wait_for_console_pattern("Booting Linux on physical CPU 0xf00") + self.wait_for_console_pattern("SMP: Total of 2 processors activated") + self.wait_for_console_pattern("No filesystem could mount root") + self.vm.shutdown() + def test_m68k_mcf5208evb(self): """ :avocado: tags=arch:m68k
Signature · 1 line
2.30.1
Re: [PATCH v2 2/2] tests/acceptance: Test ast2600 machine
Quoted 7 lines · Joel Stanley
This tests a Debian multi-soc arm32 Linux kernel on the AST2600 based Tacoma BMC machine.
There is no root file system so the test terminates when boot reaches the stage where it attempts and fails to mount something.
Signed-off-by Joel Stanley <[email protected]>
Quoted 44 lines
---
v2: Update expected strings so test passes--- tests/acceptance/boot_linux_console.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)tests/acceptance/boot_linux_console.py +26
-0@@ -1094,6 +1094,32 @@ def do_test_arm_aspeed(self, image): # self.wait_for_console_pattern("login:") self.vm.shutdown() + def test_arm_ast2600_debian(self): + """ + :avocado: tags=arch:arm + :avocado: tags=machine:tacoma-bmc + """ + deb_url = ('http://snapshot.debian.org/archive/debian/' + '20210302T203551Z/' + 'pool/main/l/linux/' + 'linux-image-5.10.0-3-armmp_5.10.13-1_armhf.deb') + deb_hash = 'db40d32fe39255d05482bea48d72467b67d6225bb2a2a4d6f618cb8976f1e09e' + deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash, + algorithm='sha256') + kernel_path = self.extract_from_deb(deb_path, '/boot/vmlinuz-5.10.0-3-armmp') + dtb_path = self.extract_from_deb(deb_path, + '/usr/lib/linux-image-5.10.0-3-armmp/aspeed-bmc-opp-tacoma.dtb') + + self.vm.set_console() + self.vm.add_args('-kernel', kernel_path, + '-dtb', dtb_path, + '-net', 'nic') + self.vm.launch() + self.wait_for_console_pattern("Booting Linux on physical CPU 0xf00") + self.wait_for_console_pattern("SMP: Total of 2 processors activated") + self.wait_for_console_pattern("No filesystem could mount root") + self.vm.shutdown() + def test_m68k_mcf5208evb(self): """ :avocado: tags=arch:m68k
Re: [PATCH v2 2/2] tests/acceptance: Test ast2600 machine
In reply to Joel StanleyHi,
Quoted 34 lines · Joel Stanley
This tests a Debian multi-soc arm32 Linux kernel on the AST2600 based Tacoma BMC machine.
There is no root file system so the test terminates when boot reaches the stage where it attempts and fails to mount something.
Signed-off-by Joel Stanley <[email protected]>---
v2: Update expected strings so test passes--- tests/acceptance/boot_linux_console.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)tests/acceptance/boot_linux_console.py +13
-0@@ -1094,6 +1094,32 @@ def do_test_arm_aspeed(self, image): # self.wait_for_console_pattern("login:") self.vm.shutdown() + def test_arm_ast2600_debian(self): + """ + :avocado: tags=arch:arm + :avocado: tags=machine:tacoma-bmc + """ + deb_url = ('http://snapshot.debian.org/archive/debian/' + '20210302T203551Z/' + 'pool/main/l/linux/' + 'linux-image-5.10.0-3-armmp_5.10.13-1_armhf.deb') + deb_hash = 'db40d32fe39255d05482bea48d72467b67d6225bb2a2a4d6f618cb8976f1e09e' + deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash, + algorithm='sha256') + kernel_path = self.extract_from_deb(deb_path, '/boot/vmlinuz-5.10.0-3-armmp')
tests/acceptance/boot_linux_console.py def do_test_arm_aspeed(self, image): · line 1119
Quoted 10 lines
tests/acceptance/boot_linux_console.py +10
-0+ dtb_path = self.extract_from_deb(deb_path, + '/usr/lib/linux-image-5.10.0-3-armmp/aspeed-bmc-opp-tacoma.dtb') + + self.vm.set_console() + self.vm.add_args('-kernel', kernel_path, + '-dtb', dtb_path, + '-net', 'nic') + self.vm.launch() + self.wait_for_console_pattern("Booting Linux on physical CPU 0xf00") + self.wait_for_console_pattern("SMP: Total of 2 processors activated")
Above check isn't reliable. Here the VM started with smp 1, therefore the test failed as:
FAIL: Failure message found in console: Kernel panic - not syncing
tests/acceptance/boot_linux_console.py def do_test_arm_aspeed(self, image): · line 1121
Quoted 2 lines
tests/acceptance/boot_linux_console.py +2
-0+ self.wait_for_console_pattern("No filesystem could mount root") + self.vm.shutdown()
You don't need to shutdown the VM as the test's tearDown() does that for you.
Thanks!
- Wainer
Quoted 4 lines
tests/acceptance/boot_linux_console.py +1
-0+ def test_m68k_mcf5208evb(self): """ :avocado: tags=arch:m68k
Re: [PATCH v2 2/2] tests/acceptance: Test ast2600 machine
Quoted 43 lines · Wainer dos Santos Moschetta
Hi,
Quoted 39 lines · Joel Stanley
This tests a Debian multi-soc arm32 Linux kernel on the AST2600 based Tacoma BMC machine.
There is no root file system so the test terminates when boot reaches the stage where it attempts and fails to mount something.
Signed-off-by Joel Stanley <[email protected]>---
v2: Update expected strings so test passes--- tests/acceptance/boot_linux_console.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)tests/acceptance/boot_linux_console.py +18
-0@@ -1094,6 +1094,32 @@ def do_test_arm_aspeed(self, image): # self.wait_for_console_pattern("login:") self.vm.shutdown() + def test_arm_ast2600_debian(self): + """ + :avocado: tags=arch:arm + :avocado: tags=machine:tacoma-bmc + """ + deb_url = ('http://snapshot.debian.org/archive/debian/' + '20210302T203551Z/' + 'pool/main/l/linux/' + 'linux-image-5.10.0-3-armmp_5.10.13-1_armhf.deb') + deb_hash = 'db40d32fe39255d05482bea48d72467b67d6225bb2a2a4d6f618cb8976f1e09e' + deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash, + algorithm='sha256') + kernel_path = self.extract_from_deb(deb_path, '/boot/vmlinuz-5.10.0-3-armmp') + dtb_path = self.extract_from_deb(deb_path, + '/usr/lib/linux-image-5.10.0-3-armmp/aspeed-bmc-opp-tacoma.dtb') + + self.vm.set_console() + self.vm.add_args('-kernel', kernel_path,
Quoted 8 lines
tests/acceptance/boot_linux_console.py def do_test_arm_aspeed(self, image): · line 1119
Quoted 5 lines
tests/acceptance/boot_linux_console.py +5
-0+ '-dtb', dtb_path, + '-net', 'nic') + self.vm.launch() + self.wait_for_console_pattern("Booting Linux on physical CPU 0xf00") + self.wait_for_console_pattern("SMP: Total of 2 processors activated")Above check isn't reliable. Here the VM started with smp 1, therefore the test failed as:
We should reliably pass that check once this fix has been merged:
https://lore.kernel.org/qemu-devel/[email protected]/T/
Having that line included is helpful, as it tests the smp boot stub functionality in our emulated machine.
Quoted 8 lines
FAIL: Failure message found in console: Kernel panic - not syncing
tests/acceptance/boot_linux_console.py def do_test_arm_aspeed(self, image): · line 1121
Quoted 2 lines
tests/acceptance/boot_linux_console.py +2
-0+ self.wait_for_console_pattern("No filesystem could mount root") + self.vm.shutdown()You don't need to shutdown the VM as the test's
tearDown()does that for you.
Thanks, I'll send a v2 with those removed.
Quoted 10 lines
Thanks!
- Wainer
Quoted 4 lines
tests/acceptance/boot_linux_console.py +1
-0+ def test_m68k_mcf5208evb(self): """ :avocado: tags=arch:m68k
Quoted 6 lines · Joel Stanley
v2: Fix ast2600 test, thanks Cédric for the review.
This adds tests for the Aspeed ARM SoCs. The AST2400 and AST2500 tests use OpenBMC images from that project, fetched from github releases. The AST2600 test uses a Debian arm32 kernel.
Just a note that I'm assuming that Cédric will gather up the various aspeed related patches that have been on the list recently and send a pullreq for them. (Having been on holiday my to-review queue is pretty full so I've just ignored anything aspeed-related; let me know if there is anything you specifically want me to look at, queue, whatever.)
PS: softfreeze is 16 March so a pullreq on list sometime next week would probably be the ideal.
thanks
-- PMM
Quoted 15 lines · Peter Maydell
Quoted 6 lines · Joel Stanley
v2: Fix ast2600 test, thanks Cédric for the review.
This adds tests for the Aspeed ARM SoCs. The AST2400 and AST2500 tests use OpenBMC images from that project, fetched from github releases. The AST2600 test uses a Debian arm32 kernel.
Just a note that I'm assuming that Cédric will gather up the various aspeed related patches that have been on the list recently and send a pullreq for them. (Having been on holiday my to-review queue is pretty full so I've just ignored anything aspeed-related; let me know if there is anything you specifically want me to look at, queue, whatever.)
Quoted 2 lines
PS: softfreeze is 16 March so a pullreq on list sometime next week would probably be the ideal.
Yes. I am preparing the PR.
aspeed: Integrate HACE
hw: Model ASPEED's Hash and Crypto Engine
hw/misc: Model KCS devices in the Aspeed LPC controller hw/misc: Add a basic Aspeed LPC controller model hw/arm: ast2600: Correct the iBT interrupt ID
hw/arm: ast2600: Set AST2600_MAX_IRQ to value from datasheet hw/arm: ast2600: Force a multiple of 32 of IRQs for the GIC hw/arm/aspeed: Fix location of firmware images in documentation
aspeed: Emulate the AST2600A3
tests/acceptance: Test ast2600 machine tests/acceptance: Test ast2400 and ast2500 machines arm/ast2600: Fix SMP booting with -kernel
The HACE patchset needs a second look from an Aspeed-aware person and I have some questions on AST2600A3.
Merging these acceptance tests would be really nice. Have we addressed all you concerns Philippe regarding the image downloads ?
Thanks,
C.
+Alex
Quoted 34 lines · Cédric Le Goater
Quoted 15 lines · Peter Maydell
Quoted 6 lines · Joel Stanley
v2: Fix ast2600 test, thanks Cédric for the review.
This adds tests for the Aspeed ARM SoCs. The AST2400 and AST2500 tests use OpenBMC images from that project, fetched from github releases. The AST2600 test uses a Debian arm32 kernel.
Just a note that I'm assuming that Cédric will gather up the various aspeed related patches that have been on the list recently and send a pullreq for them. (Having been on holiday my to-review queue is pretty full so I've just ignored anything aspeed-related; let me know if there is anything you specifically want me to look at, queue, whatever.)
Quoted 2 lines
PS: softfreeze is 16 March so a pullreq on list sometime next week would probably be the ideal.
Yes. I am preparing the PR.
aspeed: Integrate HACE
hw: Model ASPEED's Hash and Crypto Engine
hw/misc: Model KCS devices in the Aspeed LPC controller hw/misc: Add a basic Aspeed LPC controller model hw/arm: ast2600: Correct the iBT interrupt ID
hw/arm: ast2600: SetAST2600_MAX_IRQto value from datasheet hw/arm: ast2600: Force a multiple of 32 of IRQs for the GIC hw/arm/aspeed: Fix location of firmware images in documentation
aspeed: Emulate the AST2600A3
tests/acceptance: Test ast2600 machine tests/acceptance: Test ast2400 and ast2500 machines arm/ast2600: Fix SMP booting with -kernel
Quoted 5 lines
The HACE patchset needs a second look from an Aspeed-aware person and I have some questions on AST2600A3.
Merging these acceptance tests would be really nice. Have we addressed all you concerns Philippe regarding the image downloads ?
No, but I'll defer to Alex here:
https://www.mail-archive.com/[email protected]/msg787742.html
Quoted 5 lines
Thanks,
C.