From patchwork Wed Jan 11 16:28:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 9510595 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AA280606E1 for ; Wed, 11 Jan 2017 16:29:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9149A28478 for ; Wed, 11 Jan 2017 16:29:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 861EB28498; Wed, 11 Jan 2017 16:29:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_SORBS_SPAM,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 429F72858D for ; Wed, 11 Jan 2017 16:29:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030662AbdAKQ3A (ORCPT ); Wed, 11 Jan 2017 11:29:00 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:34992 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1765707AbdAKQ25 (ORCPT ); Wed, 11 Jan 2017 11:28:57 -0500 Received: by mail-wm0-f42.google.com with SMTP id r126so16750374wmr.0 for ; Wed, 11 Jan 2017 08:28:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GQXs0c0LusLeZX0FqfcpPZNzuOj5IviSFYGNUbVrjug=; b=LmKVdAX1+xXZIGuLRj958oSDeD0rWtcdDzRxNLRriEoFFN0UdRStSOdz19EmknkMYQ jHD0GV4WYp5oq362J1QBi/Ejc35gyezma//zjJkWDiCTne5CjVQFxBuK+tXwMgAoL3Ex 6oXVAiifIzRCZjFsva1Q6hONRxED86XaX6LDs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GQXs0c0LusLeZX0FqfcpPZNzuOj5IviSFYGNUbVrjug=; b=BVk/SPKUVynb1qNlP6R5FDzsGInKUjqz5hvTO4Slea0/Fi8OwhaVh8D16n2eR8JHsw wQSgBd7zQSyJyBWyekrbsXzxLyZ0CUuKF7h3hO3HkV8Q4AOzzpJGT1vfc3j8KF+SXeov SUgyZ4j+prQtAoCNu33pTLFoMcPgeJYfU11d9cuMDOX16Dxb74RRb8GJ7QWoF5AS03M4 HdzEZLkot51oIXC7dEsRkhTku5F2pGvKYtY2wbGtqfdKf5kL9ca3kjX2Sw68tx7QvIo6 B1Ks/Jdoe7asplTQ4LF5XFP2TFB3EpDqDBl9/J83I74sxQ/A9mLwoqh92fnghhP13wD1 lsRg== X-Gm-Message-State: AIkVDXKyIlAScecmHthAQLUijtjD9oMRH+WiLdKvWjM3HKI16OS4MNicNZGsckK9MoT4XpVS X-Received: by 10.28.185.203 with SMTP id j194mr5638021wmf.73.1484152135468; Wed, 11 Jan 2017 08:28:55 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id s20sm30648086wmb.9.2017.01.11.08.28.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jan 2017 08:28:52 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id E72D43E09DE; Wed, 11 Jan 2017 16:28:48 +0000 (GMT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: drjones@redhat.com, pbonzini@redhat.com Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org, marc.zyngier@arm.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [kvm-unit-tests PATCH 6/6] run_tests: allow passing of options to QEMU Date: Wed, 11 Jan 2017 16:28:41 +0000 Message-Id: <20170111162841.15569-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170111162841.15569-1-alex.bennee@linaro.org> References: <20170111162841.15569-1-alex.bennee@linaro.org> MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This allows additional options to be passed to QEMU. It follows the convention of passing parameters after a -- to the child process. In my case I'm using it to toggle MTTCG on an off: ./run_tests.sh -- --accel tcg,thread=multi Signed-off-by: Alex Bennée --- v1 - changes from -o to -- - fixed whitespace damage --- README.md | 6 ++++++ run_tests.sh | 13 +++++++++++-- scripts/functions.bash | 7 ++++--- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index fa3a445..1bd6dcb 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,12 @@ To extend or disable the timeouts: TIMEOUT=0 ./run_tests.sh +Any arguments past the end-of-arguments marker (--) is passed on down +to the QEMU invocation. This can of course be combined with the other +modifiers: + + ACCEL=tcg ./run_tests.sh -v -- --accel tcg,thread=multi + # Contributing ## Directory structure diff --git a/run_tests.sh b/run_tests.sh index 254129d..3270fba 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -13,7 +13,7 @@ function usage() { cat <> test.log; } RUNTIME_log_stdout () { if [ "$PRETTY_PRINT_STACKS" = "yes" ]; then @@ -59,4 +68,4 @@ RUNTIME_log_stdout () { config=$TEST_DIR/unittests.cfg rm -f test.log printf "BUILD_HEAD=$(cat build-head)\n\n" > test.log -for_each_unittest $config run +for_each_unittest $config run "$extra_opts" diff --git a/scripts/functions.bash b/scripts/functions.bash index ee9143c..60fbc6a 100644 --- a/scripts/functions.bash +++ b/scripts/functions.bash @@ -3,10 +3,11 @@ function for_each_unittest() { local unittests="$1" local cmd="$2" + local extra_opts=$3 local testname local smp local kernel - local opts + local opts=$extra_opts local groups local arch local check @@ -21,7 +22,7 @@ function for_each_unittest() testname=${BASH_REMATCH[1]} smp=1 kernel="" - opts="" + opts=$extra_opts groups="" arch="" check="" @@ -32,7 +33,7 @@ function for_each_unittest() elif [[ $line =~ ^smp\ *=\ *(.*)$ ]]; then smp=${BASH_REMATCH[1]} elif [[ $line =~ ^extra_params\ *=\ *(.*)$ ]]; then - opts=${BASH_REMATCH[1]} + opts="$opts ${BASH_REMATCH[1]}" elif [[ $line =~ ^groups\ *=\ *(.*)$ ]]; then groups=${BASH_REMATCH[1]} elif [[ $line =~ ^arch\ *=\ *(.*)$ ]]; then