]>
Commit | Line | Data |
---|---|---|
c1cc73f4 CR |
1 | # Functional test that boots a Linux kernel and checks the console |
2 | # | |
3 | # Copyright (c) 2018 Red Hat, Inc. | |
4 | # | |
5 | # Author: | |
6 | # Cleber Rosa <crosa@redhat.com> | |
7 | # | |
8 | # This work is licensed under the terms of the GNU GPL, version 2 or | |
9 | # later. See the COPYING file in the top-level directory. | |
10 | ||
f8792047 | 11 | import os |
f375ad6a | 12 | import lzma |
89368673 | 13 | import gzip |
f375ad6a | 14 | import shutil |
c1cc73f4 | 15 | |
efdb45bf | 16 | from avocado import skipUnless |
c1cc73f4 | 17 | from avocado_qemu import Test |
2b17d81f | 18 | from avocado_qemu import exec_command_and_wait_for_pattern |
77bcd248 | 19 | from avocado_qemu import wait_for_console_pattern |
f8792047 PMD |
20 | from avocado.utils import process |
21 | from avocado.utils import archive | |
c1cc73f4 CR |
22 | |
23 | ||
24 | class BootLinuxConsole(Test): | |
25 | """ | |
78664ed8 CR |
26 | Boots a Linux kernel and checks that the console is operational and the |
27 | kernel command line is properly passed from QEMU to the kernel | |
c1cc73f4 CR |
28 | """ |
29 | ||
61f74506 | 30 | timeout = 90 |
c1cc73f4 | 31 | |
b50fcd39 CR |
32 | KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 ' |
33 | ||
77bcd248 CR |
34 | def wait_for_console_pattern(self, success_message): |
35 | wait_for_console_pattern(self, success_message, | |
36 | failure_message='Kernel panic - not syncing') | |
89368673 | 37 | |
f8792047 PMD |
38 | def extract_from_deb(self, deb, path): |
39 | """ | |
40 | Extracts a file from a deb package into the test workdir | |
41 | ||
42 | :param deb: path to the deb archive | |
43 | :param file: path within the deb archive of the file to be extracted | |
44 | :returns: path of the extracted file | |
45 | """ | |
46 | cwd = os.getcwd() | |
47 | os.chdir(self.workdir) | |
6c1c4c33 PMD |
48 | file_path = process.run("ar t %s" % deb).stdout_text.split()[2] |
49 | process.run("ar x %s %s" % (deb, file_path)) | |
50 | archive.extract(file_path, self.workdir) | |
f8792047 PMD |
51 | os.chdir(cwd) |
52 | return self.workdir + path | |
53 | ||
78664ed8 CR |
54 | def test_x86_64_pc(self): |
55 | """ | |
56 | :avocado: tags=arch:x86_64 | |
57 | :avocado: tags=machine:pc | |
58 | """ | |
93bbbdf6 CR |
59 | kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora' |
60 | '/linux/releases/29/Everything/x86_64/os/images/pxeboot' | |
61 | '/vmlinuz') | |
7d7985b1 | 62 | kernel_hash = '23bebd2680757891cf7adedb033532163a792495' |
c1cc73f4 CR |
63 | kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) |
64 | ||
65 | self.vm.set_machine('pc') | |
66 | self.vm.set_console() | |
b50fcd39 | 67 | kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0' |
c1cc73f4 CR |
68 | self.vm.add_args('-kernel', kernel_path, |
69 | '-append', kernel_command_line) | |
70 | self.vm.launch() | |
0d1d74e5 CR |
71 | console_pattern = 'Kernel command line: %s' % kernel_command_line |
72 | self.wait_for_console_pattern(console_pattern) | |
f8792047 PMD |
73 | |
74 | def test_mips_malta(self): | |
75 | """ | |
76 | :avocado: tags=arch:mips | |
77 | :avocado: tags=machine:malta | |
78 | :avocado: tags=endian:big | |
79 | """ | |
80 | deb_url = ('http://snapshot.debian.org/archive/debian/' | |
81 | '20130217T032700Z/pool/main/l/linux-2.6/' | |
82 | 'linux-image-2.6.32-5-4kc-malta_2.6.32-48_mips.deb') | |
83 | deb_hash = 'a8cfc28ad8f45f54811fc6cf74fc43ffcfe0ba04' | |
84 | deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash) | |
85 | kernel_path = self.extract_from_deb(deb_path, | |
86 | '/boot/vmlinux-2.6.32-5-4kc-malta') | |
87 | ||
88 | self.vm.set_machine('malta') | |
89 | self.vm.set_console() | |
90 | kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0' | |
91 | self.vm.add_args('-kernel', kernel_path, | |
92 | '-append', kernel_command_line) | |
93 | self.vm.launch() | |
94 | console_pattern = 'Kernel command line: %s' % kernel_command_line | |
95 | self.wait_for_console_pattern(console_pattern) | |
02c2852b CR |
96 | |
97 | def test_mips64el_malta(self): | |
98 | """ | |
99 | This test requires the ar tool to extract "data.tar.gz" from | |
100 | the Debian package. | |
101 | ||
102 | The kernel can be rebuilt using this Debian kernel source [1] and | |
103 | following the instructions on [2]. | |
104 | ||
105 | [1] http://snapshot.debian.org/package/linux-2.6/2.6.32-48/ | |
106 | #linux-source-2.6.32_2.6.32-48 | |
107 | [2] https://kernel-team.pages.debian.net/kernel-handbook/ | |
108 | ch-common-tasks.html#s-common-official | |
109 | ||
110 | :avocado: tags=arch:mips64el | |
111 | :avocado: tags=machine:malta | |
112 | """ | |
113 | deb_url = ('http://snapshot.debian.org/archive/debian/' | |
114 | '20130217T032700Z/pool/main/l/linux-2.6/' | |
115 | 'linux-image-2.6.32-5-5kc-malta_2.6.32-48_mipsel.deb') | |
116 | deb_hash = '1aaec92083bf22fda31e0d27fa8d9a388e5fc3d5' | |
117 | deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash) | |
118 | kernel_path = self.extract_from_deb(deb_path, | |
119 | '/boot/vmlinux-2.6.32-5-5kc-malta') | |
120 | ||
121 | self.vm.set_machine('malta') | |
122 | self.vm.set_console() | |
123 | kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0' | |
124 | self.vm.add_args('-kernel', kernel_path, | |
125 | '-append', kernel_command_line) | |
126 | self.vm.launch() | |
127 | console_pattern = 'Kernel command line: %s' % kernel_command_line | |
128 | self.wait_for_console_pattern(console_pattern) | |
d4e12161 | 129 | |
89368673 PMD |
130 | def test_mips_malta_cpio(self): |
131 | """ | |
132 | :avocado: tags=arch:mips | |
133 | :avocado: tags=machine:malta | |
134 | :avocado: tags=endian:big | |
135 | """ | |
136 | deb_url = ('http://snapshot.debian.org/archive/debian/' | |
137 | '20160601T041800Z/pool/main/l/linux/' | |
138 | 'linux-image-4.5.0-2-4kc-malta_4.5.5-1_mips.deb') | |
139 | deb_hash = 'a3c84f3e88b54e06107d65a410d1d1e8e0f340f8' | |
140 | deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash) | |
141 | kernel_path = self.extract_from_deb(deb_path, | |
142 | '/boot/vmlinux-4.5.0-2-4kc-malta') | |
143 | initrd_url = ('https://github.com/groeck/linux-build-test/raw/' | |
144 | '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/' | |
145 | 'mips/rootfs.cpio.gz') | |
146 | initrd_hash = 'bf806e17009360a866bf537f6de66590de349a99' | |
147 | initrd_path_gz = self.fetch_asset(initrd_url, asset_hash=initrd_hash) | |
148 | initrd_path = self.workdir + "rootfs.cpio" | |
f2cd6cf6 | 149 | archive.gzip_uncompress(initrd_path_gz, initrd_path) |
89368673 PMD |
150 | |
151 | self.vm.set_machine('malta') | |
152 | self.vm.set_console() | |
153 | kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE | |
154 | + 'console=ttyS0 console=tty ' | |
155 | + 'rdinit=/sbin/init noreboot') | |
156 | self.vm.add_args('-kernel', kernel_path, | |
157 | '-initrd', initrd_path, | |
158 | '-append', kernel_command_line, | |
159 | '-no-reboot') | |
160 | self.vm.launch() | |
161 | self.wait_for_console_pattern('Boot successful.') | |
162 | ||
2b17d81f PMD |
163 | exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo', |
164 | 'BogoMIPS') | |
165 | exec_command_and_wait_for_pattern(self, 'uname -a', | |
166 | 'Debian') | |
167 | exec_command_and_wait_for_pattern(self, 'reboot', | |
168 | 'reboot: Restarting system') | |
89368673 | 169 | |
efdb45bf PMD |
170 | @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code') |
171 | def test_mips64el_malta_5KEc_cpio(self): | |
172 | """ | |
173 | :avocado: tags=arch:mips64el | |
174 | :avocado: tags=machine:malta | |
175 | :avocado: tags=endian:little | |
176 | """ | |
177 | kernel_url = ('https://github.com/philmd/qemu-testing-blob/' | |
178 | 'raw/9ad2df38/mips/malta/mips64el/' | |
179 | 'vmlinux-3.19.3.mtoman.20150408') | |
180 | kernel_hash = '00d1d268fb9f7d8beda1de6bebcc46e884d71754' | |
181 | kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) | |
182 | initrd_url = ('https://github.com/groeck/linux-build-test/' | |
183 | 'raw/8584a59e/rootfs/' | |
184 | 'mipsel64/rootfs.mipsel64r1.cpio.gz') | |
185 | initrd_hash = '1dbb8a396e916847325284dbe2151167' | |
186 | initrd_path_gz = self.fetch_asset(initrd_url, algorithm='md5', | |
187 | asset_hash=initrd_hash) | |
188 | initrd_path = self.workdir + "rootfs.cpio" | |
189 | archive.gzip_uncompress(initrd_path_gz, initrd_path) | |
190 | ||
191 | self.vm.set_machine('malta') | |
192 | self.vm.set_console() | |
193 | kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE | |
194 | + 'console=ttyS0 console=tty ' | |
195 | + 'rdinit=/sbin/init noreboot') | |
196 | self.vm.add_args('-cpu', '5KEc', | |
197 | '-kernel', kernel_path, | |
198 | '-initrd', initrd_path, | |
199 | '-append', kernel_command_line, | |
200 | '-no-reboot') | |
201 | self.vm.launch() | |
202 | wait_for_console_pattern(self, 'Boot successful.') | |
203 | ||
204 | exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo', | |
205 | 'MIPS 5KE') | |
206 | exec_command_and_wait_for_pattern(self, 'uname -a', | |
207 | '3.19.3.mtoman.20150408') | |
208 | exec_command_and_wait_for_pattern(self, 'reboot', | |
209 | 'reboot: Restarting system') | |
89368673 | 210 | |
f375ad6a PMD |
211 | def do_test_mips_malta32el_nanomips(self, kernel_url, kernel_hash): |
212 | kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash) | |
213 | kernel_path = self.workdir + "kernel" | |
214 | with lzma.open(kernel_path_xz, 'rb') as f_in: | |
215 | with open(kernel_path, 'wb') as f_out: | |
216 | shutil.copyfileobj(f_in, f_out) | |
217 | ||
218 | self.vm.set_machine('malta') | |
219 | self.vm.set_console() | |
220 | kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE | |
221 | + 'mem=256m@@0x0 ' | |
222 | + 'console=ttyS0') | |
223 | self.vm.add_args('-no-reboot', | |
224 | '-cpu', 'I7200', | |
225 | '-kernel', kernel_path, | |
226 | '-append', kernel_command_line) | |
227 | self.vm.launch() | |
228 | console_pattern = 'Kernel command line: %s' % kernel_command_line | |
229 | self.wait_for_console_pattern(console_pattern) | |
230 | ||
231 | def test_mips_malta32el_nanomips_4k(self): | |
232 | """ | |
233 | :avocado: tags=arch:mipsel | |
234 | :avocado: tags=machine:malta | |
235 | :avocado: tags=endian:little | |
236 | """ | |
237 | kernel_url = ('https://mipsdistros.mips.com/LinuxDistro/nanomips/' | |
238 | 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/' | |
239 | 'generic_nano32r6el_page4k.xz') | |
240 | kernel_hash = '477456aafd2a0f1ddc9482727f20fe9575565dd6' | |
241 | self.do_test_mips_malta32el_nanomips(kernel_url, kernel_hash) | |
242 | ||
243 | def test_mips_malta32el_nanomips_16k_up(self): | |
244 | """ | |
245 | :avocado: tags=arch:mipsel | |
246 | :avocado: tags=machine:malta | |
247 | :avocado: tags=endian:little | |
248 | """ | |
249 | kernel_url = ('https://mipsdistros.mips.com/LinuxDistro/nanomips/' | |
250 | 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/' | |
251 | 'generic_nano32r6el_page16k_up.xz') | |
252 | kernel_hash = 'e882868f944c71c816e832e2303b7874d044a7bc' | |
253 | self.do_test_mips_malta32el_nanomips(kernel_url, kernel_hash) | |
254 | ||
255 | def test_mips_malta32el_nanomips_64k_dbg(self): | |
256 | """ | |
257 | :avocado: tags=arch:mipsel | |
258 | :avocado: tags=machine:malta | |
259 | :avocado: tags=endian:little | |
260 | """ | |
261 | kernel_url = ('https://mipsdistros.mips.com/LinuxDistro/nanomips/' | |
262 | 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/' | |
263 | 'generic_nano32r6el_page64k_dbg.xz') | |
264 | kernel_hash = '18d1c68f2e23429e266ca39ba5349ccd0aeb7180' | |
265 | self.do_test_mips_malta32el_nanomips(kernel_url, kernel_hash) | |
266 | ||
d4e12161 CR |
267 | def test_aarch64_virt(self): |
268 | """ | |
269 | :avocado: tags=arch:aarch64 | |
270 | :avocado: tags=machine:virt | |
271 | """ | |
93bbbdf6 CR |
272 | kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora' |
273 | '/linux/releases/29/Everything/aarch64/os/images/pxeboot' | |
274 | '/vmlinuz') | |
d4e12161 CR |
275 | kernel_hash = '8c73e469fc6ea06a58dc83a628fc695b693b8493' |
276 | kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) | |
277 | ||
278 | self.vm.set_machine('virt') | |
279 | self.vm.set_console() | |
280 | kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + | |
281 | 'console=ttyAMA0') | |
282 | self.vm.add_args('-cpu', 'cortex-a53', | |
283 | '-kernel', kernel_path, | |
284 | '-append', kernel_command_line) | |
285 | self.vm.launch() | |
286 | console_pattern = 'Kernel command line: %s' % kernel_command_line | |
287 | self.wait_for_console_pattern(console_pattern) | |
1a30892e CR |
288 | |
289 | def test_arm_virt(self): | |
290 | """ | |
291 | :avocado: tags=arch:arm | |
292 | :avocado: tags=machine:virt | |
293 | """ | |
93bbbdf6 CR |
294 | kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora' |
295 | '/linux/releases/29/Everything/armhfp/os/images/pxeboot' | |
296 | '/vmlinuz') | |
1a30892e CR |
297 | kernel_hash = 'e9826d741b4fb04cadba8d4824d1ed3b7fb8b4d4' |
298 | kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) | |
299 | ||
300 | self.vm.set_machine('virt') | |
301 | self.vm.set_console() | |
302 | kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + | |
303 | 'console=ttyAMA0') | |
304 | self.vm.add_args('-kernel', kernel_path, | |
305 | '-append', kernel_command_line) | |
306 | self.vm.launch() | |
307 | console_pattern = 'Kernel command line: %s' % kernel_command_line | |
308 | self.wait_for_console_pattern(console_pattern) | |
79182494 | 309 | |
77ead6b8 PMD |
310 | def test_arm_emcraft_sf2(self): |
311 | """ | |
312 | :avocado: tags=arch:arm | |
313 | :avocado: tags=machine:emcraft_sf2 | |
314 | :avocado: tags=endian:little | |
315 | """ | |
316 | uboot_url = ('https://raw.githubusercontent.com/' | |
317 | 'Subbaraya-Sundeep/qemu-test-binaries/' | |
318 | 'fa030bd77a014a0b8e360d3b7011df89283a2f0b/u-boot') | |
319 | uboot_hash = 'abba5d9c24cdd2d49cdc2a8aa92976cf20737eff' | |
320 | uboot_path = self.fetch_asset(uboot_url, asset_hash=uboot_hash) | |
321 | spi_url = ('https://raw.githubusercontent.com/' | |
322 | 'Subbaraya-Sundeep/qemu-test-binaries/' | |
323 | 'fa030bd77a014a0b8e360d3b7011df89283a2f0b/spi.bin') | |
324 | spi_hash = '85f698329d38de63aea6e884a86fbde70890a78a' | |
325 | spi_path = self.fetch_asset(spi_url, asset_hash=spi_hash) | |
326 | ||
327 | self.vm.set_machine('emcraft-sf2') | |
328 | self.vm.set_console() | |
329 | kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE | |
330 | self.vm.add_args('-kernel', uboot_path, | |
331 | '-append', kernel_command_line, | |
332 | '-drive', 'file=' + spi_path + ',if=mtd,format=raw', | |
333 | '-no-reboot') | |
334 | self.vm.launch() | |
335 | self.wait_for_console_pattern('init started: BusyBox') | |
336 | ||
92d93612 PMD |
337 | def do_test_arm_raspi2(self, uart_id): |
338 | """ | |
339 | The kernel can be rebuilt using the kernel source referenced | |
340 | and following the instructions on the on: | |
341 | https://www.raspberrypi.org/documentation/linux/kernel/building.md | |
342 | """ | |
343 | serial_kernel_cmdline = { | |
344 | 0: 'earlycon=pl011,0x3f201000 console=ttyAMA0', | |
345 | } | |
346 | deb_url = ('http://archive.raspberrypi.org/debian/' | |
347 | 'pool/main/r/raspberrypi-firmware/' | |
348 | 'raspberrypi-kernel_1.20190215-1_armhf.deb') | |
349 | deb_hash = 'cd284220b32128c5084037553db3c482426f3972' | |
350 | deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash) | |
351 | kernel_path = self.extract_from_deb(deb_path, '/boot/kernel7.img') | |
352 | dtb_path = self.extract_from_deb(deb_path, '/boot/bcm2709-rpi-2-b.dtb') | |
353 | ||
354 | self.vm.set_machine('raspi2') | |
355 | self.vm.set_console() | |
356 | kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + | |
357 | serial_kernel_cmdline[uart_id]) | |
358 | self.vm.add_args('-kernel', kernel_path, | |
359 | '-dtb', dtb_path, | |
360 | '-append', kernel_command_line) | |
361 | self.vm.launch() | |
362 | console_pattern = 'Kernel command line: %s' % kernel_command_line | |
363 | self.wait_for_console_pattern(console_pattern) | |
364 | ||
365 | def test_arm_raspi2_uart0(self): | |
366 | """ | |
367 | :avocado: tags=arch:arm | |
368 | :avocado: tags=machine:raspi2 | |
369 | :avocado: tags=device:pl011 | |
370 | """ | |
371 | self.do_test_arm_raspi2(0) | |
372 | ||
017aa60b PMD |
373 | def test_arm_exynos4210_initrd(self): |
374 | """ | |
375 | :avocado: tags=arch:arm | |
376 | :avocado: tags=machine:smdkc210 | |
377 | """ | |
378 | deb_url = ('https://snapshot.debian.org/archive/debian/' | |
379 | '20190928T224601Z/pool/main/l/linux/' | |
380 | 'linux-image-4.19.0-6-armmp_4.19.67-2+deb10u1_armhf.deb') | |
381 | deb_hash = 'fa9df4a0d38936cb50084838f2cb933f570d7d82' | |
382 | deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash) | |
383 | kernel_path = self.extract_from_deb(deb_path, | |
384 | '/boot/vmlinuz-4.19.0-6-armmp') | |
385 | dtb_path = '/usr/lib/linux-image-4.19.0-6-armmp/exynos4210-smdkv310.dtb' | |
386 | dtb_path = self.extract_from_deb(deb_path, dtb_path) | |
387 | ||
388 | initrd_url = ('https://github.com/groeck/linux-build-test/raw/' | |
389 | '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/' | |
390 | 'arm/rootfs-armv5.cpio.gz') | |
391 | initrd_hash = '2b50f1873e113523967806f4da2afe385462ff9b' | |
392 | initrd_path_gz = self.fetch_asset(initrd_url, asset_hash=initrd_hash) | |
393 | initrd_path = os.path.join(self.workdir, 'rootfs.cpio') | |
394 | archive.gzip_uncompress(initrd_path_gz, initrd_path) | |
395 | ||
396 | self.vm.set_machine('smdkc210') | |
397 | self.vm.set_console() | |
398 | kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + | |
399 | 'earlycon=exynos4210,0x13800000 earlyprintk ' + | |
400 | 'console=ttySAC0,115200n8 ' + | |
401 | 'random.trust_cpu=off cryptomgr.notests ' + | |
402 | 'cpuidle.off=1 panic=-1 noreboot') | |
403 | ||
404 | self.vm.add_args('-kernel', kernel_path, | |
405 | '-dtb', dtb_path, | |
406 | '-initrd', initrd_path, | |
407 | '-append', kernel_command_line, | |
408 | '-no-reboot') | |
409 | self.vm.launch() | |
410 | ||
411 | self.wait_for_console_pattern('Boot successful.') | |
412 | # TODO user command, for now the uart is stuck | |
413 | ||
79182494 CR |
414 | def test_s390x_s390_ccw_virtio(self): |
415 | """ | |
416 | :avocado: tags=arch:s390x | |
417 | :avocado: tags=machine:s390_ccw_virtio | |
418 | """ | |
93bbbdf6 CR |
419 | kernel_url = ('https://archives.fedoraproject.org/pub/archive' |
420 | '/fedora-secondary/releases/29/Everything/s390x/os/images' | |
421 | '/kernel.img') | |
79182494 CR |
422 | kernel_hash = 'e8e8439103ef8053418ef062644ffd46a7919313' |
423 | kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) | |
424 | ||
425 | self.vm.set_machine('s390-ccw-virtio') | |
426 | self.vm.set_console() | |
427 | kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=sclp0' | |
428 | self.vm.add_args('-nodefaults', | |
429 | '-kernel', kernel_path, | |
430 | '-append', kernel_command_line) | |
431 | self.vm.launch() | |
432 | console_pattern = 'Kernel command line: %s' % kernel_command_line | |
433 | self.wait_for_console_pattern(console_pattern) | |
b36b5937 CR |
434 | |
435 | def test_alpha_clipper(self): | |
436 | """ | |
437 | :avocado: tags=arch:alpha | |
438 | :avocado: tags=machine:clipper | |
439 | """ | |
440 | kernel_url = ('http://archive.debian.org/debian/dists/lenny/main/' | |
441 | 'installer-alpha/current/images/cdrom/vmlinuz') | |
442 | kernel_hash = '3a943149335529e2ed3e74d0d787b85fb5671ba3' | |
443 | kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) | |
444 | ||
445 | uncompressed_kernel = archive.uncompress(kernel_path, self.workdir) | |
446 | ||
447 | self.vm.set_machine('clipper') | |
448 | self.vm.set_console() | |
449 | kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0' | |
450 | self.vm.add_args('-vga', 'std', | |
451 | '-kernel', uncompressed_kernel, | |
452 | '-append', kernel_command_line) | |
453 | self.vm.launch() | |
454 | console_pattern = 'Kernel command line: %s' % kernel_command_line | |
455 | self.wait_for_console_pattern(console_pattern) | |
83fa3bc3 CR |
456 | |
457 | def test_ppc64_pseries(self): | |
458 | """ | |
459 | :avocado: tags=arch:ppc64 | |
460 | :avocado: tags=machine:pseries | |
461 | """ | |
93bbbdf6 CR |
462 | kernel_url = ('https://archives.fedoraproject.org/pub/archive' |
463 | '/fedora-secondary/releases/29/Everything/ppc64le/os' | |
464 | '/ppc/ppc64/vmlinuz') | |
83fa3bc3 CR |
465 | kernel_hash = '3fe04abfc852b66653b8c3c897a59a689270bc77' |
466 | kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) | |
467 | ||
468 | self.vm.set_machine('pseries') | |
469 | self.vm.set_console() | |
470 | kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=hvc0' | |
471 | self.vm.add_args('-kernel', kernel_path, | |
472 | '-append', kernel_command_line) | |
473 | self.vm.launch() | |
474 | console_pattern = 'Kernel command line: %s' % kernel_command_line | |
475 | self.wait_for_console_pattern(console_pattern) | |
f7d85525 PMD |
476 | |
477 | def test_m68k_q800(self): | |
478 | """ | |
479 | :avocado: tags=arch:m68k | |
480 | :avocado: tags=machine:q800 | |
481 | """ | |
f44b5549 PMD |
482 | deb_url = ('https://snapshot.debian.org/archive/debian-ports' |
483 | '/20191021T083923Z/pool-m68k/main' | |
2ecde8b2 CR |
484 | '/l/linux/kernel-image-5.3.0-1-m68k-di_5.3.7-1_m68k.udeb') |
485 | deb_hash = '044954bb9be4160a3ce81f8bc1b5e856b75cccd1' | |
b67d22aa | 486 | deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash) |
f7d85525 | 487 | kernel_path = self.extract_from_deb(deb_path, |
2ecde8b2 | 488 | '/boot/vmlinux-5.3.0-1-m68k') |
f7d85525 PMD |
489 | |
490 | self.vm.set_machine('q800') | |
491 | self.vm.set_console() | |
492 | kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + | |
493 | 'console=ttyS0 vga=off') | |
494 | self.vm.add_args('-kernel', kernel_path, | |
495 | '-append', kernel_command_line) | |
496 | self.vm.launch() | |
497 | console_pattern = 'Kernel command line: %s' % kernel_command_line | |
498 | self.wait_for_console_pattern(console_pattern) | |
499 | console_pattern = 'No filesystem could mount root' | |
500 | self.wait_for_console_pattern(console_pattern) |