]>
git.proxmox.com Git - mirror_qemu.git/blob - tests/avocado/boot_linux.py
1 # Functional test that boots a complete Linux system via a cloud image
3 # Copyright (c) 2018-2020 Red Hat, Inc.
6 # Cleber Rosa <crosa@redhat.com>
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.
13 from avocado_qemu
import LinuxTest
, BUILD_DIR
15 from avocado
import skipIf
18 class BootLinuxX8664(LinuxTest
):
20 :avocado: tags=arch:x86_64
24 def test_pc_i440fx_tcg(self
):
26 :avocado: tags=machine:pc
27 :avocado: tags=accel:tcg
29 self
.require_accelerator("tcg")
30 self
.vm
.add_args("-accel", "tcg")
31 self
.launch_and_wait(set_up_ssh_connection
=False)
33 def test_pc_i440fx_kvm(self
):
35 :avocado: tags=machine:pc
36 :avocado: tags=accel:kvm
38 self
.require_accelerator("kvm")
39 self
.vm
.add_args("-accel", "kvm")
40 self
.launch_and_wait(set_up_ssh_connection
=False)
42 def test_pc_q35_tcg(self
):
44 :avocado: tags=machine:q35
45 :avocado: tags=accel:tcg
47 self
.require_accelerator("tcg")
48 self
.vm
.add_args("-accel", "tcg")
49 self
.launch_and_wait(set_up_ssh_connection
=False)
51 def test_pc_q35_kvm(self
):
53 :avocado: tags=machine:q35
54 :avocado: tags=accel:kvm
56 self
.require_accelerator("kvm")
57 self
.vm
.add_args("-accel", "kvm")
58 self
.launch_and_wait(set_up_ssh_connection
=False)
61 class BootLinuxAarch64(LinuxTest
):
63 :avocado: tags=arch:aarch64
64 :avocado: tags=machine:virt
65 :avocado: tags=machine:gic-version=2
69 def add_common_args(self
):
70 self
.vm
.add_args('-bios',
71 os
.path
.join(BUILD_DIR
, 'pc-bios',
72 'edk2-aarch64-code.fd'))
73 self
.vm
.add_args('-device', 'virtio-rng-pci,rng=rng0')
74 self
.vm
.add_args('-object', 'rng-random,id=rng0,filename=/dev/urandom')
76 def test_virt_tcg_gicv2(self
):
78 :avocado: tags=accel:tcg
79 :avocado: tags=cpu:max
80 :avocado: tags=device:gicv2
82 self
.require_accelerator("tcg")
83 self
.vm
.add_args("-accel", "tcg")
84 self
.vm
.add_args("-cpu", "max,lpa2=off")
85 self
.vm
.add_args("-machine", "virt,gic-version=2")
86 self
.add_common_args()
87 self
.launch_and_wait(set_up_ssh_connection
=False)
89 def test_virt_tcg_gicv3(self
):
91 :avocado: tags=accel:tcg
92 :avocado: tags=cpu:max
93 :avocado: tags=device:gicv3
95 self
.require_accelerator("tcg")
96 self
.vm
.add_args("-accel", "tcg")
97 self
.vm
.add_args("-cpu", "max,lpa2=off")
98 self
.vm
.add_args("-machine", "virt,gic-version=3")
99 self
.add_common_args()
100 self
.launch_and_wait(set_up_ssh_connection
=False)
102 def test_virt_kvm(self
):
104 :avocado: tags=accel:kvm
105 :avocado: tags=cpu:host
107 self
.require_accelerator("kvm")
108 self
.vm
.add_args("-accel", "kvm")
109 self
.vm
.add_args("-machine", "virt,gic-version=host")
110 self
.add_common_args()
111 self
.launch_and_wait(set_up_ssh_connection
=False)
114 class BootLinuxPPC64(LinuxTest
):
116 :avocado: tags=arch:ppc64
121 def test_pseries_tcg(self
):
123 :avocado: tags=machine:pseries
124 :avocado: tags=accel:tcg
126 self
.require_accelerator("tcg")
127 self
.vm
.add_args("-accel", "tcg")
128 self
.launch_and_wait(set_up_ssh_connection
=False)
131 class BootLinuxS390X(LinuxTest
):
133 :avocado: tags=arch:s390x
138 @skipIf(os
.getenv('GITLAB_CI'), 'Running on GitLab')
139 def test_s390_ccw_virtio_tcg(self
):
141 :avocado: tags=machine:s390-ccw-virtio
142 :avocado: tags=accel:tcg
144 self
.require_accelerator("tcg")
145 self
.vm
.add_args("-accel", "tcg")
146 self
.launch_and_wait(set_up_ssh_connection
=False)