2
0

boot_linux.py 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. import os
  11. from avocado_qemu.linuxtest import LinuxTest
  12. from avocado_qemu import BUILD_DIR
  13. from avocado import skipUnless
  14. class BootLinuxX8664(LinuxTest):
  15. """
  16. :avocado: tags=arch:x86_64
  17. """
  18. timeout = 480
  19. def test_pc_i440fx_tcg(self):
  20. """
  21. :avocado: tags=machine:pc
  22. :avocado: tags=accel:tcg
  23. """
  24. self.require_accelerator("tcg")
  25. self.vm.add_args("-accel", "tcg")
  26. self.launch_and_wait(set_up_ssh_connection=False)
  27. def test_pc_i440fx_kvm(self):
  28. """
  29. :avocado: tags=machine:pc
  30. :avocado: tags=accel:kvm
  31. """
  32. self.require_accelerator("kvm")
  33. self.vm.add_args("-accel", "kvm")
  34. self.launch_and_wait(set_up_ssh_connection=False)
  35. def test_pc_q35_tcg(self):
  36. """
  37. :avocado: tags=machine:q35
  38. :avocado: tags=accel:tcg
  39. """
  40. self.require_accelerator("tcg")
  41. self.vm.add_args("-accel", "tcg")
  42. self.launch_and_wait(set_up_ssh_connection=False)
  43. def test_pc_q35_kvm(self):
  44. """
  45. :avocado: tags=machine:q35
  46. :avocado: tags=accel:kvm
  47. """
  48. self.require_accelerator("kvm")
  49. self.vm.add_args("-accel", "kvm")
  50. self.launch_and_wait(set_up_ssh_connection=False)
  51. # For Aarch64 we only boot KVM tests in CI as booting the current
  52. # Fedora OS in TCG tests is very heavyweight. There are lighter weight
  53. # distros which we use in the machine_aarch64_virt.py tests.
  54. class BootLinuxAarch64(LinuxTest):
  55. """
  56. :avocado: tags=arch:aarch64
  57. :avocado: tags=machine:virt
  58. """
  59. timeout = 720
  60. def test_virt_kvm(self):
  61. """
  62. :avocado: tags=accel:kvm
  63. :avocado: tags=cpu:host
  64. """
  65. self.require_accelerator("kvm")
  66. self.vm.add_args("-accel", "kvm")
  67. self.vm.add_args("-machine", "virt,gic-version=host")
  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. self.launch_and_wait(set_up_ssh_connection=False)
  74. # See the tux_baseline.py tests for almost the same coverage in a lot
  75. # less time.
  76. class BootLinuxPPC64(LinuxTest):
  77. """
  78. :avocado: tags=arch:ppc64
  79. """
  80. timeout = 360
  81. @skipUnless(os.getenv('SPEED') == 'slow', 'runtime limited')
  82. def test_pseries_tcg(self):
  83. """
  84. :avocado: tags=machine:pseries
  85. :avocado: tags=accel:tcg
  86. """
  87. self.require_accelerator("tcg")
  88. self.vm.add_args("-accel", "tcg")
  89. self.launch_and_wait(set_up_ssh_connection=False)
  90. def test_pseries_kvm(self):
  91. """
  92. :avocado: tags=machine:pseries
  93. :avocado: tags=accel:kvm
  94. """
  95. self.require_accelerator("kvm")
  96. self.vm.add_args("-accel", "kvm")
  97. self.vm.add_args("-machine", "cap-ccf-assist=off")
  98. self.launch_and_wait(set_up_ssh_connection=False)
  99. class BootLinuxS390X(LinuxTest):
  100. """
  101. :avocado: tags=arch:s390x
  102. """
  103. timeout = 240
  104. @skipUnless(os.getenv('SPEED') == 'slow', 'runtime limited')
  105. def test_s390_ccw_virtio_tcg(self):
  106. """
  107. :avocado: tags=machine:s390-ccw-virtio
  108. :avocado: tags=accel:tcg
  109. """
  110. self.require_accelerator("tcg")
  111. self.vm.add_args("-accel", "tcg")
  112. self.launch_and_wait(set_up_ssh_connection=False)