File: tests-prepare.sh

package info (click to toggle)
spring 103.0%2Bdfsg2-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 43,720 kB
  • ctags: 63,685
  • sloc: cpp: 368,283; ansic: 33,988; python: 12,417; java: 12,203; awk: 5,879; sh: 1,846; xml: 655; perl: 405; php: 211; objc: 194; makefile: 77; sed: 2
file content (45 lines) | stat: -rwxr-xr-x 1,667 bytes parent folder | download
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
#!/bin/bash

# downloads game/map and creates script.txt

set -e
. buildbot/slave/validation/tests-env.sh

mkdir -p "${DOWNLOADDIR}" "${CONTENT_DIR}/LuaUI/Widgets" "${CONTENT_DIR}/LuaUI/Config"

PRDL="time ${TESTDIR}/usr/local/bin/pr-downloader --filesystem-writepath=$DOWNLOADDIR"
# get the name of the latest versions
GAME1=$($PRDL --download-game "$GAME" |egrep -o '\[Download\] (.*)' |head -n 1 |cut -b 12-)
$PRDL --download-map "$MAP"

echo "Creating script: test/validation/prepare.sh \"$GAME1\" \"$MAP\" \"$AI\" \"$AIVER\""
${SOURCEDIR}/test/validation/prepare.sh "$GAME1" "$MAP" "$AI" "$AIVER" > ${CONTENT_DIR}/script.txt
${SOURCEDIR}/test/validation/prepare-client.sh ValidationClient localhost 8452 >${CONTENT_DIR}/connect.txt

#install required files into spring dir
cd ${SOURCEDIR}

#symlink files into into destination dir
for i in games maps pool packages;
do
        # delete existing destination dir
        rm -rf ${CONTENT_DIR}/$i
        ln -sfv ${DOWNLOADDIR}/$i ${CONTENT_DIR}/$i
done

#copy widget + config
cp -suv ${SOURCEDIR}/test/validation/LuaUI/Widgets/test.lua ${CONTENT_DIR}/LuaUI/Widgets/test.lua
cp -v ${SOURCEDIR}/test/validation/LuaUI/Config/ZK_data.lua ${CONTENT_DIR}/LuaUI/Config/ZK_data.lua

# adjust springsettings.cfg
(
        # set datadir
        echo "SpringData = ${TESTDIR}/usr/local/share/games/spring"
        # disable bandwith limits (for syncdebug)
        echo "LinkIncomingMaxPacketRate = 0"
        echo "LinkIncomingMaxWaitingPackets = 0"
        echo "LinkIncomingPeakBandwidth = 0"
        echo "LinkIncomingSustainedBandwidth = 0"
        echo "LinkOutgoingBandwidth = 0"
) > ${CONTENT_DIR}/springsettings.cfg