File: runocft

package info (click to toggle)
resource-agents 1%3A4.0.0~rc1-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,644 kB
  • ctags: 2,191
  • sloc: sh: 47,713; ansic: 4,074; perl: 3,457; makefile: 663; xml: 89
file content (38 lines) | stat: -rwxr-xr-x 632 bytes parent folder | download | duplicates (6)
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
33
34
35
36
37
38
#!/bin/sh
OCFTDIR=/usr/share/resource-agents/ocft
CONFDIR=$OCFTDIR/configs

prereq_run() {
	eval "$@"
}
prereq_prog() {
	which $@
}

test_prereq() {
	local tp arg
	tp=`echo $prereq|sed 's/:.*//'`
	arg=`echo $prereq|sed 's/[a-z]*://'`
	prereq_$tp $arg >/dev/null 2>&1
}

rm -f ocft.FAILED
rc=0
while read f prereq; do
	if [ -n "$prereq" ] && ! test_prereq; then
		echo "$f: prerequisite not fulfilled, skipping"
		continue
	fi
	ocft make $f
	if ! ocft test $f; then
		echo $f >> ocft.FAILED
		rc=1
	fi
done < $OCFTDIR/runocft.prereq

if [ -f ocft.FAILED ]; then
	echo "The following ocft tests failed:"
	cat ocft.FAILED
fi

exit $rc