diff options
author | Christian Breunig <christian@breunig.cc> | 2024-09-06 20:35:17 +0200 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2024-09-07 21:32:34 +0200 |
commit | 115fb522c8d814ceb72ce98b14181f5d6f95890b (patch) | |
tree | 301e9f7c76b6e3c5c7f07cefc4f23320d90f571e /scripts/check-qemu-install | |
parent | 986b71af2d72f3da4c7fcae4bd061e57734592b4 (diff) | |
download | vyos-build-115fb522c8d814ceb72ce98b14181f5d6f95890b.tar.gz vyos-build-115fb522c8d814ceb72ce98b14181f5d6f95890b.zip |
Testsuite: T861: add support to use VNC for a graphics console
To use VNC you could run "make test -- --vnc"
Diffstat (limited to 'scripts/check-qemu-install')
-rwxr-xr-x | scripts/check-qemu-install | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/scripts/check-qemu-install b/scripts/check-qemu-install index a3d90a70..28741986 100755 --- a/scripts/check-qemu-install +++ b/scripts/check-qemu-install @@ -66,6 +66,7 @@ parser.add_argument('--debug', help='Send all debug output to stdout', parser.add_argument('--logfile', help='Log to file') parser.add_argument('--match', help='Smoketests to run') parser.add_argument('--uefi', help='Boot using UEFI', action='store_true', default=False) +parser.add_argument('--vnc', help='Enable VNC', action='store_true', default=False) parser.add_argument('--raid', help='Perform a RAID-1 install', action='store_true', default=False) parser.add_argument('--configd', help='Execute testsuite with config daemon', action='store_true', default=False) @@ -111,7 +112,7 @@ def get_half_cpus(): cpu /= 2 return int(cpu) -def get_qemu_cmd(name, enable_uefi, disk_img, raid=None, iso_img=None, tpm=False): +def get_qemu_cmd(name, enable_uefi, disk_img, raid=None, iso_img=None, tpm=False, vnc_enabled=False): uefi = "" uuid = "f48b60b2-e6ad-49ef-9d09-4245d0585e52" if enable_uefi: @@ -119,6 +120,10 @@ def get_qemu_cmd(name, enable_uefi, disk_img, raid=None, iso_img=None, tpm=False name = f'{name}-UEFI' uuid = 'd27cf29e-4419-4407-8f82-dc73d1acd184' + vga = '-vga none' + if vnc_enabled: + vga = ' -vga virtio -vnc :0' + bootindex = '1' cdrom = "" if iso_img: @@ -142,6 +147,7 @@ def get_qemu_cmd(name, enable_uefi, disk_img, raid=None, iso_img=None, tpm=False -m 4G \ -vga none \ -nographic \ + {vga} \ -machine accel=kvm \ -uuid {uuid} \ -cpu host \ @@ -280,7 +286,7 @@ def start_swtpm(): return tpm_process if args.qemu_cmd: - tmp = get_qemu_cmd(qemu_name, args.uefi, args.disk, diskname_raid, args.iso) + tmp = get_qemu_cmd(qemu_name, args.uefi, args.disk, raid=diskname_raid, iso_img=args.iso, vnc_enabled=args.vnc) os.system(tmp) exit(0) @@ -291,7 +297,7 @@ try: # Installing image to disk ################################################# log.info('Installing system') - cmd = get_qemu_cmd(qemu_name, args.uefi, args.disk, diskname_raid, args.iso) + cmd = get_qemu_cmd(qemu_name, args.uefi, args.disk, raid=diskname_raid, iso_img=args.iso, vnc_enabled=args.vnc) log.debug(f'Executing command: {cmd}') c = pexpect.spawn(cmd, logfile=stl, timeout=60) @@ -489,7 +495,7 @@ try: # Booting back into VM log.info('Booting TPM-backed system') - cmd = get_qemu_cmd(qemu_name, args.uefi, args.disk, diskname_raid, tpm=args.tpmtest) + cmd = get_qemu_cmd(qemu_name, args.uefi, args.disk, raid=diskname_raid, tpm=args.tpmtest, vnc_enabled=args.vnc) log.debug(f'Executing command: {cmd}') c = pexpect.spawn(cmd, logfile=stl) @@ -524,7 +530,7 @@ try: # Booting back into VM log.info('Booting system with cleared TPM') - cmd = get_qemu_cmd(qemu_name, args.uefi, args.disk, diskname_raid, tpm=args.tpmtest) + cmd = get_qemu_cmd(qemu_name, args.uefi, args.disk, raid=diskname_raid, tpm=args.tpmtest, vnc_enabled=args.vnc) log.debug(f'Executing command: {cmd}') c = pexpect.spawn(cmd, logfile=stl) @@ -576,7 +582,7 @@ try: # Booting RAID-1 system with one missing disk ################################################# log.info('Booting RAID-1 system') - cmd = get_qemu_cmd(qemu_name, args.uefi, args.disk, diskname_raid) + cmd = get_qemu_cmd(qemu_name, args.uefi, args.disk, raid=diskname_raid, vnc_enabled=args.vnc) # We need to swap boot indexes to boot from second harddisk so we can # recreate the RAID on the first disk @@ -626,7 +632,7 @@ try: shutdownVM(c, log, f'Shutdown VM and start from recovered RAID member "{args.disk}"') log.info('Booting RAID-1 system') - cmd = get_qemu_cmd(qemu_name, args.uefi, args.disk, diskname_raid) + cmd = get_qemu_cmd(qemu_name, args.uefi, args.disk, raid=diskname_raid, vnc_enabled=args.vnc) log.debug(f'Executing command: {cmd}') c = pexpect.spawn(cmd, logfile=stl) |