From patchwork Thu Jun 13 16:14:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1115271 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 ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45PpjX3hhmz9sNp for ; Fri, 14 Jun 2019 02:14:56 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id C4DBA294AE8 for ; Thu, 13 Jun 2019 18:14:53 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [IPv6:2001:4b78:1:20::4]) by picard.linux.it (Postfix) with ESMTP id C4A52294AA9 for ; Thu, 13 Jun 2019 18:14:47 +0200 (CEST) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id 606B11000C68 for ; Thu, 13 Jun 2019 18:14:43 +0200 (CEST) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id DF376AD8D; Thu, 13 Jun 2019 16:14:46 +0000 (UTC) From: Petr Vorel To: ltp@lists.linux.it Date: Thu, 13 Jun 2019 18:14:11 +0200 Message-Id: <20190613161414.29161-2-pvorel@suse.cz> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190613161414.29161-1-pvorel@suse.cz> References: <20190613161414.29161-1-pvorel@suse.cz> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-4.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.0 required=7.0 tests=SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-4.smtp.seeweb.it Cc: linux-integrity@vger.kernel.org, Mimi Zohar , Mimi Zohar , Ignaz Forster Subject: [LTP] [PATCH v4 1/4] ima: Call test's cleanup inside ima_setup.sh cleanup 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: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" to work the same way as setup Acked-by: Mimi Zohar Signed-off-by: Petr Vorel --- testcases/kernel/security/integrity/ima/tests/ima_setup.sh | 6 +++++- .../kernel/security/integrity/ima/tests/ima_violations.sh | 2 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/testcases/kernel/security/integrity/ima/tests/ima_setup.sh b/testcases/kernel/security/integrity/ima/tests/ima_setup.sh index 52551190a..cbded42c2 100644 --- a/testcases/kernel/security/integrity/ima/tests/ima_setup.sh +++ b/testcases/kernel/security/integrity/ima/tests/ima_setup.sh @@ -20,7 +20,8 @@ TST_TESTFUNC="test" TST_SETUP_CALLER="$TST_SETUP" TST_SETUP="ima_setup" -TST_CLEANUP="${TST_CLEANUP:-ima_cleanup}" +TST_CLEANUP_CALLER="$TST_CLEANUP" +TST_CLEANUP="ima_cleanup" TST_NEEDS_TMPDIR=1 TST_NEEDS_ROOT=1 @@ -95,6 +96,9 @@ ima_setup() ima_cleanup() { local dir + + [ -n "$TST_CLEANUP_CALLER" ] && $TST_CLEANUP_CALLER + for dir in $UMOUNT; do umount $dir done diff --git a/testcases/kernel/security/integrity/ima/tests/ima_violations.sh b/testcases/kernel/security/integrity/ima/tests/ima_violations.sh index 74223c221..a44bd1230 100755 --- a/testcases/kernel/security/integrity/ima/tests/ima_violations.sh +++ b/testcases/kernel/security/integrity/ima/tests/ima_violations.sh @@ -51,8 +51,6 @@ cleanup() { [ "$PRINTK_RATE_LIMIT" != "0" ] && \ sysctl -wq kernel.printk_ratelimit=$PRINTK_RATE_LIMIT - - ima_cleanup } open_file_read()