summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2011-11-29 16:06:58 -0500
committerTheodore Ts'o <tytso@mit.edu>2011-11-29 16:48:14 -0500
commit499d5ec5582209279bb0cf86672770d77b047871 (patch)
tree656ff20cb77100560e25a6f6bf0946cf3644b2f4 /tests
parent15dd6513240b5d5e9104cdeea3c01fa2897f9511 (diff)
downloade2fsprogs-499d5ec5582209279bb0cf86672770d77b047871.tar.gz
Update Release Notes, Changelogs, version.h, etc. for 1.42 release
Also fixed depfix.sed Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/scripts/mkdup49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/scripts/mkdup b/tests/scripts/mkdup
new file mode 100755
index 00000000..c48a9f05
--- /dev/null
+++ b/tests/scripts/mkdup
@@ -0,0 +1,49 @@
+#!/bin/sh
+OPTS="-O bigalloc -C 8192"
+SIZE=4096
+IMG=/tmp/foo.img
+TMP=$(mktemp)
+SIZE_A=15000
+SIZE_B=5000
+SIZE_C=20000
+
+DEBUGFS=./debugfs/debugfs
+MKE2FS=./misc/mke2fs
+FSCK=./e2fsck/e2fsck
+
+dd if=/dev/zero of=$IMG bs=1k count=$SIZE
+echo $MKE2FS -F -t ext4 -L test $OPTS test.img $SIZE
+$MKE2FS -F -t ext4 -L test $OPTS $IMG $SIZE
+dd if=/dev/zero of=$TMP bs=$SIZE_A count=1 >& /dev/null
+echo Writing $SIZE_A bytes to a
+$DEBUGFS -w -R "write $TMP a" $IMG
+BLKS=$(./debugfs/debugfs -R "blocks a" $IMG)
+cp /dev/null $TMP
+echo "Releasing blocks $BLKS"
+for i in $BLKS ; do echo "freeb $i" >> $TMP; done
+$DEBUGFS -w $IMG < $TMP >& /dev/null
+
+echo Writing $SIZE_B bytes to b
+dd if=/dev/zero of=$TMP bs=$SIZE_B count=1 >& /dev/null
+$DEBUGFS -w -R "write $TMP b" $IMG
+if [ -n "$SIZE_C" ]; then
+ BLKS=$(./debugfs/debugfs -R "blocks b" $IMG)
+ cp /dev/null $TMP
+ echo "Releasing blocks $BLKS"
+ for i in $BLKS ; do echo "freeb $i" >> $TMP; done
+ $DEBUGFS -w $IMG < $TMP >& /dev/null
+
+ echo Writing $SIZE_C bytes to c
+ dd if=/dev/zero of=$TMP bs=$SIZE_C count=1 >& /dev/null
+ $DEBUGFS -w -R "write $TMP c" $IMG
+fi
+echo "set_inode_field a mtime 201107040000" > $TMP
+echo "set_inode_field b mtime 201107050000" >> $TMP
+if [ -n "$SIZE_C" ]; then
+ echo "set_inode_field c mtime 201107060000" >> $TMP
+fi
+$DEBUGFS -w $IMG < $TMP >& /dev/null
+
+$FSCK -fy $IMG
+rm $TMP
+