Philippe Mathieu-Daudé | b11785c | 2019-10-28 19:04:04 -0400 | [diff] [blame] | 1 | # Functional test that boots a Leon3 machine and checks its serial console. |
| 2 | # |
| 3 | # Copyright (c) Philippe Mathieu-Daudé <f4bug@amsat.org> |
| 4 | # |
| 5 | # This work is licensed under the terms of the GNU GPL, version 2 or |
| 6 | # later. See the COPYING file in the top-level directory. |
| 7 | |
| 8 | from avocado_qemu import Test |
| 9 | from avocado_qemu import wait_for_console_pattern |
Philippe Mathieu-Daudé | 5baecf5 | 2020-03-31 12:50:42 +0200 | [diff] [blame] | 10 | from avocado import skip |
Philippe Mathieu-Daudé | b11785c | 2019-10-28 19:04:04 -0400 | [diff] [blame] | 11 | |
| 12 | |
| 13 | class Leon3Machine(Test): |
| 14 | |
| 15 | timeout = 60 |
| 16 | |
Philippe Mathieu-Daudé | 5baecf5 | 2020-03-31 12:50:42 +0200 | [diff] [blame] | 17 | @skip("Test currently broken") |
| 18 | # A Window Underflow exception occurs before booting the kernel, |
| 19 | # and QEMU exit calling cpu_abort(), which makes this test to fail. |
Philippe Mathieu-Daudé | b11785c | 2019-10-28 19:04:04 -0400 | [diff] [blame] | 20 | def test_leon3_helenos_uimage(self): |
| 21 | """ |
| 22 | :avocado: tags=arch:sparc |
Cleber Rosa | ba21bde | 2019-11-04 10:13:18 -0500 | [diff] [blame] | 23 | :avocado: tags=machine:leon3_generic |
Philippe Mathieu-Daudé | b11785c | 2019-10-28 19:04:04 -0400 | [diff] [blame] | 24 | :avocado: tags=binfmt:uimage |
| 25 | """ |
| 26 | kernel_url = ('http://www.helenos.org/releases/' |
| 27 | 'HelenOS-0.6.0-sparc32-leon3.bin') |
| 28 | kernel_hash = 'a88c9cfdb8430c66650e5290a08765f9bf049a30' |
| 29 | kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) |
| 30 | |
Philippe Mathieu-Daudé | b11785c | 2019-10-28 19:04:04 -0400 | [diff] [blame] | 31 | self.vm.set_console() |
| 32 | self.vm.add_args('-kernel', kernel_path) |
| 33 | |
| 34 | self.vm.launch() |
| 35 | |
| 36 | wait_for_console_pattern(self, 'Copyright (c) 2001-2014 HelenOS project') |
| 37 | wait_for_console_pattern(self, 'Booting the kernel ...') |