]> git.proxmox.com Git - mirror_qemu.git/blame - tests/avocado/ppc_pseries.py
Merge tag 'for_upstream' of https://git.kernel.org/pub/scm/virt/kvm/mst/qemu into...
[mirror_qemu.git] / tests / avocado / ppc_pseries.py
CommitLineData
c5f0a816
DG
1# Test that Linux kernel boots on ppc machines and check the console
2#
3# Copyright (c) 2018, 2020 Red Hat, Inc.
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
8from avocado.utils import archive
2283b627 9from avocado_qemu import QemuSystemTest
c5f0a816
DG
10from avocado_qemu import wait_for_console_pattern
11
2283b627 12class pseriesMachine(QemuSystemTest):
c5f0a816
DG
13
14 timeout = 90
15 KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
16 panic_message = 'Kernel panic - not syncing'
242e8b4d 17 good_message = 'VFS: Cannot open root device'
c5f0a816 18
242e8b4d 19 def do_test_ppc64_linux_boot(self):
c5f0a816
DG
20 kernel_url = ('https://archives.fedoraproject.org/pub/archive'
21 '/fedora-secondary/releases/29/Everything/ppc64le/os'
22 '/ppc/ppc64/vmlinuz')
23 kernel_hash = '3fe04abfc852b66653b8c3c897a59a689270bc77'
24 kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
25
26 self.vm.set_console()
27 kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=hvc0'
28 self.vm.add_args('-kernel', kernel_path,
29 '-append', kernel_command_line)
30 self.vm.launch()
242e8b4d 31
5eb63b88
NP
32 def test_ppc64_vof_linux_boot(self):
33 """
34 :avocado: tags=arch:ppc64
35 :avocado: tags=machine:pseries
36 """
37
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)
42
242e8b4d
NP
43 def test_ppc64_linux_boot(self):
44 """
45 :avocado: tags=arch:ppc64
46 :avocado: tags=machine:pseries
47 """
48
49 self.do_test_ppc64_linux_boot()
8f4c627b 50 console_pattern = 'VFS: Cannot open root device'
c5f0a816 51 wait_for_console_pattern(self, console_pattern, self.panic_message)
242e8b4d
NP
52
53 def test_ppc64_linux_smp_boot(self):
54 """
55 :avocado: tags=arch:ppc64
56 :avocado: tags=machine:pseries
57 """
58
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)
64
65 def test_ppc64_linux_smt_boot(self):
66 """
67 :avocado: tags=arch:ppc64
68 :avocado: tags=machine:pseries
69 """
70
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)
78
79 def test_ppc64_linux_big_boot(self):
80 """
81 :avocado: tags=arch:ppc64
82 :avocado: tags=machine:pseries
83 """
84
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)