ktest: Fix ELSE IF statements
authorSteven Rostedt <srostedt@redhat.com>
Wed, 26 Sep 2012 18:48:17 +0000 (14:48 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Wed, 26 Sep 2012 18:48:17 +0000 (14:48 -0400)
The ELSE IF statements do not work as expected if another ELSE statement
follows. This is because the $if_set is not set. If the ELSE IF
condition is true, the following ELSE should be ignored. But because the
$if_set is not set, the following ELSE will also be executed.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
tools/testing/ktest/ktest.pl

index 52b7959cd513dc358e57376528abcf41b36f4f6d..c05bcd293d8c636798b21207027c925a335d7cea 100755 (executable)
@@ -840,7 +840,9 @@ sub __read_config {
 
                if ($rest =~ /\sIF\s+(.*)/) {
                    # May be a ELSE IF section.
-                   if (!process_if($name, $1)) {
+                   if (process_if($name, $1)) {
+                       $if_set = 1;
+                   } else {
                        $skip = 1;
                    }
                    $rest = "";