From b471c16dd39327e8ce5b6174666c28cfbf34dbd4 Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Mon, 15 Jul 2019 15:37:43 +0200 Subject: Use 128M by default for qemu in oe-selftests Signed-off-by: Laurent Bonnans --- lib/oeqa/selftest/cases/testutils.py | 1 + lib/oeqa/selftest/cases/updater_qemux86_64_ptest.py | 3 +-- scripts/qemucommand.py | 9 ++++++--- scripts/run-qemu-ota | 1 + 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/oeqa/selftest/cases/testutils.py b/lib/oeqa/selftest/cases/testutils.py index 208f822..8d618a6 100644 --- a/lib/oeqa/selftest/cases/testutils.py +++ b/lib/oeqa/selftest/cases/testutils.py @@ -34,6 +34,7 @@ def qemu_boot_image(imagename, **kwargs): args.dir = 'tmp/deploy/images' args.efi = kwargs.get('efi', False) args.machine = kwargs.get('machine', None) + args.mem = kwargs.get('mem', '128M') qemu_use_kvm = get_bb_var("QEMU_USE_KVM") if qemu_use_kvm and \ (qemu_use_kvm == 'True' and 'x86' in args.machine or diff --git a/lib/oeqa/selftest/cases/updater_qemux86_64_ptest.py b/lib/oeqa/selftest/cases/updater_qemux86_64_ptest.py index 83f5841..fe09371 100644 --- a/lib/oeqa/selftest/cases/updater_qemux86_64_ptest.py +++ b/lib/oeqa/selftest/cases/updater_qemux86_64_ptest.py @@ -1,5 +1,4 @@ # pylint: disable=C0111,C0325 -import os import re from oeqa.selftest.case import OESelftestTestCase @@ -22,7 +21,7 @@ class PtestTests(OESelftestTestCase): self.append_config('PTEST_ENABLED_pn-aktualizr = "1"') self.append_config('IMAGE_INSTALL_append += "aktualizr-ptest ptest-runner "') self.append_config('IMAGE_FSTYPES_remove = "ostreepush garagesign garagecheck"') - self.qemu, self.s = qemu_launch(machine='qemux86-64') + self.qemu, self.s = qemu_launch(machine='qemux86-64', mem="768M") def tearDownLocal(self): qemu_terminate(self.s) diff --git a/scripts/qemucommand.py b/scripts/qemucommand.py index 532e331..8b7da2b 100644 --- a/scripts/qemucommand.py +++ b/scripts/qemucommand.py @@ -2,7 +2,7 @@ from os.path import exists, join, realpath, abspath from os import listdir import random import socket -from subprocess import check_output, CalledProcessError +from subprocess import check_output EXTENSIONS = { 'intel-corei7-64': 'wic', @@ -68,6 +68,10 @@ class QemuCommand(object): self.mac_address = random_mac() self.serial_port = find_local_port(8990) self.ssh_port = find_local_port(2222) + if args.mem: + self.mem = args.mem + else: + self.mem = "1G" if args.kvm is None: # Autodetect KVM using 'kvm-ok' try: @@ -95,7 +99,7 @@ class QemuCommand(object): cmdline += ["-drive", "file=%s,if=ide,format=raw,snapshot=on" % self.image] cmdline += [ "-serial", "tcp:127.0.0.1:%d,server,nowait" % self.serial_port, - "-m", "1G", + "-m", self.mem, "-usb", "-object", "rng-random,id=rng0,filename=/dev/urandom", "-device", "virtio-rng-pci,rng=rng0", @@ -131,4 +135,3 @@ class QemuCommand(object): "-f", "qcow2", self.overlay] return cmdline - diff --git a/scripts/run-qemu-ota b/scripts/run-qemu-ota index b2f55e9..de63297 100755 --- a/scripts/run-qemu-ota +++ b/scripts/run-qemu-ota @@ -26,6 +26,7 @@ def main(): dest='kvm', action='store_true', default=None) kvm_group.add_argument('--no-kvm', help='Disable KVM in QEMU', dest='kvm', action='store_false') + parser.add_argument('--mem', default=None, help="Amount of memory the machine boots with") parser.add_argument('--no-gui', help='Disable GUI', action='store_true') parser.add_argument('--gdb', help='Export gdbserver port 2159 from the image', action='store_true') parser.add_argument('--pcap', default=None, help='Dump all network traffic') -- cgit v1.2.3-54-g00ecf