File: test_server.sh

package info (click to toggle)
virtuoso-opensource 6.1.4%2Bdfsg1-7
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 245,116 kB
  • sloc: ansic: 639,631; sql: 439,225; xml: 287,085; java: 61,048; sh: 38,723; cpp: 36,889; cs: 25,240; php: 12,562; yacc: 9,036; lex: 7,149; makefile: 6,093; jsp: 4,447; awk: 1,643; perl: 1,017; ruby: 1,003; python: 329
file content (174 lines) | stat: -rwxr-xr-x 3,982 bytes parent folder | download | duplicates (2)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
#!/bin/sh
#
#  $Id: test_server.sh,v 1.4.2.1 2009/04/20 21:15:31 source Exp $
#
#  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
#  project.
#
#  Copyright (C) 1998-2009 OpenLink Software
#
#  This project is free software; you can redistribute it and/or modify it
#  under the terms of the GNU General Public License as published by the
#  Free Software Foundation; only version 2 of the License, dated June 1991.
#
#  This program is distributed in the hope that it will be useful, but
#  WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
#  General Public License for more details.
#
#  You should have received a copy of the GNU General Public License along
#  with this program; if not, write to the Free Software Foundation, Inc.,
#  51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#

CLIENT=$2
if [ x$CLIENT = x ] ; then
    CLIENT=Virtuoso.dll
fi

RUNTIME=$3
if [ x$RUNTIME = x ] ; then
    RUNTIME=MS
fi

LOGFILE="`pwd`/dotnet.output"
export LOGFILE
. ../suite/test_fn.sh
BANNER "STARTED $CLIENT .NET CLIENT TEST"

DS1=$PORT
HTTPPORT1=$HTTPPORT

case $RUNTIME in
    MS)
	MAKEFILE=Makefile
	RUNT=../harness/ConsoleTestRunner.exe
	;;
    MSDTC)
	MAKEFILE=Makefile
	RUNT=../harness/ConsoleTestRunner.exe
        DTC_TEST=/DTC_TEST+
	;;
    MONO)
	MAKEFILE=Makefile.mono
	RUNT="mono ../harness/ConsoleTestRunner.exe"
	;;
    *)
	echo "***FAILED: Unknown runtime. Exiting" | tee -a $LOGFILE
	exit 3;
	;;
esac

cd harness
make -f $MAKEFILE clean
make -f $MAKEFILE
cd ..

cd VirtuosoClientSuite
make -f $MAKEFILE clean
make -f $MAKEFILE
cd ..

# Make INI 
MAKE_CFG ()
{
  file=$1
  port=$2
  httpport=$3
  cat $file | sed -e "s/HTTPPORT/$httpport/g" -e "s/PORT/$port/g" -e "s/SQLOPTIMIZE/$SQLOPTIMIZE/g" -e "s/PLDBG/$PLDBG/g" -e "s/CASE_MODE/$CASE_MODE/g" > $CFGFILE
}

# decide witch server options set to use based on the server's name
SERVER=$1
case $SERVER in

  *virtuoso*)
	  echo Using virtuoso configuration | tee -a $LOGFILE
	  CFGFILE=virtuoso.ini
	  DBFILE=virtuoso.db
	  DBLOGFILE=virtuoso.trx
	  DELETEMASK="virtuoso.log virtuoso.lck $DBLOGFILE $DBFILE"
	  TESTCFGFILE=virtuoso-1111.ini
	  TESTCFGFILEDS1=virtuoso-1111.ini
	  TESTCFGFILEDS2=virtuoso-1112.ini
	  BACKUP_DUMP_OPTION=+backup-dump
	  CRASH_DUMP_OPTION=+crash-dump


# only in that case
	  FOREGROUND_OPTION=+foreground
	  LOCKFILE=virtuoso.lck
	  export FOREGROUND_OPTION LOCKFILE
	  ;;
  *[Mm]2*)
	  echo Using M2 configuration | tee -a $LOGFILE
	  CFGFILE=wi.cfg
	  DBFILE=wi.db
	  DBLOGFILE=wi.log
	  DELETEMASK="wi.*"
	  TESTCFGFILE=witest.cfg
	  TESTCFGFILEDS1=witest.cfg
	  TESTCFGFILEDS2=witest.cfg
	  BACKUP_DUMP_OPTION=-d
	  CRASH_DUMP_OPTION=-D
	  unset FOREGROUND_OPTION
	  unset LOCKFILE
	  ;;

   *)
	  echo "***FAILED: Unknown server. Exiting" | tee -a $LOGFILE
	  exit 3;
	  ;;
esac

case $CLIENT in
    VirtuosoOdbcClient.dll)
	TEST_SUITE=VirtuosoOdbcClientSuite.dll
	TEST_DTC_SUITE=VirtuosoDtcOdbcClientSuite.dll
	;;
    VirtuosoClient.dll)
	TEST_SUITE=VirtuosoClientSuite.dll
	TEST_DTC_SUITE=VirtuosoDtcClientSuite.dll
	;;
    Virtuoso.dll)
	TEST_SUITE=VirtuosoSuite.dll
	TEST_DTC_SUITE=VirtuosoDtcSuite.dll
	;;
    *)
	echo "***FAILED: Unknown client. Exiting" | tee -a $LOGFILE
	exit 3;
	;;
esac

export CFGFILE DBFILE DBLOGFILE DELETEMASK TESTCFGFILEDS1 TESTCFGFILEDS2
export BACKUP_DUMP_OPTION CRASH_DUMP_OPTION TESTCFGFILE SERVER

# Start the server
rm -f $DELETEMASK
MAKE_CFG ../suite/$TESTCFGFILE $DS1 $HTTPPORT1

if [ -f VirtuosoClientSuite/OpenLink.Data.$CLIENT ] ; then

START_SERVER $PORT 10000

cd VirtuosoClientSuite
if [ "x$DTC_TEST" != "x" ]
then
  $RUNT /host:localhost:$PORT $DTC_TEST $TEST_DTC_SUITE 2>&1| tee -a $LOGFILE
else
  $RUNT /host:localhost:$PORT $TEST_SUITE 2>&1| tee -a $LOGFILE
fi
cd ..

# Stop The server
SHUTDOWN_SERVER

# Check results
CHECK_LOG
BANNER "COMPLETED $CLIENT .NET CLIENT TEST"

else

BANNER "SKIPPED $CLIENT .NET CLIENT TEST"

fi