~ubuntu-branches/ubuntu/raring/eucalyptus/raring

« back to all changes in this revision

Viewing changes to clc/tools/runTest.sh

  • Committer: Package Import Robot
  • Author(s): Brian Thomason
  • Date: 2011-11-29 13:17:52 UTC
  • mfrom: (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 185.
  • Revision ID: package-import@ubuntu.com-20111129131752-rq31al3ntutv2vvl
Tags: upstream-3.0.999beta1
ImportĀ upstreamĀ versionĀ 3.0.999beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
 
3
# Runs any static method within eucalyptus. Does not require Eucalyptus to be
 
4
#  running. Initializes everything, sets up database and persistence contexts, etc.
 
5
#
 
6
# Syntax: runTest.sh -t fullyQualifiedClassName:staticMethodName[:arg0,arg1...]
 
7
#
 
8
# Arguments are always of type java.lang.String. If you desire some other
 
9
#  type then your method must convert.
 
10
#
 
11
# Example usage:
 
12
#  runTest.sh -t com.eucalyptus.reporting.instance.FalseDataGenerator:summarizeFalseDataTwoCriteria:cluster,user
 
13
#
 
14
 
 
15
set -e
 
16
log() {
 
17
  FSTR="${1}\n"
 
18
  shift
 
19
  printf "${FSTR}" ${@} | tee -a ${UP_LOG}
 
20
}
 
21
 
 
22
if [ -z "${EUCALYPTUS}" ]; then
 
23
        echo "EUCALYPTUS must be set to run tests."
 
24
fi
 
25
 
 
26
# setup the classpath
 
27
CLASSPATH=".:"
 
28
FILES=$(\ls -1 ${EUCALYPTUS}/usr/share/eucalyptus/*.jar)
 
29
for FILE in $FILES; do
 
30
  export CLASSPATH=${FILE}:${CLASSPATH}
 
31
done
 
32
 
 
33
# we assume that anything starting with '-D' is a JVM argument
 
34
for arg in "$@" ; do
 
35
    if [ "${arg:0:2}" = "-D" ] ; then
 
36
        JVM_PARAMS="$JVM_PARAMS $arg"
 
37
    else
 
38
        HARNESS_PARAMS="$HARNESS_PARAMS $arg"
 
39
    fi
 
40
done
 
41
 
 
42
CLuSSPATH=${EUCALYPTUS}/etc/eucalyptus/cloud.d/upgrade:${EUCALYPTUS}/etc/eucalyptus/cloud.d/scripts:${CLASSPATH}
 
43
echo -e "${CLASSPATH//:/\n}"
 
44
java -Xms1g -Xmx3g -XX:MaxPermSize=768m -Xbootclasspath/p:${EUCALYPTUS}/usr/share/eucalyptus/openjdk-crypto.jar -classpath ${CLASSPATH} \
 
45
        -Deuca.home=${EUCALYPTUS} \
 
46
        -Deuca.lib.dir=${EUCALYPTUS} \
 
47
        -Deuca.upgrade.new.dir=${EUCALYPTUS} \
 
48
        -Deuca.upgrade.destination=com.eucalyptus.upgrade.MysqldbDestination \
 
49
        -Deuca.log.level=TRACE  \
 
50
        -Deuca.log.appender=console \
 
51
        -Djava.security.egd=file:/dev/./urandom \
 
52
        ${JVM_PARAMS} \
 
53
        com.eucalyptus.upgrade.TestHarness ${HARNESS_PARAMS}