-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6819d1
commit 76563b9
Showing
2 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/sh | ||
set -euC | ||
|
||
mkdir -m 777 tmp | ||
trap "rm -rf tmp" EXIT INT QUIT PIPE | ||
|
||
LOG="$AUTOPKGTEST_TMP/fatrace.log" | ||
echo "starting fatrace..." | ||
fatrace --current-mount --command touch -s 2 -o $LOG & | ||
sleep 1 | ||
|
||
echo "create files with different programs" | ||
touch tmp/includeme | ||
dd if=/dev/zero of=tmp/notme bs=1 count=1 | ||
|
||
echo "waiting for fatrace..." | ||
wait | ||
|
||
echo "checking log..." | ||
RC=0 | ||
check_log() { | ||
if ! grep -q "$1" $LOG; then | ||
echo "$1 not found in log" >&2 | ||
((RC=RC+1)) | ||
fi | ||
} | ||
|
||
check_log "^touch([0-9]*).*includeme$" | ||
|
||
if grep -Eq "notme|^dd" $LOG; then | ||
echo "notme found in log" >&2 | ||
((RC=RC+1)) | ||
fi | ||
|
||
if [ $RC -ne 0 ]; then | ||
echo "$RC checks failed -- log:" >&2 | ||
echo "===================" >&2 | ||
cat $LOG >&2 | ||
echo "===================" >&2 | ||
fi | ||
|
||
exit $RC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters