]>
Commit | Line | Data |
---|---|---|
6fd52d67 CR |
1 | # Functional test that boots a complete Linux system via a cloud image |
2 | # | |
3 | # Copyright (c) 2018-2020 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 | ||
11 | import os | |
12 | ||
6dd74579 | 13 | from avocado_qemu import LinuxTest, BUILD_DIR |
6fd52d67 | 14 | |
0f26d94e | 15 | from avocado import skipIf |
6fd52d67 | 16 | |
6fd52d67 | 17 | |
6dd74579 | 18 | class BootLinuxX8664(LinuxTest): |
6fd52d67 CR |
19 | """ |
20 | :avocado: tags=arch:x86_64 | |
21 | """ | |
22 | ||
6fd52d67 CR |
23 | def test_pc_i440fx_tcg(self): |
24 | """ | |
25 | :avocado: tags=machine:pc | |
26 | :avocado: tags=accel:tcg | |
27 | """ | |
efe30d50 | 28 | self.require_accelerator("tcg") |
6fd52d67 | 29 | self.vm.add_args("-accel", "tcg") |
c6620c44 | 30 | self.launch_and_wait(set_up_ssh_connection=False) |
6fd52d67 CR |
31 | |
32 | def test_pc_i440fx_kvm(self): | |
33 | """ | |
34 | :avocado: tags=machine:pc | |
35 | :avocado: tags=accel:kvm | |
36 | """ | |
efe30d50 | 37 | self.require_accelerator("kvm") |
6fd52d67 | 38 | self.vm.add_args("-accel", "kvm") |
c6620c44 | 39 | self.launch_and_wait(set_up_ssh_connection=False) |
6fd52d67 CR |
40 | |
41 | def test_pc_q35_tcg(self): | |
42 | """ | |
43 | :avocado: tags=machine:q35 | |
44 | :avocado: tags=accel:tcg | |
45 | """ | |
efe30d50 | 46 | self.require_accelerator("tcg") |
6fd52d67 | 47 | self.vm.add_args("-accel", "tcg") |
c6620c44 | 48 | self.launch_and_wait(set_up_ssh_connection=False) |
6fd52d67 CR |
49 | |
50 | def test_pc_q35_kvm(self): | |
51 | """ | |
52 | :avocado: tags=machine:q35 | |
53 | :avocado: tags=accel:kvm | |
54 | """ | |
efe30d50 | 55 | self.require_accelerator("kvm") |
6fd52d67 | 56 | self.vm.add_args("-accel", "kvm") |
c6620c44 | 57 | self.launch_and_wait(set_up_ssh_connection=False) |
6fd52d67 CR |
58 | |
59 | ||
6dd74579 | 60 | class BootLinuxAarch64(LinuxTest): |
6fd52d67 CR |
61 | """ |
62 | :avocado: tags=arch:aarch64 | |
63 | :avocado: tags=machine:virt | |
64 | :avocado: tags=machine:gic-version=2 | |
65 | """ | |
66 | ||
6fd52d67 CR |
67 | def add_common_args(self): |
68 | self.vm.add_args('-bios', | |
69 | os.path.join(BUILD_DIR, 'pc-bios', | |
70 | 'edk2-aarch64-code.fd')) | |
71 | self.vm.add_args('-device', 'virtio-rng-pci,rng=rng0') | |
72 | self.vm.add_args('-object', 'rng-random,id=rng0,filename=/dev/urandom') | |
73 | ||
e8d61f7d | 74 | def test_virt_tcg_gicv2(self): |
6fd52d67 CR |
75 | """ |
76 | :avocado: tags=accel:tcg | |
77 | :avocado: tags=cpu:max | |
e8d61f7d | 78 | :avocado: tags=device:gicv2 |
6fd52d67 | 79 | """ |
efe30d50 | 80 | self.require_accelerator("tcg") |
6fd52d67 | 81 | self.vm.add_args("-accel", "tcg") |
69b2265d | 82 | self.vm.add_args("-cpu", "max,lpa2=off") |
6fd52d67 CR |
83 | self.vm.add_args("-machine", "virt,gic-version=2") |
84 | self.add_common_args() | |
c6620c44 | 85 | self.launch_and_wait(set_up_ssh_connection=False) |
6fd52d67 | 86 | |
e8d61f7d | 87 | def test_virt_tcg_gicv3(self): |
6fd52d67 | 88 | """ |
e8d61f7d AB |
89 | :avocado: tags=accel:tcg |
90 | :avocado: tags=cpu:max | |
91 | :avocado: tags=device:gicv3 | |
6fd52d67 | 92 | """ |
e8d61f7d AB |
93 | self.require_accelerator("tcg") |
94 | self.vm.add_args("-accel", "tcg") | |
69b2265d | 95 | self.vm.add_args("-cpu", "max,lpa2=off") |
e8d61f7d | 96 | self.vm.add_args("-machine", "virt,gic-version=3") |
6fd52d67 | 97 | self.add_common_args() |
c6620c44 | 98 | self.launch_and_wait(set_up_ssh_connection=False) |
99233758 | 99 | |
e8d61f7d | 100 | def test_virt_kvm(self): |
99233758 PMD |
101 | """ |
102 | :avocado: tags=accel:kvm | |
103 | :avocado: tags=cpu:host | |
99233758 | 104 | """ |
efe30d50 | 105 | self.require_accelerator("kvm") |
99233758 | 106 | self.vm.add_args("-accel", "kvm") |
e8d61f7d | 107 | self.vm.add_args("-machine", "virt,gic-version=host") |
99233758 | 108 | self.add_common_args() |
c6620c44 | 109 | self.launch_and_wait(set_up_ssh_connection=False) |
6fd52d67 CR |
110 | |
111 | ||
6dd74579 | 112 | class BootLinuxPPC64(LinuxTest): |
6fd52d67 CR |
113 | """ |
114 | :avocado: tags=arch:ppc64 | |
115 | """ | |
116 | ||
6fd52d67 CR |
117 | def test_pseries_tcg(self): |
118 | """ | |
119 | :avocado: tags=machine:pseries | |
120 | :avocado: tags=accel:tcg | |
121 | """ | |
efe30d50 | 122 | self.require_accelerator("tcg") |
6fd52d67 | 123 | self.vm.add_args("-accel", "tcg") |
c6620c44 | 124 | self.launch_and_wait(set_up_ssh_connection=False) |
6fd52d67 CR |
125 | |
126 | ||
6dd74579 | 127 | class BootLinuxS390X(LinuxTest): |
6fd52d67 CR |
128 | """ |
129 | :avocado: tags=arch:s390x | |
130 | """ | |
131 | ||
0f26d94e | 132 | @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab') |
6fd52d67 CR |
133 | def test_s390_ccw_virtio_tcg(self): |
134 | """ | |
135 | :avocado: tags=machine:s390-ccw-virtio | |
136 | :avocado: tags=accel:tcg | |
137 | """ | |
efe30d50 | 138 | self.require_accelerator("tcg") |
6fd52d67 | 139 | self.vm.add_args("-accel", "tcg") |
c6620c44 | 140 | self.launch_and_wait(set_up_ssh_connection=False) |