summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2025-01-13 11:20:51 +0200
committerGitHub <noreply@github.com>2025-01-13 11:20:51 +0200
commita2fb862feaa4921c67e2c8d22dee9946f7a9b71d (patch)
tree6339dbed7fad2bf1954291b2c0feded42c4c6262
parent7d86ca29beaac0e43cb8eb721a5c365eae71ffb4 (diff)
parent51895a5c98fcfb3c1400123c1ab1da4c0b8434c5 (diff)
downloadvyos-build-a2fb862feaa4921c67e2c8d22dee9946f7a9b71d.tar.gz
vyos-build-a2fb862feaa4921c67e2c8d22dee9946f7a9b71d.zip
Merge pull request #884 from sever-sever/T7043
T7043: Add arguments for CPU and memory for the check-qemu-install
-rwxr-xr-xscripts/check-qemu-install12
1 files changed, 9 insertions, 3 deletions
diff --git a/scripts/check-qemu-install b/scripts/check-qemu-install
index 11083706..5a59f13c 100755
--- a/scripts/check-qemu-install
+++ b/scripts/check-qemu-install
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2019-2024, VyOS maintainers and contributors
+# Copyright (C) 2019-2025, VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
@@ -95,6 +95,8 @@ parser.add_argument('--sbtest', help='Execute Secure Boot tests',
action='store_true', default=False)
parser.add_argument('--qemu-cmd', help='Only generate QEMU launch command',
action='store_true', default=False)
+parser.add_argument('--cpu', help='Set QEMU CPU', type=int, default=2)
+parser.add_argument('--memory', help='Set QEMU memory', type=int, default=4)
args = parser.parse_args()
@@ -168,11 +170,11 @@ def get_qemu_cmd(name, enable_uefi, disk_img, raid=None, iso_img=None, tpm=False
macbase = '00:00:5E:00:53'
cmd = f'qemu-system-x86_64 \
-name "{name}" \
- -smp 2,sockets=1,cores=2,threads=1 \
+ -smp {args.cpu},sockets=1,cores={args.cpu},threads=1 \
-cpu host \
-machine {machine},accel=kvm \
{uefi} \
- -m 4G \
+ -m {args.memory}G \
-vga none \
-nographic \
{vga} {vnc}\
@@ -546,6 +548,10 @@ try:
c.sendline('systemd-detect-virt')
c.expect('kvm')
c.expect(op_mode_prompt)
+ c.sendline('show system cpu')
+ c.expect(op_mode_prompt)
+ c.sendline('show system memory')
+ c.expect(op_mode_prompt)
#################################################
# Verify /etc/os-release via lsb_release