From patchwork Thu Jun 14 10:04:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 929316 X-Patchwork-Delegate: petr.vorel@gmail.com 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=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.cz Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 415zkk0ckwz9ryk for ; Thu, 14 Jun 2018 20:05:02 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id EA4611A9756 for ; Thu, 14 Jun 2018 12:04:58 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [IPv6:2001:4b78:1:20::3]) by picard.linux.it (Postfix) with ESMTP id 402181A961A for ; Thu, 14 Jun 2018 12:04:56 +0200 (CEST) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-3.smtp.seeweb.it (Postfix) with ESMTPS id C0D3D1A016C2 for ; Thu, 14 Jun 2018 12:04:50 +0200 (CEST) Received: from relay1.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 95A09AEE6; Thu, 14 Jun 2018 10:04:46 +0000 (UTC) From: Petr Vorel To: ltp@lists.linux.it Date: Thu, 14 Jun 2018 12:04:36 +0200 Message-Id: <20180614100436.28558-1-pvorel@suse.cz> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: clamav-milter 0.99.2 at in-3.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=-0.0 required=7.0 tests=SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-3.smtp.seeweb.it Subject: [LTP] [PATCH 1/1] tst_test.sh: Add default trap to INT 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" + remove it's definition from network stress tests already converted to the new API. Trap function can be overwritten in tests, if needed. Signed-off-by: Petr Vorel --- testcases/lib/tst_test.sh | 3 +++ testcases/network/stress/interface/if4-addr-change | 2 -- testcases/network/stress/ns-tools/tst_net_stress.sh | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh index d27b4afd6..a8585bafd 100644 --- a/testcases/lib/tst_test.sh +++ b/testcases/lib/tst_test.sh @@ -32,6 +32,9 @@ export TST_TMPDIR_RHOST=0 . tst_ansi_color.sh +# default trap function +trap "tst_brk TBROK 'test interrupted'" INT + _tst_do_exit() { local ret=0 diff --git a/testcases/network/stress/interface/if4-addr-change b/testcases/network/stress/interface/if4-addr-change index 8ed3ce3a8..5ab67751e 100644 --- a/testcases/network/stress/interface/if4-addr-change +++ b/testcases/network/stress/interface/if4-addr-change @@ -34,8 +34,6 @@ do_cleanup() tst_wait_ipv6_dad } -trap "tst_brk TBROK 'test interrupted'" INT - test_body() { local cnt=0 diff --git a/testcases/network/stress/ns-tools/tst_net_stress.sh b/testcases/network/stress/ns-tools/tst_net_stress.sh index e5c2672a3..2a9120e11 100644 --- a/testcases/network/stress/ns-tools/tst_net_stress.sh +++ b/testcases/network/stress/ns-tools/tst_net_stress.sh @@ -40,7 +40,6 @@ netstress_setup() { TST_NEEDS_ROOT=1 tst_check_cmds pgrep pkill - trap "tst_brk TBROK 'test interrupted'" INT } # Cleanup for tests using netstress.