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: 9510613 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 0B4D3606E1 for ; Wed, 11 Jan 2017 16:30:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF3AD204C1 for ; Wed, 11 Jan 2017 16:30:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D3B1B28478; Wed, 11 Jan 2017 16:30:35 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2A7C6204C1 for ; Wed, 11 Jan 2017 16:30:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cRLn8-0003eA-9T; Wed, 11 Jan 2017 16:30:26 +0000 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cRLm1-00008N-FW for linux-arm-kernel@lists.infradead.org; Wed, 11 Jan 2017 16:29:21 +0000 Received: by mail-wm0-x22a.google.com with SMTP id r144so33821008wme.1 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=G+5s5g3S9LA0tS99oyPljRl1mf9IArvFA9eGjTyaBZZdjZxTfkKvZGuRRx5Dzb1BOU nsVwotmtdfX+LE3cgPujuwsWGdGCdCTojKS2m2zCO5zMHNldN56T3thS4EgqrBaSjPLr OQV2cAW+P9lHS2/ECIwCBrBOZCTujvprKd4oKaX1dr2SQ5AUfg2W1eGBfzj7bWU16YqQ nWxdFeyws7Qu5FDpNIm2wpwMtPuzyJ+HCEJOdgx1diJ/6kYQQxQvpQlQD653bkNIOFUL oHzxYi+rGCU9CeG84OTS29yx3yH+pwRXfh4hs/HZo94rAdu9exn/CFbJ6SDrT5cM5ibL IlXg== X-Gm-Message-State: AIkVDXI1s6tbPUk+f6/kA5z7M3/yxc/yZC9cPODpiuewpc2AGmXT29jzJEpP2grrRp87fUEu 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170111_082917_784787_54382C44 X-CRM114-Status: GOOD ( 13.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm@vger.kernel.org, marc.zyngier@arm.com, linux-arm-kernel@lists.infradead.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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