diff options
author | Laurent Bonnans <laurent.bonnans@here.com> | 2019-07-15 15:37:43 +0200 |
---|---|---|
committer | Laurent Bonnans <laurent.bonnans@here.com> | 2019-07-17 18:28:28 +0200 |
commit | aaee0a8f502e588a0a161d62f7393bf616e01526 (patch) | |
tree | 48bc08425526fd9818313a2fce9ea1cc3f82e84a | |
parent | 2cfbf9bd383994580ac2bf6cf44b7b9119689486 (diff) | |
download | meta-updater-aaee0a8f502e588a0a161d62f7393bf616e01526.tar.gz |
Use 128M by default for qemu in oe-selftests
Signed-off-by: Laurent Bonnans <laurent.bonnans@here.com>
-rw-r--r-- | lib/oeqa/selftest/cases/testutils.py | 1 | ||||
-rw-r--r-- | lib/oeqa/selftest/cases/updater_qemux86_64_ptest.py | 3 | ||||
-rw-r--r-- | scripts/qemucommand.py | 9 | ||||
-rwxr-xr-x | 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): | |||
34 | args.dir = 'tmp/deploy/images' | 34 | args.dir = 'tmp/deploy/images' |
35 | args.efi = kwargs.get('efi', False) | 35 | args.efi = kwargs.get('efi', False) |
36 | args.machine = kwargs.get('machine', None) | 36 | args.machine = kwargs.get('machine', None) |
37 | args.mem = kwargs.get('mem', '128M') | ||
37 | qemu_use_kvm = get_bb_var("QEMU_USE_KVM") | 38 | qemu_use_kvm = get_bb_var("QEMU_USE_KVM") |
38 | if qemu_use_kvm and \ | 39 | if qemu_use_kvm and \ |
39 | (qemu_use_kvm == 'True' and 'x86' in args.machine or | 40 | (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 @@ | |||
1 | # pylint: disable=C0111,C0325 | 1 | # pylint: disable=C0111,C0325 |
2 | import os | ||
3 | import re | 2 | import re |
4 | 3 | ||
5 | from oeqa.selftest.case import OESelftestTestCase | 4 | from oeqa.selftest.case import OESelftestTestCase |
@@ -22,7 +21,7 @@ class PtestTests(OESelftestTestCase): | |||
22 | self.append_config('PTEST_ENABLED_pn-aktualizr = "1"') | 21 | self.append_config('PTEST_ENABLED_pn-aktualizr = "1"') |
23 | self.append_config('IMAGE_INSTALL_append += "aktualizr-ptest ptest-runner "') | 22 | self.append_config('IMAGE_INSTALL_append += "aktualizr-ptest ptest-runner "') |
24 | self.append_config('IMAGE_FSTYPES_remove = "ostreepush garagesign garagecheck"') | 23 | self.append_config('IMAGE_FSTYPES_remove = "ostreepush garagesign garagecheck"') |
25 | self.qemu, self.s = qemu_launch(machine='qemux86-64') | 24 | self.qemu, self.s = qemu_launch(machine='qemux86-64', mem="768M") |
26 | 25 | ||
27 | def tearDownLocal(self): | 26 | def tearDownLocal(self): |
28 | qemu_terminate(self.s) | 27 | qemu_terminate(self.s) |
diff --git a/scripts/qemucommand.py b/scripts/qemucommand.py index 1049d7c..3045b45 100644 --- a/scripts/qemucommand.py +++ b/scripts/qemucommand.py | |||
@@ -2,7 +2,7 @@ from os.path import exists, join, realpath, abspath | |||
2 | from os import listdir | 2 | from os import listdir |
3 | import random | 3 | import random |
4 | import socket | 4 | import socket |
5 | from subprocess import check_output, CalledProcessError | 5 | from subprocess import check_output |
6 | 6 | ||
7 | EXTENSIONS = { | 7 | EXTENSIONS = { |
8 | 'intel-corei7-64': 'wic', | 8 | 'intel-corei7-64': 'wic', |
@@ -68,6 +68,10 @@ class QemuCommand(object): | |||
68 | self.mac_address = random_mac() | 68 | self.mac_address = random_mac() |
69 | self.serial_port = find_local_port(8990) | 69 | self.serial_port = find_local_port(8990) |
70 | self.ssh_port = find_local_port(2222) | 70 | self.ssh_port = find_local_port(2222) |
71 | if args.mem: | ||
72 | self.mem = args.mem | ||
73 | else: | ||
74 | self.mem = "1G" | ||
71 | if args.kvm is None: | 75 | if args.kvm is None: |
72 | # Autodetect KVM using 'kvm-ok' | 76 | # Autodetect KVM using 'kvm-ok' |
73 | try: | 77 | try: |
@@ -95,7 +99,7 @@ class QemuCommand(object): | |||
95 | cmdline += ["-drive", "file=%s,if=ide,format=raw,snapshot=on" % self.image] | 99 | cmdline += ["-drive", "file=%s,if=ide,format=raw,snapshot=on" % self.image] |
96 | cmdline += [ | 100 | cmdline += [ |
97 | "-serial", "tcp:127.0.0.1:%d,server,nowait" % self.serial_port, | 101 | "-serial", "tcp:127.0.0.1:%d,server,nowait" % self.serial_port, |
98 | "-m", "1G", | 102 | "-m", self.mem, |
99 | "-usb", | 103 | "-usb", |
100 | "-object", "rng-random,id=rng0,filename=/dev/urandom", | 104 | "-object", "rng-random,id=rng0,filename=/dev/urandom", |
101 | "-device", "virtio-rng-pci,rng=rng0", | 105 | "-device", "virtio-rng-pci,rng=rng0", |
@@ -131,4 +135,3 @@ class QemuCommand(object): | |||
131 | "-f", "qcow2", | 135 | "-f", "qcow2", |
132 | self.overlay] | 136 | self.overlay] |
133 | return cmdline | 137 | return cmdline |
134 | |||
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(): | |||
26 | dest='kvm', action='store_true', default=None) | 26 | dest='kvm', action='store_true', default=None) |
27 | kvm_group.add_argument('--no-kvm', help='Disable KVM in QEMU', | 27 | kvm_group.add_argument('--no-kvm', help='Disable KVM in QEMU', |
28 | dest='kvm', action='store_false') | 28 | dest='kvm', action='store_false') |
29 | parser.add_argument('--mem', default=None, help="Amount of memory the machine boots with") | ||
29 | parser.add_argument('--no-gui', help='Disable GUI', action='store_true') | 30 | parser.add_argument('--no-gui', help='Disable GUI', action='store_true') |
30 | parser.add_argument('--gdb', help='Export gdbserver port 2159 from the image', action='store_true') | 31 | parser.add_argument('--gdb', help='Export gdbserver port 2159 from the image', action='store_true') |
31 | parser.add_argument('--pcap', default=None, help='Dump all network traffic') | 32 | parser.add_argument('--pcap', default=None, help='Dump all network traffic') |