blob: 9c95989e2c79cccfaf054556872d9bd57f977c77 [file] [log] [blame]
Dmitry V. Levin4176d532014-09-21 22:42:45 +00001#!/bin/sh
2
3# Check how statfs/statfs64 syscalls are traced.
4
5. "${srcdir=.}/init.sh"
6
7check_prog grep
8
9# this test probes /proc/self/status
10[ -f /proc/self/status ] ||
11 framework_skip_ '/proc/self/status is not available'
12
13./statfs ||
14 fail_ 'statfs failed'
15
16args="-efile ./statfs"
17$STRACE $args > $LOG 2>&1 || {
18 cat $LOG
19 fail_ "$STRACE $args failed"
20}
21
22grep_log()
23{
24 local syscall="$1"; shift
25
26 LC_ALL=C grep -E -x "$syscall$*" $LOG > /dev/null || {
27 cat $LOG
28 fail_ "$STRACE $args failed to trace \"$syscall\" properly"
29 }
30}
31
32grep_log 'statfs(64)?' '\("/proc/self/status"(, [1-9][0-9]*)?, {f_type="PROC_SUPER_MAGIC", f_bsize=[1-9][0-9]*, f_blocks=[0-9]+, f_bfree=[0-9]+, f_bavail=[0-9]+, f_files=[0-9]+, f_ffree=[0-9]+, f_fsid={[0-9]+, [0-9]+}, f_namelen=[1-9][0-9]*(, f_frsize=[0-9]+)?(, f_flags=[0-9]+)?}\) += 0'
33
34exit 0