From patchwork Tue Nov 20 16:03:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kodanev X-Patchwork-Id: 1000560 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="38FD5yKn"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42zqx42JzBz9s1c for ; Wed, 21 Nov 2018 02:53:12 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 960363E7190 for ; Tue, 20 Nov 2018 16:53:07 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [IPv6:2001:4b78:1:20::2]) by picard.linux.it (Postfix) with ESMTP id 506D53E7164 for ; Tue, 20 Nov 2018 16:53:06 +0100 (CET) Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-2.smtp.seeweb.it (Postfix) with ESMTPS id 711966008DC for ; Tue, 20 Nov 2018 16:53:05 +0100 (CET) Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wAKFn3AT024647; Tue, 20 Nov 2018 15:53:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2018-07-02; bh=XEbQfmFIxzlqvddJjUIYDszRqzzkT62DVne0KP/qH/U=; b=38FD5yKnRuyny7X89rAFYpAh7P65oyd8HmMsMPfW/bw6gX/hg5eRVW2JRV4Ci3yl8Jbq 4YqinQax4p1jLHqPQBGoJwMN4n8uqJg+0+krgI/DpmPybR34fokGyqkFoGBRuVFRWS9f Y4PZWlOu6YQ9YWo3ypswFC9lVi9anihOGlUepC0wWMjT5XMZkm0AnS4ZUOLjom3NIeTj MhZoNppKALb1mSlMs41NJWjd+JO1oZgXpK9Q85eoBgnO7NJdKAuWlGBEiXa+rl/Yqx9a wDBILs1YscTbq5ifYewe2/Pp8cNVte3WFvfShgdRwPscDul3bV4KSnqysep52qdIqKHd qg== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2120.oracle.com with ESMTP id 2ntaxq4qq0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 20 Nov 2018 15:53:02 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id wAKFr2wd015841 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 20 Nov 2018 15:53:02 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wAKFr2jD006589; Tue, 20 Nov 2018 15:53:02 GMT Received: from ak.ru.oracle.com (/10.162.80.29) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 20 Nov 2018 07:53:02 -0800 From: Alexey Kodanev To: ltp@lists.linux.it Date: Tue, 20 Nov 2018 19:03:06 +0300 Message-Id: <1542729786-4097-1-git-send-email-alexey.kodanev@oracle.com> X-Mailer: git-send-email 1.7.1 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9082 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=642 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811200140 X-Virus-Scanned: clamav-milter 0.99.2 at in-2.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-2.smtp.seeweb.it Subject: [LTP] [PATCH] lib/tst_test.sh: don't call _tst_do_exit() recursively with tst_brk() X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" With this patch, "safe" functions such as "ROD" and "tst_rhost_run -s" can be used in a test cleanup function, i.e. in case of an error, "safe" command won't recursively call the cleanup function again but will only print the warning message about the failure. This behavior is consistent with the LTP C library. Signed-off-by: Alexey Kodanev Reviewed-by: Petr Vorel --- testcases/lib/tst_test.sh | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh index 16081fa..e84cf7f 100644 --- a/testcases/lib/tst_test.sh +++ b/testcases/lib/tst_test.sh @@ -41,6 +41,7 @@ trap "tst_brk TBROK 'test interrupted'" INT _tst_do_exit() { local ret=0 + TST_DO_EXIT=1 if [ -n "$TST_SETUP_STARTED" -a -n "$TST_CLEANUP" -a \ -z "$TST_NO_CLEANUP" ]; then @@ -123,6 +124,11 @@ tst_brk() local res=$1 shift + if [ "$TST_DO_EXIT" = 1 ]; then + tst_res TWARN "$@" + return + fi + tst_res "$res" "$@" _tst_do_exit }