forked from gordyt/docker-zcs-soap-tests
-
Notifications
You must be signed in to change notification settings - Fork 1
/
init
executable file
·44 lines (42 loc) · 1.76 KB
/
init
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
#!/bin/bash
# Perform runtime initialization of container and update the
# /opt/zimbra/qa/global.properties with proper configuration
#
# Expects the following envirnment variables:
# ZIMBRA_HOST
# ZIMBRA_DOMAIN
# ZIMBRA_PASSWORDS
#
# By default, the SanityTest suite will be run and the container will shut down.
# If, instead, additional argument(s) are provided to this script, then the initial
# configuration setup will still be performed, STAF will be started and the local
# services added, but instead of executing the SanityTest and exiting, the
# additional arguments will be executed. For example, if this script is
# called as follows (it will be installed in the container at /opt/qa/init)...
#
# /opt/qa/init /bin/sleep inifinity
#
# ...then the container will be brought up and initialized, but won't do anything
# automatically. You can then connect to the container (docker exec -it soap bash)
# and manually run individual tests.
#
# Update the config file
echo "updating config"
sed -i.bak -e "s/ZIMBRA_HOST/${ZIMBRA_HOST}/" -e "s/ZIMBRA_DOMAIN/${ZIMBRA_DOMAIN}/" -e "s/ZIMBRA_PASSWORDS/${ZIMBRA_PASSWORDS}/" /opt/qa/soapvalidator/conf/global.properties
# Fire up STAF
export PATH=/usr/local/staf/bin:$PATH
echo 'PATH=/usr/local/staf/bin:$PATH' >> /root/.bashrc
echo "starting STAF"
/usr/local/staf/startSTAFProc.sh
sleep 5
echo "adding STAF services"
STAF local service add service SOAP LIBRARY JSTAF EXECUTE /opt/qa/soapvalidator/bin/zimbrastaf.jar
STAF local service add service LOG LIBRARY STAFLog
if [ $# -eq 0 ]
then
echo "running SanityTest suite"
STAF LOCAL soap EXECUTE ${ZIMBRA_HOST} ZIMBRAQAROOT /opt/qa/soapvalidator/ DIRECTORY /opt/qa/soapvalidator/data/soapvalidator/SanityTest/ LOG /results/ SUITE SANITY
else
echo "running ${@}"
$@
fi