]> granicus.if.org Git - strace/blob - tests/printpath-umovestr-legacy.test
Update copyright headers
[strace] / tests / printpath-umovestr-legacy.test
1 #!/bin/sh
2 #
3 # Force legacy printpath/umovestr using process_vm_readv fault injection.
4 #
5 # Copyright (c) 2017-2018 Dmitry V. Levin <ldv@altlinux.org>
6 # All rights reserved.
7 #
8 # SPDX-License-Identifier: GPL-2.0-or-later
9
10 . "${srcdir=.}/scno_tampering.sh"
11
12 > "$LOG" || fail_ "failed to write $LOG"
13 fault_args='-qq -esignal=none -etrace=process_vm_readv -efault=process_vm_readv'
14 args='../printpath-umovestr-peekdata'
15
16 $STRACE -o "$LOG" $fault_args $args > /dev/null || {
17         rc=$?
18         if [ $rc -eq 77 ]; then
19                 skip_ "$fault_args $args exited with code 77"
20         else
21                 fail_ "$fault_args $args failed with code $rc"
22         fi
23 }
24
25 > "$LOG" || fail_ "failed to write $LOG"
26 args="-a11 -e signal=none -e trace=chdir $args skip-process_vm_readv-check"
27
28 $STRACE -o /dev/null $fault_args \
29         $STRACE -o "$LOG" $args > "$EXP" ||
30         dump_log_and_fail_with "$STRACE $args failed with code $?"
31
32 match_diff "$LOG" "$EXP"