-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathrun-suite.sh
executable file
·148 lines (113 loc) · 3.88 KB
/
run-suite.sh
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
#!/bin/bash
#
# Env args:
# - FIREFOX_BINARY: path to the FF binary
# - WF_VERSION: the wildfly version to install
# - TMPDIR: the tmp directory to download and install into
# - SERVER_MODE: which tests to execute (standalone || domain)
# - DOWNLOAD_URL (optional): the location for required binaries
# - HAL_VERSION: the HAL version to install
# - HAL_FS_LOCATION: HAL artifact location on the filesystem (otherwise mvn repo will be used)
#
if [ "${WF_VERSION}x" == "x" ] ; then
echo "WF_VERSION has to be specified!"
exit 1
fi
if [ "${FIREFOX_BINARY}x" == "x" ] ; then
echo "FIREFOX_BINARY has to be specified!"
exit 1
fi
if [ "${SERVER_MODE}x" == "x" ] ; then
echo "SERVER_MODE has to be specified!"
exit 1
fi
if [ "${M2_HOME}x" == "x" ] ; then
echo "M2_HOME has to be specified!"
exit 1
fi
if [ "${HAL_VERSION}x" == "x" ] ; then
echo "HAL_VERSION has to be specified!"
exit 1
fi
#
# function definitions
#
function prepareServer {
if [ "${DOWNLOAD_URL}x" == "x" ]; then
export URL="http://download.jboss.org/wildfly/${WF_VERSION}"
else
export URL=$DOWNLOAD_URL
fi
if [ "${WF_VERSION}x" != "x" ]; then
wget -nc -O $TMPDIR/wildfly-${WF_VERSION}.zip "$URL/wildfly-${WF_VERSION}.zip"
rm -rf $TMPDIR/wildfly-${WF_VERSION}
unzip -q $TMPDIR/wildfly-${WF_VERSION}.zip -d $TMPDIR
fi
export SERVER_DIR_PATH=$TMPDIR/wildfly-${WF_VERSION}
echo "test suite server at: $SERVER_DIR_PATH"
#add user
$SERVER_DIR_PATH/bin/add-user.sh -s admin asd1asd!
# unsecure
if [ "$(uname -s)" == "Darwin" ]; then
sed -i '.bak' 's/http-interface security-realm=\"ManagementRealm\"/http-interface /' $SERVER_DIR_PATH/standalone/configuration/standalone-full-ha.xml
sed -i '.bak' 's/http-interface security-realm=\"ManagementRealm\"/http-interface /' $SERVER_DIR_PATH/domain/configuration/host.xml
else
sed 's/http-interface security-realm=\"ManagementRealm\"/http-interface /' -i $SERVER_DIR_PATH/standalone/configuration/standalone-full-ha.xml
sed 's/http-interface security-realm=\"ManagementRealm\"/http-interface /' -i $SERVER_DIR_PATH/domain/configuration/host.xml
fi
}
function shutdownServer {
$SERVER_DIR_PATH/bin/jboss-cli.sh -c --command=:shutdown || true
}
function runServer {
shutdownServer
if [ "$SERVER_MODE" == "domain" ]; then
eval "($SERVER_DIR_PATH/bin/domain.sh) &"
echo $!>$TMPDIR/HAL_TS_WF.pid
else
eval "($SERVER_DIR_PATH/bin/standalone.sh -c standalone-full-ha.xml) &"
echo $!>$TMPDIR/HAL_TS_WF.pid
fi
echo "WF PID: $(cat $TMPDIR/HAL_TS_WF.pid)"
sleep 20
}
function prepareSuite {
cd $WORKSPACE
git clone https://github.com/hal/testsuite.git
pushd testsuite
git log --no-merges -1 --pretty=format:"Testsuite commit %h %an %s"
popd
}
function killServer() {
sh kill.sh
}
function runSuite {
if [ -n "$DTEST" ]; then
export DTEST="-Dtest=$DTEST"
fi
if [ "$SERVER_MODE" == "domain" ]; then
sh $M2_HOME/bin/mvn test -Pbasic,domain -Djboss.dist=$SERVER_DIR_PATH $DTEST -Darq.extension.webdriver.firefox_binary="${FIREFOX_BINARY}" || true
else
sh $M2_HOME/bin/mvn test -Pbasic,standalone -Djboss.dist=$SERVER_DIR_PATH $DTEST -Darq.extension.webdriver.firefox_binary="${FIREFOX_BINARY}" || true
fi
}
function prepareCore {
if [ -n "$HAL_FS_LOCATION" ]; then
new_artifact="$HAL_FS_LOCATION/jboss-as-console-$HAL_VERSION-resources.jar"
else
sh $M2_HOME/bin/mvn dependency:copy -DoutputDirectory=$TMPDIR -Dmaven.repository=https://repository.jboss.org/nexus/content/groups/public/ -Dartifact=org.jboss.as:jboss-as-console:$HAL_VERSION:jar:resources
new_artifact="$TMPDIR/jboss-as-console-$HAL_VERSION-resources.jar"
fi
original_artifact=$(ls $SERVER_DIR_PATH/modules/system/layers/base/org/jboss/as/console/**/*.jar)
rm -f $original_artifact
cp -v $new_artifact $original_artifact
}
#
# Execution
#
prepareServer
prepareCore
killServer
runServer
runSuite
shutdownServer