mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Rabin Vincent <rabin@rab.in>
Subject: [PATCH 01/20] ktest: Check parent options for iterated tests
Date: Wed, 04 Jan 2012 22:47:56 -0500	[thread overview]
Message-ID: <20120105034820.992955417@goodmis.org> (raw)
In-Reply-To: <20120105034755.793909214@goodmis.org>

[-- Attachment #1: Type: text/plain, Size: 1819 bytes --]

From: Rabin Vincent <rabin@rab.in>

Let's say we have "OUTPUT_DIR = build/${TEST_NAME}", and we're iterating
a test.  In the second iteration of a test, the TEST_NAME of the test
we're repeating is not used.  Instead, ${TEST_NAME} appears literally:

   touch /home/rabin/kernel/test/build/${TEST_NAME}/.config ... SUCCESS

Fix this by making __eval_option() check the parent test options
for a repeated test.

Link: http://lkml.kernel.org/r/1321616131-21352-2-git-send-email-rabin@rab.in

Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 tools/testing/ktest/ktest.pl |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 30e2bef..8b4c253 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -747,6 +747,18 @@ sub __eval_option {
     # Add space to evaluate the character before $
     $option = " $option";
     my $retval = "";
+    my $repeated = 0;
+    my $parent = 0;
+
+    foreach my $test (keys %repeat_tests) {
+	if ($i >= $test &&
+	    $i < $test + $repeat_tests{$test}) {
+
+	    $repeated = 1;
+	    $parent = $test;
+	    last;
+	}
+    }
 
     while ($option =~ /(.*?[^\\])\$\{(.*?)\}(.*)/) {
 	my $start = $1;
@@ -760,10 +772,14 @@ sub __eval_option {
 	# otherwise see if the default OPT (without [$i]) exists.
 
 	my $o = "$var\[$i\]";
+	my $parento = "$var\[$parent\]";
 
 	if (defined($opt{$o})) {
 	    $o = $opt{$o};
 	    $retval = "$retval$o";
+	} elsif ($repeated && defined($opt{$parento})) {
+	    $o = $opt{$parento};
+	    $retval = "$retval$o";
 	} elsif (defined($opt{$var})) {
 	    $o = $opt{$var};
 	    $retval = "$retval$o";
-- 
1.7.7.3



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-01-05  3:52 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-05  3:47 [PATCH 00/20] ktest: new and fancy updates Steven Rostedt
2012-01-05  3:47 ` Steven Rostedt [this message]
2012-01-05  3:47 ` [PATCH 02/20] ktest: Save test output Steven Rostedt
2012-01-05  3:47 ` [PATCH 03/20] ktest: Allow success logs to be stored Steven Rostedt
2012-01-05  3:47 ` [PATCH 04/20] ktest: Add default for ssh-user, build-target and target-image Steven Rostedt
2012-01-05  3:48 ` [PATCH 05/20] ktest: When creating new config, allow the use of ${THIS_DIR} Steven Rostedt
2012-01-05  3:48 ` [PATCH 06/20] ktest: Allow bisect test to restart where it left off Steven Rostedt
2012-01-05  3:48 ` [PATCH 07/20] ktest: Ask for type of test when creating a new config Steven Rostedt
2012-01-05  3:48 ` [PATCH 08/20] ktest: Do not ask for some options if the only test is build Steven Rostedt
2012-01-05  3:48 ` [PATCH 09/20] ktest: When creating a new config, ask for BUILD_OPTIONS Steven Rostedt
2012-01-05  3:48 ` [PATCH 10/20] ktest: Only ask options needed for install Steven Rostedt
2012-01-05  3:48 ` [PATCH 11/20] ktest: Evaluate $KERNEL_VERSION in both install and post install Steven Rostedt
2012-01-05  3:48 ` [PATCH 12/20] ktest: Evaluate options before processing them Steven Rostedt
2012-01-05  3:48 ` [PATCH 13/20] ktest: Allow overriding bisect test results Steven Rostedt
2012-01-05  3:48 ` [PATCH 14/20] ktest: Add options SWITCH_TO_GOOD and SWITCH_TO_TEST Steven Rostedt
2012-01-05  3:48 ` [PATCH 15/20] ktest: Change initialization of defaults hash to perl format Steven Rostedt
2012-01-05  3:48 ` [PATCH 16/20] ktest: Have all values be set by defaults Steven Rostedt
2012-01-05  3:48 ` [PATCH 17/20] ktest: Detect typos in option names Steven Rostedt
2012-01-05  3:48 ` [PATCH 18/20] ktest: Fix compare script to test if options are not documented Steven Rostedt
2012-01-05  3:48 ` [PATCH 19/20] ktest: Still do reboot even for REBOOT_TYPE = script Steven Rostedt
2012-01-05  3:48 ` [PATCH 20/20] ktest: Add INGORE_ERRORS to ignore warnings in boot up Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120105034820.992955417@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rabin@rab.in \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome