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

View file

@ -12,6 +12,7 @@ cache:
directories: directories:
- ${CROSS_ROOT} - ${CROSS_ROOT}
addons: addons:
ssh_known_hosts: 195.138.84.66
apt: apt:
packages: packages:
- make - make
@ -35,6 +36,11 @@ addons:
- vim-common - vim-common
before_install: before_install:
- openssl aes-256-cbc -K $encrypted_3de02a3a9dd1_key -iv $encrypted_3de02a3a9dd1_iv
-in utils/travis_tests/deploy_rsa.enc -out /tmp/deploy_rsa -d
- eval "$(ssh-agent -s)"
- chmod 600 /tmp/deploy_rsa
- ssh-add /tmp/deploy_rsa
- travis_wait 30 utils/travis_build/install_toolchain.sh - travis_wait 30 utils/travis_build/install_toolchain.sh
script: script:
@ -45,3 +51,5 @@ script:
- ( ${MAKE_CMD} ) || ( ${MAKE_CMD} V=1 ) - ( ${MAKE_CMD} ) || ( ${MAKE_CMD} V=1 )
# build bootloader # build bootloader
- make -C bootloader/ - make -C bootloader/
# run tests
- ./utils/travis_tests/run_tests.sh

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