blob: 652fcdb30deadb17067ffa96319e2b5fec252e97 [file] [log] [blame]
Dmitry V. Levin7b9e45e2013-03-01 15:50:22 +00001#!/bin/sh
2
3# Ensure that strace -e trace=set works.
4
5. "${srcdir=.}/init.sh"
6
Dmitry V. Levin7b9e45e2013-03-01 15:50:22 +00007check_prog ls
8check_prog grep
9
Dmitry V. Levinf60347d2013-06-18 15:28:47 +000010$STRACE -e execve ls > /dev/null 2> $LOG &&
Dmitry V. Levin107ceb92013-06-18 13:35:29 +000011grep '^execve(' $LOG > /dev/null ||
12 { cat $LOG; fail_ 'strace -e execve does not work'; }
Dmitry V. Levin7b9e45e2013-03-01 15:50:22 +000013
Dmitry V. Levin107ceb92013-06-18 13:35:29 +000014grep -v '^execve(' $LOG |
Dmitry V. Levin7b9e45e2013-03-01 15:50:22 +000015LC_ALL=C grep '^[[:alnum:]_]*(' > /dev/null &&
Dmitry V. Levin107ceb92013-06-18 13:35:29 +000016 { cat $LOG; fail_ 'strace -e execve does not work properly'; }
Dmitry V. Levin7b9e45e2013-03-01 15:50:22 +000017
Dmitry V. Levinf60347d2013-06-18 15:28:47 +000018$STRACE -e trace=process ls > /dev/null 2> $LOG &&
Dmitry V. Levin107ceb92013-06-18 13:35:29 +000019grep '^execve(' $LOG > /dev/null ||
20 { cat $LOG; fail_ 'strace -e trace=process does not work'; }
Dmitry V. Levin7b9e45e2013-03-01 15:50:22 +000021
Dmitry V. Levin107ceb92013-06-18 13:35:29 +000022grep '^open' $LOG > /dev/null &&
23 { cat $LOG; fail_ 'strace -e trace=process does not work properly'; }
Dmitry V. Levin7b9e45e2013-03-01 15:50:22 +000024
25exit 0