From ce675383b3a95a067f6dd980c12433ffb8bfb586 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Tue, 20 Dec 2016 15:33:16 -0500 Subject: [PATCH] qa/tasks/qemu: allow tests to customize the number of CPUs Signed-off-by: Jason Dillaman --- qa/tasks/qemu.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qa/tasks/qemu.py b/qa/tasks/qemu.py index b9fd4e7cc291c..aac51d5f54027 100644 --- a/qa/tasks/qemu.py +++ b/qa/tasks/qemu.py @@ -19,6 +19,7 @@ log = logging.getLogger(__name__) DEFAULT_NUM_DISKS = 2 DEFAULT_IMAGE_URL = 'http://download.ceph.com/qa/ubuntu-12.04.qcow2' DEFAULT_IMAGE_SIZE = 10240 # in megabytes +DEFAULT_CPUS = 1 DEFAULT_MEM = 4096 # in megabytes def create_images(ctx, config, managers): @@ -371,7 +372,8 @@ def run_qemu(ctx, config): '{tdir}/archive/coverage'.format(tdir=testdir), 'daemon-helper', 'term', - qemu_cmd, '-enable-kvm', '-nographic', + qemu_cmd, '-enable-kvm', '-nographic', '-cpu', 'host', + '-smp', str(client_config.get('cpus', DEFAULT_CPUS)), '-m', str(client_config.get('memory', DEFAULT_MEM)), # cd holding metadata for cloud-init '-cdrom', '{tdir}/qemu/{client}.iso'.format(tdir=testdir, client=client), @@ -495,13 +497,15 @@ def task(ctx, config): - image_size: 1024 - image_size: 2048 - You can set the amount of memory the VM has (default is 1024 MB):: + You can set the amount of CPUs and memory the VM has (default is 1 CPU and + 4096 MB):: tasks: - ceph: - qemu: client.0: test: http://download.ceph.com/qa/test.sh + cpus: 4 memory: 512 # megabytes If you want to run a test against a cloned rbd image, set clone to true:: -- 2.39.5