[PATCH 5/5] WIP: Add test for unlinkat_s

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Simple test, needs the new rm with option -s.

Signed-off-by: Alexander Holler <holler@xxxxxxxxxxxxx>
---
 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"
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux