Received: from eggs.gnu.org ([2001:4830:134:3::10]:40315) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWFoR-0005Zc-Ek for qemu-devel@nongnu.org; Mon, 22 Sep 2014 22:26:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWFoL-0006qd-Bh for qemu-devel@nongnu.org; Mon, 22 Sep 2014 22:26:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32801) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWFoL-0006pB-4z for qemu-devel@nongnu.org; Mon, 22 Sep 2014 22:26:37 -0400 From: Fam Zheng Date: Tue, 23 Sep 2014 10:26:26 +0800 Message-Id: <1411439186-20582-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH] qemu-iotests: Fail test if explict test case number is unknown List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Wenchao Xia , Stefan Hajnoczi , Max Reitz 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. Signed-off-by: Fam Zheng --- tests/qemu-iotests/common | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common index 70df659..2403a20 100644 --- a/tests/qemu-iotests/common +++ b/tests/qemu-iotests/common @@ -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 -- 1.9.3