summaryrefslogtreecommitdiff
path: root/tests/scripts/simfail.sh
blob: fe64a25e81a8ee412515086a36e6a904c458dd41 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

set -e

export APLWC_SIMULATE_FAILURE_PRINT_COUNT=1
N=$($1 3>&1 1>/dev/null 2>/dev/null)
n=1
export APLWC_SIMULATE_FAILURE_PRINT_COUNT=0

while [ "$n" -le "$N" ]
do
	echo $n out of $N
	export APLWC_SIMULATE_FAILURE_AT=$n
	$1 #1>/dev/null 2>/dev/null
	n=$((n + 1))
done