First draft of Travis running tests

This commit is contained in:
sheinz 2016-10-30 20:22:27 +02:00
parent d7fe808810
commit 290836509d
3 changed files with 50 additions and 0 deletions

Binary file not shown.

42
utils/travis_tests/run_tests.sh Executable file
View file

@ -0,0 +1,42 @@
#!/bin/bash
TEST_SERVERS[0]="IP=195.138.84.66;User=pi;Type=dual"
# TEST_SERVERS[1]="IP=195.138.84.55;Type=solo"
function build {
echo "Building tests"
make -C ./tests clean
make -C ./tests -j8
tar -czf /tmp/tests.tar.gz ./tests ./common.mk ./parameters.mk
}
# $1 - Server IP
# $2 - Login user name
function deploy {
echo "Deploying tests, server IP=${1}"
scp /tmp/tests.tar.gz ${2}@${1}:/tmp/tests.tar.gz
ssh ${2}@${1} mkdir -p /tmp/eor_test
ssh ${2}@${1} rm -rf /tmp/eor_test/*
ssh ${2}@${1} tar -xzf /tmp/tests.tar.gz -C /tmp/eor_test
}
# $1 - Server IP
# $2 - Login user name
# $3 - Type "solo" or "dual"
function run_tests {
echo "Running tests, server IP=${1}, type=${2}"
}
build
for server in "${TEST_SERVERS[@]}"
do
params=(${server//;/ })
ip=${params[0]#IP=}
user=${params[1]#User=}
type=${params[2]#Type=}
deploy ${ip} ${user}
run_tests ${ip} ${user} ${type}
done