Dmitry V. Levin | 12e2442 | 2015-01-12 16:08:59 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | # Check decoding of ipc semget/semctl syscalls |
| 4 | |
| 5 | . "${srcdir=.}/init.sh" |
| 6 | |
| 7 | check_prog grep |
| 8 | |
| 9 | OUT="$LOG.out" |
| 10 | |
Andreas Schwab | fa5ce37 | 2015-03-11 12:33:30 +0100 | [diff] [blame] | 11 | ./ipc_sem > /dev/null || { |
| 12 | if [ $? -eq 77 ]; then |
Dmitry V. Levin | 12e2442 | 2015-01-12 16:08:59 +0000 | [diff] [blame] | 13 | framework_skip_ 'ipc semget/semctl syscalls do not behave as expected' |
Andreas Schwab | fa5ce37 | 2015-03-11 12:33:30 +0100 | [diff] [blame] | 14 | else |
Dmitry V. Levin | 12e2442 | 2015-01-12 16:08:59 +0000 | [diff] [blame] | 15 | fail_ 'ipc_sem failed' |
Andreas Schwab | fa5ce37 | 2015-03-11 12:33:30 +0100 | [diff] [blame] | 16 | fi |
Dmitry V. Levin | 12e2442 | 2015-01-12 16:08:59 +0000 | [diff] [blame] | 17 | } |
| 18 | |
Mike Frysinger | 4ed340b | 2015-02-27 01:39:25 -0500 | [diff] [blame] | 19 | args='-eipc ./ipc_sem' |
Dmitry V. Levin | 12e2442 | 2015-01-12 16:08:59 +0000 | [diff] [blame] | 20 | $STRACE -o "$LOG" $args > "$OUT" && |
Andreas Schwab | 3355784 | 2015-03-11 17:49:06 +0100 | [diff] [blame] | 21 | exp_lines=$(wc -l < "$OUT") && |
| 22 | matched_lines=$(LC_ALL=C grep -c -E -x -f "$OUT" "$LOG") && |
| 23 | test $exp_lines -eq $matched_lines || { |
Dmitry V. Levin | 12e2442 | 2015-01-12 16:08:59 +0000 | [diff] [blame] | 24 | cat "$OUT" "$LOG" |
| 25 | fail_ "$STRACE $args output mismatch" |
| 26 | } |
| 27 | |
| 28 | rm -f "$OUT" |
| 29 | |
| 30 | exit 0 |