From patchwork Mon Feb 2 17:05:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Holler X-Patchwork-Id: 5763211 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5C888BF440 for ; Mon, 2 Feb 2015 17:06:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7EFFC2077D for ; Mon, 2 Feb 2015 17:06:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A3B8C2077C for ; Mon, 2 Feb 2015 17:06:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753848AbbBBRFm (ORCPT ); Mon, 2 Feb 2015 12:05:42 -0500 Received: from h1446028.stratoserver.net ([85.214.92.142]:59998 "EHLO mail.ahsoftware.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752537AbbBBRFg (ORCPT ); Mon, 2 Feb 2015 12:05:36 -0500 Received: by mail.ahsoftware.de (Postfix, from userid 65534) id 0A4852C9C461; Mon, 2 Feb 2015 18:05:33 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from wandq.ahsoftware (p4FC36183.dip0.t-ipconnect.de [79.195.97.131]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.ahsoftware.de (Postfix) with ESMTPSA id 4C7F82C9C3F0; Mon, 2 Feb 2015 18:05:33 +0100 (CET) Received: by wandq.ahsoftware (Postfix, from userid 65534) id 8CEDF1E8288; Mon, 2 Feb 2015 18:05:32 +0100 (CET) Received: from krabat.ahsoftware (unknown [192.168.207.2]) by wandq.ahsoftware (Postfix) with ESMTP id 004E61E8272; Mon, 2 Feb 2015 17:05:19 +0000 (UTC) From: Alexander Holler To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Alexander Holler Subject: [PATCH 5/5] WIP: Add test for unlinkat_s Date: Mon, 2 Feb 2015 18:05:13 +0100 Message-Id: <1422896713-25367-6-git-send-email-holler@ahsoftware.de> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1422896713-25367-1-git-send-email-holler@ahsoftware.de> References: <1422896713-25367-1-git-send-email-holler@ahsoftware.de> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Simple test, needs the new rm with option -s. Signed-off-by: Alexander Holler --- test_unlinkat_s.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 test_unlinkat_s.sh diff --git a/test_unlinkat_s.sh b/test_unlinkat_s.sh new file mode 100755 index 0000000..f6ba6ac --- /dev/null +++ b/test_unlinkat_s.sh @@ -0,0 +1,27 @@ +#!/bin/sh -e + +MOUNTDIR="$(mktemp -d --tmpdir unlinkat_s_mnt.XXXXXXXXXX)" +TESTIMG="$(mktemp --tmpdir unlinkat_s_img.XXXXXXXXXX)" + +dd if=/dev/zero of=$TESTIMG bs=1M count=10 +mkfs.ext4 $TESTIMG +grep -v -a abrakadabra $TESTIMG >/dev/null +mount -o loop $TESTIMG $MOUNTDIR +echo abrakadabra >$MOUNTDIR/foo.txt +umount $MOUNTDIR +grep -a abrakadabra $TESTIMG >/dev/null +mount -o loop $TESTIMG $MOUNTDIR +rm -s $MOUNTDIR/foo.txt +umount $MOUNTDIR +grep -v -a abrakadabra $TESTIMG >/dev/null +mount -o loop $TESTIMG $MOUNTDIR +echo abrakadabra >$MOUNTDIR/foo.txt +umount $MOUNTDIR +grep -a abrakadabra $TESTIMG >/dev/null +mount -o loop $TESTIMG $MOUNTDIR +rm $MOUNTDIR/foo.txt +umount $MOUNTDIR +grep -a abrakadabra $TESTIMG >/dev/null +rm $TESTIMG +rmdir $MOUNTDIR +echo "unlinkat_s() worked and unlink() didn't"