1 # Test that Linux kernel boots on ppc machines and check the console
3 # Copyright (c) 2018, 2020 Red Hat, Inc.
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.
8 from avocado
.utils
import archive
9 from avocado_qemu
import QemuSystemTest
10 from avocado_qemu
import wait_for_console_pattern
12 class pseriesMachine(QemuSystemTest
):
15 KERNEL_COMMON_COMMAND_LINE
= 'printk.time=0 '
16 panic_message
= 'Kernel panic - not syncing'
17 good_message
= 'VFS: Cannot open root device'
19 def do_test_ppc64_linux_boot(self
):
20 kernel_url
= ('https://archives.fedoraproject.org/pub/archive'
21 '/fedora-secondary/releases/29/Everything/ppc64le/os'
23 kernel_hash
= '3fe04abfc852b66653b8c3c897a59a689270bc77'
24 kernel_path
= self
.fetch_asset(kernel_url
, asset_hash
=kernel_hash
)
27 kernel_command_line
= self
.KERNEL_COMMON_COMMAND_LINE
+ 'console=hvc0'
28 self
.vm
.add_args('-kernel', kernel_path
,
29 '-append', kernel_command_line
)
32 def test_ppc64_vof_linux_boot(self
):
34 :avocado: tags=arch:ppc64
35 :avocado: tags=machine:pseries
38 self
.vm
.add_args('-machine', 'x-vof=on')
39 self
.do_test_ppc64_linux_boot()
40 console_pattern
= 'VFS: Cannot open root device'
41 wait_for_console_pattern(self
, console_pattern
, self
.panic_message
)
43 def test_ppc64_linux_boot(self
):
45 :avocado: tags=arch:ppc64
46 :avocado: tags=machine:pseries
49 self
.do_test_ppc64_linux_boot()
50 console_pattern
= 'VFS: Cannot open root device'
51 wait_for_console_pattern(self
, console_pattern
, self
.panic_message
)
53 def test_ppc64_linux_smp_boot(self
):
55 :avocado: tags=arch:ppc64
56 :avocado: tags=machine:pseries
59 self
.vm
.add_args('-smp', '4')
60 self
.do_test_ppc64_linux_boot()
61 console_pattern
= 'smp: Brought up 1 node, 4 CPUs'
62 wait_for_console_pattern(self
, console_pattern
, self
.panic_message
)
63 wait_for_console_pattern(self
, self
.good_message
, self
.panic_message
)
65 def test_ppc64_linux_smt_boot(self
):
67 :avocado: tags=arch:ppc64
68 :avocado: tags=machine:pseries
71 self
.vm
.add_args('-smp', '4,threads=4')
72 self
.do_test_ppc64_linux_boot()
73 console_pattern
= 'CPU maps initialized for 4 threads per core'
74 wait_for_console_pattern(self
, console_pattern
, self
.panic_message
)
75 console_pattern
= 'smp: Brought up 1 node, 4 CPUs'
76 wait_for_console_pattern(self
, console_pattern
, self
.panic_message
)
77 wait_for_console_pattern(self
, self
.good_message
, self
.panic_message
)
79 def test_ppc64_linux_big_boot(self
):
81 :avocado: tags=arch:ppc64
82 :avocado: tags=machine:pseries
85 self
.vm
.add_args('-smp', '16,threads=4,cores=2,sockets=2')
86 self
.vm
.add_args('-m', '512M',
87 '-object', 'memory-backend-ram,size=256M,id=m0',
88 '-object', 'memory-backend-ram,size=256M,id=m1')
89 self
.vm
.add_args('-numa', 'node,nodeid=0,memdev=m0')
90 self
.vm
.add_args('-numa', 'node,nodeid=1,memdev=m1')
91 self
.do_test_ppc64_linux_boot()
92 console_pattern
= 'CPU maps initialized for 4 threads per core'
93 wait_for_console_pattern(self
, console_pattern
, self
.panic_message
)
94 console_pattern
= 'smp: Brought up 2 nodes, 16 CPUs'
95 wait_for_console_pattern(self
, console_pattern
, self
.panic_message
)
96 wait_for_console_pattern(self
, self
.good_message
, self
.panic_message
)