Dmitry V. Levin
226bf1c21b
Factor out awk code used in several tests to match.awk. * tests/match.awk: New file. * tests/Makefile.am (EXTRA_DIST): Add it. * tests/caps.awk: Use it. * tests/getdents.awk: Likewise. * tests/getrandom.awk: Likewise. * tests/select.awk: Likewise. * tests/sigaction.awk: Likewise. * tests/init.sh (match_awk): Use gawk not awk. Define AWKPATH. * tests/getdents.test: Likewise.
34 lines
700 B
Bash
Executable File
34 lines
700 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# Check that getdents/getdents64 syscalls are traced properly.
|
|
|
|
. "${srcdir=.}/init.sh"
|
|
|
|
check_prog gawk
|
|
AWKPATH="$srcdir" gawk -f "$srcdir"/getdents.awk "$srcdir"/getdents.out ||
|
|
framework_skip_ 'gawk does not work properly'
|
|
|
|
check_prog ls
|
|
check_prog mkdir
|
|
check_prog rm
|
|
check_prog seq
|
|
check_prog touch
|
|
|
|
dir="$LOG.dir"
|
|
rm -rf -- "$dir"
|
|
mkdir -- "$dir" ||
|
|
framework_skip_ 'failed to create a directory'
|
|
|
|
touch -- "$dir/$(for i in $(seq 1 127); do echo A; done; echo Z)" ||
|
|
framework_skip_ 'failed to create a file'
|
|
|
|
ls -- "$dir" > /dev/null ||
|
|
framework_skip_ 'failed to list a directory'
|
|
|
|
run_strace -vegetdents,getdents64 ls -- "$dir" > /dev/null
|
|
match_awk
|
|
|
|
rm -rf -- "$dir"
|
|
|
|
exit 0
|