"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/fatrace-btrfs" between
fatrace-0.16.3.tar.gz and fatrace-0.17.0.tar.gz

About: fatrace (“file access trace”) reports file access events from all running processes.

fatrace-btrfs  (fatrace-0.16.3):fatrace-btrfs  (fatrace-0.17.0)
skipping to change at line 19 skipping to change at line 19
LOG="$AUTOPKGTEST_TMP/fatrace.log" LOG="$AUTOPKGTEST_TMP/fatrace.log"
IMAGE="$AUTOPKGTEST_TMP/btrfs.img" IMAGE="$AUTOPKGTEST_TMP/btrfs.img"
MOUNT="$AUTOPKGTEST_TMP/mount" MOUNT="$AUTOPKGTEST_TMP/mount"
dd if=/dev/zero of="$IMAGE" bs=1M count=200 dd if=/dev/zero of="$IMAGE" bs=1M count=200
mkfs.btrfs --quiet "$IMAGE" mkfs.btrfs --quiet "$IMAGE"
mkdir -p "$MOUNT" mkdir -p "$MOUNT"
mount -o loop "$IMAGE" "$MOUNT" mount -o loop "$IMAGE" "$MOUNT"
trap "umount -l '$MOUNT'" EXIT INT QUIT PIPE trap "umount -l '$MOUNT'" EXIT INT QUIT PIPE
btrfs subvolume create "$MOUNT/subv1"
cd "$MOUNT" cd "$MOUNT"
echo "hello" > world.txt echo "hello" > world.txt
echo "starting fatrace..." echo "starting fatrace..."
fatrace --current-mount -s 2 -o $LOG & fatrace --current-mount -s 2 -o $LOG &
sleep 1 sleep 1
echo "read a file..." echo "read a file..."
head world.txt > /dev/null head world.txt > /dev/null
skipping to change at line 46 skipping to change at line 48
rm "$TEST_FILE" rm "$TEST_FILE"
echo "moving a file within the same directory" echo "moving a file within the same directory"
touch "$TEST_FILE" touch "$TEST_FILE"
mv "$TEST_FILE" "${TEST_FILE}.2" mv "$TEST_FILE" "${TEST_FILE}.2"
mkdir dest mkdir dest
mv "${TEST_FILE}.2" dest/"${TEST_FILE}.2" mv "${TEST_FILE}.2" dest/"${TEST_FILE}.2"
rm dest/"${TEST_FILE}.2" rm dest/"${TEST_FILE}.2"
rmdir dest rmdir dest
echo "create a file on a subvolume"
touch subv1/sub.txt
SUBVOL_FILE=$(realpath subv1/sub.txt)
echo "waiting for fatrace..." echo "waiting for fatrace..."
wait wait
echo "checking log..." echo "checking log..."
RC=0 RC=0
check_log() { check_log() {
if ! grep -q "$1" $LOG; then if ! grep -q "$1" $LOG; then
echo "$1 not found in log" >&2 echo "$1 not found in log" >&2
((RC=RC+1)) ((RC=RC+1))
fi fi
} }
# accessing the world.txt file # accessing the world.txt file
check_log "RC\?O\? $(pwd)/world.txt$" check_log "RC\?O\? \+$(pwd)/world.txt$"
# file creation # file creation
TEST_FILE=$(realpath "$TEST_FILE") TEST_FILE=$(realpath "$TEST_FILE")
check_log "^touch.* C\?W\?O $TEST_FILE" check_log "^touch.* C\?W\?O \+$TEST_FILE"
check_log "^touch.* C\?WO\? $TEST_FILE" check_log "^touch.* C\?WO\? \+$TEST_FILE"
check_log "^bash(.* C\?WO\? $TEST_FILE" check_log "^bash(.* C\?WO\? \+$TEST_FILE"
# file deletion # file deletion
check_log "^rm(.*): D $(dirname $TEST_FILE)$" check_log "^rm(.*): D $(dirname $TEST_FILE)$"
# dir creation # dir creation
check_log "^touch(.*): + $(dirname $TEST_FILE)$" check_log "^touch(.*): + $(dirname $TEST_FILE)$"
check_log "^mkdir(.*): + $(dirname $TEST_FILE)$" check_log "^mkdir(.*): + $(dirname $TEST_FILE)$"
# file renaming; usually one event, but can be two # file renaming; usually one event, but can be two
check_log "^mv(.*): <>\? $(dirname $TEST_FILE)" check_log "^mv(.*): <>\? \+$(dirname $TEST_FILE)"
check_log "^mv(.*): <\?> $(dirname $TEST_FILE)" check_log "^mv(.*): <\?> \+$(dirname $TEST_FILE)"
# file moving # file moving
check_log "^mv(.*): < $(dirname $TEST_FILE)$" check_log "^mv(.*): < $(dirname $TEST_FILE)$"
check_log "^mv(.*): > $(dirname $TEST_FILE)/dest$" check_log "^mv(.*): > $(dirname $TEST_FILE)/dest$"
# subvolume
check_log "^touch.* C\?W\?O \+$SUBVOL_FILE"
if [ $RC -ne 0 ]; then if [ $RC -ne 0 ]; then
echo "$RC checks failed -- log:" >&2 echo "$RC checks failed -- log:" >&2
echo "===================" >&2 echo "===================" >&2
cat $LOG >&2 cat $LOG >&2
echo "===================" >&2 echo "===================" >&2
fi fi
exit $RC exit $RC
 End of changes. 8 change blocks. 
11 lines changed or deleted 20 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)