Skip to contentSkip to conversation

qemu-iotests: Fail test if explicit test case number is unknown

PATCH Applied Fam Zheng 3 participants 3 messages Sep 24, 2014 – Sep 25, 2014

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

PATCH v2 1/1 qemu-iotests: Fail test if explicit test case number is unknown

When we expand a number range, we just print "$id - unknown test, ignored", this is convenient if we want to run a range of tests.

When we designate a test case number explicitly, we shouldn't just ignore it if the case script doesn't exist.

Print an error and fail the test.

---
v2: In subject explict -> explicit.

---
 tests/qemu-iotests/common | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
tests/qemu-iotests/common +8 -2
index 70df659..2403a20 100644
@@ -382,10 +382,16 @@ BEGIN        { for (t='$start'; t<='$end'; t++) printf "%03d\n",t }' \
                     echo $id >>$tmp.list
                 else
                     # oops
-                    echo "$id - unknown test, ignored"
+                    if [ "$start" == "$end" -a "$id" == "$end" ]
+                    then
+                        echo "$id - unknown test"
+                        exit 1
+                    else
+                        echo "$id - unknown test, ignored"
+                    fi
                 fi
             fi
-        done
+        done || exit 1
     fi
 
 done
Signature · 1 line
1.9.3
Reviewed-by on v2 1/1
#1 lore raw
Quoted 8 lines · Fam Zheng

When we expand a number range, we just print "$id - unknown test, ignored", this is convenient if we want to run a range of tests.

When we designate a test case number explicitly, we shouldn't just ignore it if the case script doesn't exist.

Print an error and fail the test.

Quoted 7 lines

---
v2: In subject explict -> explicit.

---
 tests/qemu-iotests/common | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
Applied
#2 lore raw
In reply to Fam Zheng

Am 24.09.2014 um 05:05 hat Fam Zheng geschrieben:

Quoted 9 lines

When we expand a number range, we just print "$id - unknown test, ignored", this is convenient if we want to run a range of tests.

When we designate a test case number explicitly, we shouldn't just ignore it if the case script doesn't exist.

Print an error and fail the test.

Thanks, applied to the block branch.

Kevin