summaryrefslogtreecommitdiff
path: root/tests/printpath-umovestr-legacy.test
blob: bc5c98bb86858ebb5860e38a9f498993092e5b66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
#
# Force legacy printpath/umovestr using process_vm_readv fault injection.
#
# Copyright (c) 2017-2018 Dmitry V. Levin <ldv@altlinux.org>
# All rights reserved.
#
# SPDX-License-Identifier: GPL-2.0-or-later

. "${srcdir=.}/scno_tampering.sh"

> "$LOG" || fail_ "failed to write $LOG"
fault_args='-qq -esignal=none -etrace=process_vm_readv -efault=process_vm_readv'
args='../printpath-umovestr-peekdata'

$STRACE -o "$LOG" $fault_args $args > /dev/null || {
	rc=$?
	if [ $rc -eq 77 ]; then
		skip_ "$fault_args $args exited with code 77"
	else
		fail_ "$fault_args $args failed with code $rc"
	fi
}

> "$LOG" || fail_ "failed to write $LOG"
args="-a11 -e signal=none -e trace=chdir $args skip-process_vm_readv-check"

$STRACE -o /dev/null $fault_args \
	$STRACE -o "$LOG" $args > "$EXP" ||
	dump_log_and_fail_with "$STRACE $args failed with code $?"

match_diff "$LOG" "$EXP"