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: 90940 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1204214qgi; Wed, 11 Jan 2017 08:30:29 -0800 (PST) X-Received: by 10.84.193.131 with SMTP id f3mr14608646pld.26.1484152229372; Wed, 11 Jan 2017 08:30:29 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id l186si6239441pgd.244.2017.01.11.08.30.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jan 2017 08:30:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 1cRLn9-0003eA-Tu; Wed, 11 Jan 2017 16:30:27 +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-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:22a listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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+patch=linaro.org@lists.infradead.org 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