33557845ad
* tests/ipc_msg.test: Count matches to verify that all patterns match. * tests/ipc_sem.test: Likewise. * tests/ipc_shm.test: Likewise. * tests/stat32-v.test: Likewise. * tests/stat64-v.test: Likewise.
41 lines
793 B
Bash
Executable File
41 lines
793 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# Check verbose decoding of 64-bit stat syscall.
|
|
|
|
. "${srcdir=.}/init.sh"
|
|
|
|
check_prog dd
|
|
check_prog grep
|
|
check_prog touch
|
|
|
|
OUT="$LOG.out"
|
|
size=46118400000
|
|
sample=stat64_sample
|
|
|
|
umask 022
|
|
truncate_cmd="dd seek=$size bs=1 count=0 if=/dev/null of=$sample"
|
|
$truncate_cmd > "$OUT" 2>&1 || {
|
|
cat "$OUT"
|
|
framework_skip_ 'failed to create a large sparse file'
|
|
}
|
|
|
|
./stat $sample > /dev/null ||
|
|
fail_ 'stat failed'
|
|
|
|
touch -d '1970-01-01 -42 seconds' $sample
|
|
|
|
for f in $sample . /dev/null; do
|
|
args="-v -efile ./stat $f"
|
|
$STRACE -o "$LOG" $args > "$OUT" &&
|
|
exp_lines=$(wc -l < "$OUT") &&
|
|
matched_lines=$(LC_ALL=C grep -c -E -x -f "$OUT" "$LOG") &&
|
|
test $exp_lines -eq $matched_lines || {
|
|
cat "$OUT" "$LOG"
|
|
fail_ "$STRACE $args output mismatch"
|
|
}
|
|
done
|
|
|
|
rm -f $sample "$OUT"
|
|
|
|
exit 0
|