From patchwork Sat Jun 9 10:41:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sun Lianwen X-Patchwork-Id: 927121 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=cn.fujitsu.com 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 412wnB4PnJz9ry1 for ; Sat, 9 Jun 2018 20:41:31 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id A05291A9D3E for ; Sat, 9 Jun 2018 12:41:24 +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 [217.194.8.3]) by picard.linux.it (Postfix) with ESMTP id 6501F1A9D1E for ; Sat, 9 Jun 2018 12:41:23 +0200 (CEST) Received: from heian.cn.fujitsu.com (unknown [183.91.158.132]) by in-3.smtp.seeweb.it (Postfix) with ESMTP id C471E1A01192 for ; Sat, 9 Jun 2018 12:40:53 +0200 (CEST) X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="40901352" Received: from bogon (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 09 Jun 2018 18:40:37 +0800 Received: from G08CNEXCHPEKD03.g08.fujitsu.local (unknown [10.167.33.85]) by cn.fujitsu.com (Postfix) with ESMTP id BBD9F4818464; Sat, 9 Jun 2018 18:40:33 +0800 (CST) Received: from slw.lan (10.167.226.95) by G08CNEXCHPEKD03.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.399.0; Sat, 9 Jun 2018 18:40:35 +0800 From: Sun Lianwen To: Date: Sat, 9 Jun 2018 18:41:38 +0800 Message-ID: <20180609104138.8375-1-sunlw.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.17.0 MIME-Version: 1.0 X-Originating-IP: [10.167.226.95] X-yoursite-MailScanner-ID: BBD9F4818464.AB189 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: sunlw.fnst@cn.fujitsu.com X-Spam-Status: No, score=1.3 required=7.0 tests=RDNS_NONE autolearn=disabled version=3.4.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-3.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-3.smtp.seeweb.it Cc: ltp@lists.linux.it Subject: [LTP] [PATCH] macsec: fix double delete the tmp file 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" The virt_cleanup and tst_ipsec_cleanup in both in the cleanup() which will double delete the tmp file. and result to report below info: "rm: cannot remove ‘/tmp/ltp-ddLUcf8ACl/macsec01.6YQ9qGRNuC’: No such file or directory" Signed-off-by: Sun Lianwen --- testcases/network/virt/macsec01.sh | 10 +++++++++- testcases/network/virt/macsec02.sh | 12 ++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/testcases/network/virt/macsec01.sh b/testcases/network/virt/macsec01.sh index 52d6f071a..1a3499648 100755 --- a/testcases/network/virt/macsec01.sh +++ b/testcases/network/virt/macsec01.sh @@ -31,7 +31,15 @@ VIRT_PERF_THRESHOLD=${VIRT_PERF_THRESHOLD:-100} cleanup() { virt_cleanup - tst_ipsec_cleanup + + ip xfrm state flush + ip xfrm policy flush + tst_rhost_run -c "ip xfrm state flush && ip xfrm policy flush" + + if [ -n "$cleanup_vti" ]; then + ip li del $cleanup_vti 2>/dev/null + tst_rhost_run -c "ip li del $cleanup_vti 2>/dev/null" + fi } TST_CLEANUP="cleanup" diff --git a/testcases/network/virt/macsec02.sh b/testcases/network/virt/macsec02.sh index 617860d41..6276a6b09 100755 --- a/testcases/network/virt/macsec02.sh +++ b/testcases/network/virt/macsec02.sh @@ -30,8 +30,16 @@ VIRT_PERF_THRESHOLD=${VIRT_PERF_THRESHOLD:-100} cleanup() { - virt_cleanup - tst_ipsec_cleanup + virt_cleanup + + ip xfrm state flush + ip xfrm policy flush + tst_rhost_run -c "ip xfrm state flush && ip xfrm policy flush" + + if [ -n "$cleanup_vti" ]; then + ip li del $cleanup_vti 2>/dev/null + tst_rhost_run -c "ip li del $cleanup_vti 2>/dev/null" + fi } TST_CLEANUP="cleanup"