File: tests-prepare.sh

package info (click to toggle)
spring 106.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 55,260 kB
  • sloc: cpp: 543,946; ansic: 44,800; python: 12,575; java: 12,201; awk: 5,889; sh: 1,796; asm: 1,546; xml: 655; perl: 405; php: 211; objc: 194; makefile: 76; sed: 2
file content (47 lines) | stat: -rwxr-xr-x 1,902 bytes parent folder | download | duplicates (4)
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
#!/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" "${CONTENT_DIR}/LuaUI/Widgets_BA"

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" 8452 > ${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 -suv ${SOURCEDIR}/test/validation/LuaUI/Widgets/test.lua ${CONTENT_DIR}/LuaUI/Widgets_BA/test.lua
cp -v ${SOURCEDIR}/test/validation/LuaUI/Config/ZK_data.lua ${CONTENT_DIR}/LuaUI/Config/ZK_data.lua
cp -v ${SOURCEDIR}/test/validation/LuaUI/Config/ZK_data.lua ${CONTENT_DIR}/LuaUI/Config/BA.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