lop-devops / tests

Test Suite
GNU General Public License v3.0
4 stars 41 forks source link

Update regression.cfg to take --boot options #336

Closed misanjumn closed 1 month ago

misanjumn commented 2 months ago

Update regression.cfg to take --boot options

Add the following boot parameters to boot into guest having upstream/custom kernel

  1. kernel_args: kernel commandline arguments
  2. kernel: vmlinux path in host
  3. initrd: initramfs image path in host

Signed-off-by: Misbah Anjum N misanjum@linux.vnet.ibm.com

misanjumn commented 2 months ago

With this patch, if the boot parameters are specified, the following virt-install command is executed for guest import or installation

Example Config file

kernel_args = "root=/dev/sda2 console=hvc0,ttyS0,115200"
kernel = "/boot/vmlinuz-6.11.0-rc3-gd7a5aa4b3c00"
initrd = "/boot/initramfs-6.11.0-rc3-gd7a5aa4b3c00.img"

virt-install

INFO | Running libvirt command (reformatted): 
[stdlog] 2024-08-23 03:21:19,802 avocado.virttest.libvirt_vm libvirt_vm       L2181 INFO | /usr/bin/virt-install 
[stdlog] 2024-08-23 03:21:19,802 avocado.virttest.libvirt_vm libvirt_vm       L2181 INFO |     --connect=qemu:///system 
[stdlog] 2024-08-23 03:21:19,802 avocado.virttest.libvirt_vm libvirt_vm       L2181 INFO |     --hvm 
[stdlog] 2024-08-23 03:21:19,802 avocado.virttest.libvirt_vm libvirt_vm       L2181 INFO |     --accelerate 
[stdlog] 2024-08-23 03:21:19,802 avocado.virttest.libvirt_vm libvirt_vm       L2181 INFO |     --name 'vm1' 
[stdlog] 2024-08-23 03:21:19,802 avocado.virttest.libvirt_vm libvirt_vm       L2181 INFO |     --machine pseries 
[stdlog] 2024-08-23 03:21:19,802 avocado.virttest.libvirt_vm libvirt_vm       L2181 INFO |     --memory=10000 
[stdlog] 2024-08-23 03:21:19,803 avocado.virttest.libvirt_vm libvirt_vm       L2181 INFO |     --vcpu=8,maxvcpus=16,sockets=8,cores=2,threads=1    
[stdlog] 2024-08-23 03:21:19,803 avocado.virttest.libvirt_vm libvirt_vm       L2181 INFO |     --import 
[stdlog] 2024-08-23 03:21:19,803 avocado.virttest.libvirt_vm libvirt_vm       L2181 INFO |     --nographics
[stdlog] 2024-08-23 03:21:19,803 avocado.virttest.libvirt_vm libvirt_vm       L2181 INFO |     --os-variant rhel8.0
[stdlog] 2024-08-23 03:21:19,803 avocado.virttest.libvirt_vm libvirt_vm       L2181 INFO |     --serial pty
[stdlog] 2024-08-23 03:21:19,803 avocado.virttest.libvirt_vm libvirt_vm       L2181 INFO |     --memballoon model=virtio
[stdlog] 2024-08-23 03:21:19,803 avocado.virttest.libvirt_vm libvirt_vm       L2181 INFO |     --controller type=scsi,model=virtio-scsi
[stdlog] 2024-08-23 03:21:19,803 avocado.virttest.libvirt_vm libvirt_vm       L2181 INFO |     --disk path=/home/kvmci/tests/data/avocado-vt/images/rhel8.0devel-ppc64le_vm1.qcow2,bus=scsi,size=10,format=qcow2
[stdlog] 2024-08-23 03:21:19,803 avocado.virttest.libvirt_vm libvirt_vm       L2181 INFO |     --network=bridge=virbr0,model=virtio,mac=***
[stdlog] 2024-08-23 03:21:19,803 avocado.virttest.libvirt_vm libvirt_vm       L2181 INFO |     --mac=***
[stdlog] 2024-08-23 03:21:19,803 avocado.virttest.libvirt_vm libvirt_vm       L2181 INFO |     --boot emulator=/usr/bin/qemu-system-ppc64,kernel=/boot/vmlinuz-6.11.0-rc3-gd7a5aa4b3c00,initrd=/boot/initramfs-6.11.0-rc3-gd7a5aa4b3c00.img,cmdline="root=/dev/sda2 console=hvc0,ttyS0,115200 "
[stdlog] 2024-08-23 03:21:19,803 avocado.virttest.libvirt_vm libvirt_vm       L2181 INFO |     --noautoconsole

....

2024-08-23 03:23:36: Fedora Linux 40 (Server Edition)
2024-08-23 03:23:36: Kernel 6.11.0-rc3-gd7a5aa4b3c00 on an ppc64le (hvc0)
2024-08-23 03:23:36:
2024-08-23 03:23:36: Web console: https://localhost:***/ or https://***:***
2024-08-23 03:23:36:
2024-08-23 03:23:36: localhost login: