summaryrefslogtreecommitdiffstats
path: root/scripts/compose_pki_test_package
blob: b62ecf494a1d0cfd908a2773107efc13461e317f (plain)
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
#!/bin/sh
# BEGIN COPYRIGHT BLOCK
# (C) 2010 Red Hat, Inc.
# All rights reserved.
# END COPYRIGHT BLOCK

check_for_dependencies()
{
    NOT_FOUND="FALSE"
    for i in "expect" "beakerlib" "beaker-client" "rhts-devel"
    do
        rpm -qa $i
        if [ $? -ne 0 ] ; then
            echo "$i package required."
            NOT_FOUND="TRUE"
        fi
    done
    if [ $NOT_FOUND = "TRUE" ] ; then
        echo "Cannot compose test rpm without installing the dependencies."
        exit -1
    fi
}

check_for_dependencies

if [ $# -lt 1 ];
then
  echo "Usage: $0 unique_identifier [--submit-tests]"
  exit -1
fi

RUN_TESTS='N'

if [ $# -gt 1 ];
then
    if [ $2 = "--submit-tests" ]
    then
        RUN_TESTS='Y'
    fi
fi

### Directory with all the compose scripts
COMPOSE_DIR=`dirname $0 | cd ; pwd`

PKI_SOURCE_DIR=`cd $COMPOSE_DIR/..; pwd`

###   Build the task rpm outside the PKI git source tree.
###   The rhts-mk-build-package command checks if the code is is a git repository,
###   if yes, it will compare tags of the current branch and the master branch.
###   If they do not match then the rpm is not built.

WORK_DIR=`cd $COMPOSE_DIR/../..;pwd`

BUILD_DIR="$WORK_DIR/package.tests"

if [ ! -d $BUILD_DIR ] ; then
    mkdir $BUILD_DIR
fi

cd $BUILD_DIR

rm -rf *.rpm

cp -r "$PKI_SOURCE_DIR/tests" .

### Compile the java test source ###

cd tests/dogtag/dev_java_tests

rm -rf bin

mkdir bin

CLASSPATH=$PKI_SOURCE_DIR/base/test/src
CLASSPATH=$CLASSPATH:$PKI_SOURCE_DIR/tests/dogtag/dev_java_tests/src
CLASSPATH=$CLASSPATH:$PKI_SOURCE_DIR/base/symkey/src
CLASSPATH=$CLASSPATH:$PKI_SOURCE_DIR/base/util/src
CLASSPATH=$CLASSPATH:$PKI_SOURCE_DIR/base/util/test
CLASSPATH=$CLASSPATH:$PKI_SOURCE_DIR/base/common/src
CLASSPATH=$CLASSPATH:$PKI_SOURCE_DIR/base/common/functional/src
CLASSPATH=$CLASSPATH:$PKI_SOURCE_DIR/base/java-tools/src
CLASSPATH=$CLASSPATH:$PKI_SOURCE_DIR/base/server/tomcat/src
CLASSPATH=$CLASSPATH:$PKI_SOURCE_DIR/base/server/cms/src
CLASSPATH=$CLASSPATH:$PKI_SOURCE_DIR/base/server/cmscore/src
CLASSPATH=$CLASSPATH:$PKI_SOURCE_DIR/base/server/test
CLASSPATH=$CLASSPATH:$PKI_SOURCE_DIR/base/ca/src
CLASSPATH=$CLASSPATH:$PKI_SOURCE_DIR/base/ca/functional/src
CLASSPATH=$CLASSPATH:$PKI_SOURCE_DIR/base/kra/src
CLASSPATH=$CLASSPATH:$PKI_SOURCE_DIR/base/kra/functional/src
CLASSPATH=$CLASSPATH:$PKI_SOURCE_DIR/base/ocsp/src
CLASSPATH=$CLASSPATH:$PKI_SOURCE_DIR/base/tks/src
CLASSPATH=$CLASSPATH:$PKI_SOURCE_DIR/base/tps/src
CLASSPATH=$CLASSPATH:/usr/share/java/junit.jar
CLASSPATH=$CLASSPATH:`pwd`/src
CLASSPATH=$CLASSPATH:/usr/lib64/jss/jss4.jar
CLASSPATH=$CLASSPATH:/usr/share/java/httpcomponents/httpclient.jar
CLASSPATH=$CLASSPATH:/usr/share/java/httpcomponents/httpcore.jar
CLASSPATH=$CLASSPATH:/usr/share/java/jackson/jackson-core-asl.jar
CLASSPATH=$CLASSPATH:/usr/share/java/jackson/jackson-jaxrs.jar
CLASSPATH=$CLASSPATH:/usr/share/java/jackson/jackson-mapper-asl.jar
CLASSPATH=$CLASSPATH:/usr/share/java/jackson/jackson-mrbean.jar
CLASSPATH=$CLASSPATH:/usr/share/java/jackson/jackson-smile.jar
CLASSPATH=$CLASSPATH:/usr/share/java/jackson/jackson-xc.jar
CLASSPATH=$CLASSPATH:/usr/share/java/resteasy/jaxrs-api.jar
CLASSPATH=$CLASSPATH:/usr/share/java/resteasy/resteasy-atom-provider.jar
CLASSPATH=$CLASSPATH:/usr/share/java/resteasy/resteasy-client.jar
CLASSPATH=$CLASSPATH:/usr/share/java/resteasy/resteasy-jaxb-provider.jar
CLASSPATH=$CLASSPATH:/usr/share/java/resteasy/resteasy-jaxrs.jar
CLASSPATH=$CLASSPATH:/usr/share/java/resteasy/resteasy-jaxrs-jandex.jar
CLASSPATH=$CLASSPATH:/usr/share/java/resteasy/resteasy-jackson-provider.jar
CLASSPATH=$CLASSPATH:/usr/share/java/apache-commons-cli.jar
CLASSPATH=$CLASSPATH:/usr/share/java/apache-commons-codec.jar
CLASSPATH=$CLASSPATH:/usr/share/java/apache-commons-logging.jar
CLASSPATH=$CLASSPATH:/usr/share/java/commons-codec.jar
CLASSPATH=$CLASSPATH:/usr/share/java/commons-httpclient.jar
CLASSPATH=$CLASSPATH:/usr/share/java/idm-console-base-1.1.7.jar
CLASSPATH=$CLASSPATH:/usr/share/java/idm-console-mcc.jar
CLASSPATH=$CLASSPATH:/usr/share/java/idm-console-nmclf.jar
CLASSPATH=$CLASSPATH:/usr/share/java/jakarta-commons-httpclient.jar
CLASSPATH=$CLASSPATH:/usr/share/java/jaxb-api.jar
CLASSPATH=$CLASSPATH:/usr/share/java/ldapjdk.jar
CLASSPATH=$CLASSPATH:/usr/share/java/apache-commons-lang.jar
CLASSPATH=$CLASSPATH:/usr/share/java/istack-commons-runtime.jar
CLASSPATH=$CLASSPATH:/usr/share/java/scannotation.jar
CLASSPATH=$CLASSPATH:/usr/share/java/servlet.jar
CLASSPATH=$CLASSPATH:/usr/share/java/velocity.jar
CLASSPATH=$CLASSPATH:/usr/share/java/xerces-j2.jar
CLASSPATH=$CLASSPATH:/usr/share/java/xml-commons-apis.jar
CLASSPATH=$CLASSPATH:/usr/share/java/tomcat/catalina.jar
CLASSPATH=$CLASSPATH:/usr/share/java/tomcat/tomcat-util.jar
CLASSPATH=$CLASSPATH:/usr/share/java/commons-io.jar
CLASSPATH=$CLASSPATH:/usr/lib/java/nuxwdog.jar

javac -classpath $CLASSPATH -d bin src/*java

### Building the test rm

cd ..

### Passing the keyword for personalizing and an option
### to maintain a seperate folder for each beaker job (Optional)
./make-package.sh $1

mv *.rpm ../../

cd ../..
### Running the tasks

if [ $RUN_TESTS = "Y" ] ; then
     bkr task-add *.rpm
fi