boot_linux.py (3912B)
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 11import os 12 13from avocado_qemu import LinuxTest, BUILD_DIR 14 15from avocado import skipIf 16 17 18class BootLinuxX8664(LinuxTest): 19 """ 20 :avocado: tags=arch:x86_64 21 """ 22 23 def test_pc_i440fx_tcg(self): 24 """ 25 :avocado: tags=machine:pc 26 :avocado: tags=accel:tcg 27 """ 28 self.require_accelerator("tcg") 29 self.vm.add_args("-accel", "tcg") 30 self.launch_and_wait(set_up_ssh_connection=False) 31 32 def test_pc_i440fx_kvm(self): 33 """ 34 :avocado: tags=machine:pc 35 :avocado: tags=accel:kvm 36 """ 37 self.require_accelerator("kvm") 38 self.vm.add_args("-accel", "kvm") 39 self.launch_and_wait(set_up_ssh_connection=False) 40 41 def test_pc_q35_tcg(self): 42 """ 43 :avocado: tags=machine:q35 44 :avocado: tags=accel:tcg 45 """ 46 self.require_accelerator("tcg") 47 self.vm.add_args("-accel", "tcg") 48 self.launch_and_wait(set_up_ssh_connection=False) 49 50 def test_pc_q35_kvm(self): 51 """ 52 :avocado: tags=machine:q35 53 :avocado: tags=accel:kvm 54 """ 55 self.require_accelerator("kvm") 56 self.vm.add_args("-accel", "kvm") 57 self.launch_and_wait(set_up_ssh_connection=False) 58 59 60class BootLinuxAarch64(LinuxTest): 61 """ 62 :avocado: tags=arch:aarch64 63 :avocado: tags=machine:virt 64 :avocado: tags=machine:gic-version=2 65 """ 66 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 74 def test_virt_tcg_gicv2(self): 75 """ 76 :avocado: tags=accel:tcg 77 :avocado: tags=cpu:max 78 :avocado: tags=device:gicv2 79 """ 80 self.require_accelerator("tcg") 81 self.vm.add_args("-accel", "tcg") 82 self.vm.add_args("-machine", "virt,gic-version=2") 83 self.add_common_args() 84 self.launch_and_wait(set_up_ssh_connection=False) 85 86 def test_virt_tcg_gicv3(self): 87 """ 88 :avocado: tags=accel:tcg 89 :avocado: tags=cpu:max 90 :avocado: tags=device:gicv3 91 """ 92 self.require_accelerator("tcg") 93 self.vm.add_args("-accel", "tcg") 94 self.vm.add_args("-machine", "virt,gic-version=3") 95 self.add_common_args() 96 self.launch_and_wait(set_up_ssh_connection=False) 97 98 def test_virt_kvm(self): 99 """ 100 :avocado: tags=accel:kvm 101 :avocado: tags=cpu:host 102 """ 103 self.require_accelerator("kvm") 104 self.vm.add_args("-accel", "kvm") 105 self.vm.add_args("-machine", "virt,gic-version=host") 106 self.add_common_args() 107 self.launch_and_wait(set_up_ssh_connection=False) 108 109 110class BootLinuxPPC64(LinuxTest): 111 """ 112 :avocado: tags=arch:ppc64 113 """ 114 115 def test_pseries_tcg(self): 116 """ 117 :avocado: tags=machine:pseries 118 :avocado: tags=accel:tcg 119 """ 120 self.require_accelerator("tcg") 121 self.vm.add_args("-accel", "tcg") 122 self.launch_and_wait(set_up_ssh_connection=False) 123 124 125class BootLinuxS390X(LinuxTest): 126 """ 127 :avocado: tags=arch:s390x 128 """ 129 130 @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab') 131 def test_s390_ccw_virtio_tcg(self): 132 """ 133 :avocado: tags=machine:s390-ccw-virtio 134 :avocado: tags=accel:tcg 135 """ 136 self.require_accelerator("tcg") 137 self.vm.add_args("-accel", "tcg") 138 self.launch_and_wait(set_up_ssh_connection=False)