summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-10-02 12:05:50 +0200
committerChristian Poessinger <christian@poessinger.com>2021-10-02 12:05:50 +0200
commit6c438f92e7ada6fa42e41ac9eff0b1e1eb3756b3 (patch)
tree4fc974d7f7a36ec07cf29671c0ea81f518c1e9ea /scripts
parent769908f498370545f05c81d13fcfe20e7a29cfc5 (diff)
downloadvyos-build-6c438f92e7ada6fa42e41ac9eff0b1e1eb3756b3.tar.gz
vyos-build-6c438f92e7ada6fa42e41ac9eff0b1e1eb3756b3.zip
Testsuite: add support for UEFI boots in Qemu
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/check-qemu-install33
1 files changed, 17 insertions, 16 deletions
diff --git a/scripts/check-qemu-install b/scripts/check-qemu-install
index 4f9aed94..daf7bced 100755
--- a/scripts/check-qemu-install
+++ b/scripts/check-qemu-install
@@ -57,24 +57,19 @@ parser.add_argument('disk', help='name of disk image file',
default='testinstall-{}-{}.img'.format(now.strftime('%Y%m%d-%H%M%S'),
"%04x" % random.randint(0,65535)))
parser.add_argument('--keep', help='Do not remove disk-image after installation',
- action='store_true',
- default=False)
+ action='store_true', default=False)
parser.add_argument('--silent', help='Do not show output on stdout unless an error has occured',
action='store_true',
default=False)
parser.add_argument('--debug', help='Send all debug output to stdout',
- action='store_true',
- default=False)
+ action='store_true', default=False)
parser.add_argument('--logfile', help='Log to file')
-parser.add_argument('--no-kvm', help='Disable use of kvm',
- action='store_true',
- default=False)
+parser.add_argument('--uefi', help='Boot using UEFI', action='store_true', default=False)
+parser.add_argument('--no-kvm', help='Disable use of kvm', action='store_true', default=False)
parser.add_argument('--configd', help='Execute testsuite with config daemon',
- action='store_true',
- default=False)
+ action='store_true', default=False)
parser.add_argument('--configtest', help='Execute load/commit config tests',
- action='store_true',
- default=False)
+ action='store_true', default=False)
args = parser.parse_args()
@@ -109,13 +104,17 @@ def get_half_cpus():
cpu /= 2
return int(cpu)
-def get_qemu_cmd(name, enable_kvm, disk_img, iso_img=None):
- kvm = ""
+def get_qemu_cmd(name, enable_kvm, enable_uefi, disk_img, iso_img=None):
+ kvm = "-enable-kvm"
cpu = "-cpu host"
if not enable_kvm:
kvm = "--no-kvm"
cpu = ""
+ uefi = ""
+ if enable_uefi:
+ uefi = "-bios /usr/share/OVMF/OVMF_CODE.fd"
+
cdrom = ""
if iso_img:
cdrom = "-boot d -cdrom {}".format(iso_img)
@@ -127,7 +126,9 @@ def get_qemu_cmd(name, enable_kvm, disk_img, iso_img=None):
cmd = f'qemu-system-x86_64 \
-name "{name}" \
-smp {cpucount} \
- -m 2G \
+ {uefi} \
+ -m 1G \
+ -vga none \
-netdev user,id=n1 -device virtio-net-pci,netdev=n1,mac={macbase}:01 \
-netdev user,id=n2 -device virtio-net-pci,netdev=n2,mac={macbase}:02 \
-netdev user,id=n3 -device virtio-net-pci,netdev=n3,mac={macbase}:03 \
@@ -194,7 +195,7 @@ try:
# Installing image to disk
#################################################
log.info('Installing system')
- cmd = get_qemu_cmd('TESTVM', kvm, args.disk, args.iso)
+ cmd = get_qemu_cmd('TESTVM', kvm, args.uefi, args.disk, args.iso)
log.debug(f'Executing command: {cmd}')
c = pexpect.spawn(cmd, logfile=stl)
@@ -268,7 +269,7 @@ try:
# Booting installed system
#################################################
log.info('Booting installed system')
- cmd = get_qemu_cmd('TESTVM', kvm, args.disk)
+ cmd = get_qemu_cmd('TESTVM', kvm, args.uefi, args.disk)
log.debug(f'Executing command: {cmd}')
c = pexpect.spawn(cmd, logfile=stl)