File: smoke_test.sh

package info (click to toggle)
sphinxsearch 2.2.11-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 25,720 kB
  • sloc: cpp: 102,259; xml: 85,608; sh: 9,259; php: 3,790; ansic: 3,158; yacc: 1,969; java: 1,336; ruby: 1,289; python: 1,062; pascal: 912; perl: 381; lex: 275; makefile: 150; sql: 77; cs: 35
file content (50 lines) | stat: -rwxr-xr-x 1,115 bytes parent folder | download | duplicates (5)
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
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh

[ "z$FAILLOG" = "z" ] && FAILLOG="/tmp/faillog"
DIFF='smoke_diff.txt'
RES='smoke_test.txt'
REF='smoke_ref.txt'
SHELL='/bin/sh'
LINE='-----------------------------\n'

die()
{
	cat $FAILLOG
	echo $LINE
	[ ! "z$2" = "z" ] && { eval $2; echo "$LINE"; }
	echo "C API:$1"
	[ -e "$FAILLOG" ] && rm $FAILLOG
	
	stop="../../src/searchd -c smoke_test.conf --stop"
    echo "Executing: $stop\n">$FAILLOG
    eval "$stop" 1>>$FAILLOG 2>&1
	exit 1
}

cmd ()
{
        echo "Executing: $1\n">$FAILLOG
        eval $1 1>>$FAILLOG 2>&1 || die "$2" "$3"
}

cmd "$SHELL ./configure --with-debug" "configure failed"
cmd "make clean" "make clean failed"
cmd "make" "make failed"


cmd "../../src/indexer -c smoke_test.conf --all" "indexing failed"
cmd "../../src/searchd -c smoke_test.conf --test" "searchd start failed"
cmd "sleep 1s"
cmd "./test --smoke --port 10312>$RES" "test --smoke --port 10312 failed"
cmd "../../src/searchd -c smoke_test.conf --stop" "searchd stop failed"

cmd "make clean" " "

cmd "diff --unified=3 $REF $RES >$DIFF" 'diff failed' "cat $DIFF"

rm $RES
rm $DIFF
rm $FAILLOG

echo "all ok"
exit 0