From c2a65758e2a56ed26f9210b4842fbdd93f9c6a65 Mon Sep 17 00:00:00 2001 From: Julie-CAO Date: Thu, 11 Jul 2024 15:23:16 +0800 Subject: [PATCH] Support vgpu automation test --- .../autoyast/dev_host_12.xml.ep | 2 +- .../autoyast/dev_host_15.xml.ep | 25 +- data/virt_autotest/vgpu_guest_logging.sh | 11 + lib/ipmi_backend_utils.pm | 4 +- lib/virt_autotest/utils.pm | 29 +- products/sle/main.pm | 1 + tests/virt_autotest/install_package.pm | 40 +- tests/virt_autotest/login_console.pm | 4 +- tests/virt_autotest/vgpu.pm | 356 ++++++++++++++++++ 9 files changed, 421 insertions(+), 51 deletions(-) create mode 100644 data/virt_autotest/vgpu_guest_logging.sh create mode 100644 tests/virt_autotest/vgpu.pm diff --git a/data/virt_autotest/host_unattended_installation_files/autoyast/dev_host_12.xml.ep b/data/virt_autotest/host_unattended_installation_files/autoyast/dev_host_12.xml.ep index b991b02f2f45..8a732e98628b 100644 --- a/data/virt_autotest/host_unattended_installation_files/autoyast/dev_host_12.xml.ep +++ b/data/virt_autotest/host_unattended_installation_files/autoyast/dev_host_12.xml.ep @@ -36,7 +36,7 @@ auto false false - serial --speed=115200 --unit=<%= $get_var->('SERIALDEV') =~ s/ttyS//r %> --word=8 --parity=no --stop=1 + serial --speed=115200 --unit=<%= $get_var->('SERIALDEV', 'ttyS1') =~ s/ttyS//r %> --word=8 --parity=no --stop=1 15 false false diff --git a/data/virt_autotest/host_unattended_installation_files/autoyast/dev_host_15.xml.ep b/data/virt_autotest/host_unattended_installation_files/autoyast/dev_host_15.xml.ep index 8d2ffa9dc7f6..ec4e91eb9e6e 100644 --- a/data/virt_autotest/host_unattended_installation_files/autoyast/dev_host_15.xml.ep +++ b/data/virt_autotest/host_unattended_installation_files/autoyast/dev_host_15.xml.ep @@ -49,12 +49,12 @@ false false false - serial --speed=115200 --unit=<%= $get_var->('SERIALDEV') =~ s/ttyS//r %> --word=8 --parity=no --stop=1 + serial --speed=115200 --unit=<%= $get_var->('SERIALDEV', 'ttyS1') =~ s/ttyS//r %> --word=8 --parity=no --stop=1 15 false console % if ($check_var->('SYSTEM_ROLE', 'xen')) { - splash=silent quiet console=tty <%= defined $bmwqemu::vars{"ENABLE_CONSOLE_KERNEL_LOG"} ? "loglvl=all guest_loglvl=all" : "loglvl=debug guest_loglvl=debug" %> <%= defined $bmwqemu::vars{"OPT_KERNEL_PARAMS"} ? $bmwqemu::vars{"OPT_KERNEL_PARAMS"} : "" %> + splash=silent quiet console=tty <%= defined $bmwqemu::vars{"ENABLE_CONSOLE_KERNEL_LOG"} ? "loglvl=all guest_loglvl=all" : "loglvl=debug guest_loglvl=debug" %> <%= $get_var->('OPT_KERNEL_PARAMS') %> <%= defined $bmwqemu::vars{"XEN_SERIAL_CONSOLE"} ? $bmwqemu::vars{"XEN_SERIAL_CONSOLE"} : "console=com2,115200" %> vga=gfx-1024x768x16 <%= defined $bmwqemu::vars{"ENABLE_CONSOLE_KERNEL_LOG"} ? "loglvl=all guest_loglvl=all" : "loglvl=debug guest_loglvl=debug" %> sync_console @@ -64,15 +64,15 @@ % if ($check_var->('VIRT_SEV_ES_GUEST_INSTALL', '1')) { % if ($check_var->('VERSION', '15-SP6')) { - splash=silent console=<%= $get_var->('SERIALDEV') %>,115200 console=tty kvm_amd.sev=1 <%= defined $bmwqemu::vars{"ENABLE_CONSOLE_KERNEL_LOG"} ? "ignore_loglevel" : "loglevel=5" %> <%= defined $bmwqemu::vars{"OPT_KERNEL_PARAMS"} ? $bmwqemu::vars{"OPT_KERNEL_PARAMS"} : "" %> + splash=silent console=<%= $get_var->('SERIALDEV', 'ttyS1') %>,115200 console=tty kvm_amd.sev=1 <%= defined $bmwqemu::vars{"ENABLE_CONSOLE_KERNEL_LOG"} ? "ignore_loglevel" : "loglevel=5" %> <%= $get_var->('OPT_KERNEL_PARAMS') %> % } else { - splash=silent console=<%= $get_var->('SERIALDEV') %>,115200 console=tty mem_encrypt=on kvm_amd.sev=1 <%= defined $bmwqemu::vars{"ENABLE_CONSOLE_KERNEL_LOG"} ? "ignore_loglevel" : "loglevel=5" %> <%= defined $bmwqemu::vars{"OPT_KERNEL_PARAMS"} ? $bmwqemu::vars{"OPT_KERNEL_PARAMS"} : "" %> + splash=silent console=<%= $get_var->('SERIALDEV', 'ttyS1') %>,115200 console=tty mem_encrypt=on kvm_amd.sev=1 <%= defined $bmwqemu::vars{"ENABLE_CONSOLE_KERNEL_LOG"} ? "ignore_loglevel" : "loglevel=5" %> <%= $get_var->('OPT_KERNEL_PARAMS') %> % } % } else { - splash=silent console=<%= $get_var->('SERIALDEV') %>,115200 console=tty <%= defined $bmwqemu::vars{"ENABLE_CONSOLE_KERNEL_LOG"} ? "ignore_loglevel" : "loglevel=5" %> <%= defined $bmwqemu::vars{"OPT_KERNEL_PARAMS"} ? $bmwqemu::vars{"OPT_KERNEL_PARAMS"} : "" %> + splash=silent console=<%= $get_var->('SERIALDEV', 'ttyS1') %>,115200 console=tty <%= defined $bmwqemu::vars{"ENABLE_CONSOLE_KERNEL_LOG"} ? "ignore_loglevel" : "loglevel=5" %> <%= $get_var->('OPT_KERNEL_PARAMS') %> % } % } else { - splash=silent console=<%= $get_var->('SERIALDEV') %>,115200 console=tty intel_iommu=on <%= defined $bmwqemu::vars{"ENABLE_CONSOLE_KERNEL_LOG"} ? "ignore_loglevel" : "loglevel=5" %> <%= defined $bmwqemu::vars{"OPT_KERNEL_PARAMS"} ? $bmwqemu::vars{"OPT_KERNEL_PARAMS"} : "" %> + splash=silent console=<%= $get_var->('SERIALDEV', 'ttyS1') %>,115200 console=tty intel_iommu=on <%= defined $bmwqemu::vars{"ENABLE_CONSOLE_KERNEL_LOG"} ? "ignore_loglevel" : "loglevel=5" %> <%= $get_var->('OPT_KERNEL_PARAMS') %> % } % } @@ -278,6 +278,19 @@ + + + % if ($check_var->('SYSTEM_ROLE', 'xen') && $check_var->('XEN_DEFAULT_BOOT_IS_SET', 1)) {