From: michaelupton Date: Sun, 20 Sep 2020 22:58:36 +0000 (-0700) Subject: arch-x86, cpu-kvm: add x86 kvm test to long regression X-Git-Tag: develop-gem5-snapshot~497 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=04b87cc29ae5195e0c2fcc1ad895b350de4aa066;p=gem5.git arch-x86, cpu-kvm: add x86 kvm test to long regression revised patch based on reviews Change-Id: I18d219080ff8ab1c42c9e1a12aadd89606802b25 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/34855 Maintainer: Bobby R. Bruce Tested-by: kokoro Reviewed-by: mike upton --- diff --git a/tests/gem5/x86-boot-tests/test_linux_boot.py b/tests/gem5/x86-boot-tests/test_linux_boot.py index d73f3a120..94b6e7eff 100644 --- a/tests/gem5/x86-boot-tests/test_linux_boot.py +++ b/tests/gem5/x86-boot-tests/test_linux_boot.py @@ -25,7 +25,9 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import os +import subprocess from testlib import * +import platform if config.bin_path: @@ -43,8 +45,10 @@ kernel_name = 'vmlinux-4.19.83' # 4.19 is LTS (Projected EOL: Dec, 2020) image = DownloadedProgram(image_url, base_path, image_name, True) kernel = DownloadedProgram(kernel_url, base_path, kernel_name) +def support_kvm(): + return os.access("/dev/kvm", os.R_OK | os.W_OK) -def test_boot(cpu_type, num_cpus, boot_type): +def test_boot(cpu_type, num_cpus, boot_type, host): gem5_verify_config( name = 'test-ubuntu_boot-' + cpu_type + '_cpu-' + num_cpus + '_cpus-' + boot_type + '_boot', @@ -59,14 +63,19 @@ def test_boot(cpu_type, num_cpus, boot_type): '--boot-type', boot_type, ], valid_isas = ('X86',), - valid_hosts = constants.supported_hosts, + valid_hosts = host, length = constants.long_tag, ) # Test every CPU type cpu_types = ('atomic', 'simple',) for cpu_type in cpu_types: - test_boot(cpu_type, '1', 'init') + test_boot(cpu_type, '1', 'init', constants.supported_hosts) # Test a multicore system -test_boot('atomic', '4', 'systemd') +test_boot('atomic', '4', 'systemd', constants.supported_hosts) + +#KVM +if(support_kvm() and (platform.machine() == constants.host_x86_64_tag)): + test_boot('kvm', '1', 'init', (constants.host_x86_64_tag,)) + test_boot('kvm', '4', 'systemd', (constants.host_x86_64_tag,))