diff options
author | Wataru Ishida <ishida.wataru@lab.ntt.co.jp> | 2016-09-13 01:45:53 +0000 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-09-14 11:32:45 +0900 |
commit | 22f888766aba3eb39fc50f0161537221ed0c5f6a (patch) | |
tree | 85eddf6475c1bc1eb05e5d8868c1b65220e6618c | |
parent | 10142c11f9c93e6699d8e65af002cf2eef3a3e5e (diff) |
travis: divide scenario tests to multiple travis jobs
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
-rw-r--r-- | .travis.yml | 155 | ||||
-rwxr-xr-x[-rw-r--r--] | test/scenario_test/ci-scripts/travis-build-script.sh | 120 | ||||
-rwxr-xr-x | test/scenario_test/ci-scripts/travis-install-script.sh | 7 |
3 files changed, 128 insertions, 154 deletions
diff --git a/.travis.yml b/.travis.yml index 9ce91ab5..977d2158 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,51 +1,134 @@ language: go -sudo: required -services: - - docker - -go: - - 1.5 - - 1.6 - - 1.7 - - tip - -os: - - linux - - osx - -env: - - SCENARIO=false - - SCENARIO=true - before_install: - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo sysctl -w net.ipv6.conf.default.disable_ipv6=0; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo sysctl -w net.ipv6.conf.default.disable_ipv6=0; fi +install: test/scenario_test/ci-scripts/travis-install-script.sh +script: test/scenario_test/ci-scripts/travis-build-script.sh matrix: allow_failures: - go: tip - exclude: + include: - go: 1.5 - env: SCENARIO=true + before_install: true + install: go get -t ./... + script: go test ./... + - go: 1.6 + before_install: true + install: go get -t ./... + script: go test ./... + - go: 1.7 + before_install: true + install: go get -t ./... + script: go test ./... - go: tip - env: SCENARIO=true + before_install: true + install: go get -t ./... + script: go test ./... - go: 1.7 - env: SCENARIO=true - - os: osx - go: 1.5 - - os: osx - go: 1.6 - env: SCENARIO=true - - os: osx - go: 1.7 - - os: osx - go: tip + os: osx + before_install: true + install: go get -t ./... + script: go test ./... + - go: 1.7 + before_install: true + install: true + script: test -z "$(go fmt ./...)" + - go: 1.7 + before_install: true + install: go get ./... + script: python test/scenario_test/ci-scripts/build_embeded_go.py docs/sources/lib.md + - env: + - TEST=bgp_router_test.py DOCKER_IMAGE=gobgp + sudo: required + services: + - docker + - env: + - TEST=bgp_zebra_test.py DOCKER_IMAGE=gobgp + sudo: required + services: + - docker + - env: + - TEST=evpn_test.py DOCKER_IMAGE=gobgp + sudo: required + services: + - docker + - env: + - TEST=flow_spec_test.py DOCKER_IMAGE=gobgp + sudo: required + services: + - docker + - env: + - TEST=flow_spec_test.py DOCKER_IMAGE=gobgp + sudo: required + services: + - docker + - env: + - TEST=global_policy_test.py DOCKER_IMAGE=gobgp + sudo: required + services: + - docker + - env: + - TEST=graceful_restart_test.py DOCKER_IMAGE=gobgp + sudo: required + services: + - docker + - env: + - TEST=ibgp_router_test.py DOCKER_IMAGE=gobgp + sudo: required + services: + - docker + - env: + - TEST=route_reflector_test.py DOCKER_IMAGE=gobgp + sudo: required + services: + - docker + - env: + - TEST=route_server_as2_test.py DOCKER_IMAGE=gobgp + sudo: required + services: + - docker + - env: + - TEST=route_server_ipv4_v6_test.py DOCKER_IMAGE=gobgp + sudo: required + services: + - docker + - env: + - TEST=route_server_malformed_test.py DOCKER_IMAGE=gobgp + sudo: required + services: + - docker + - env: + - TEST=route_server_policy_grpc_test.py DOCKER_IMAGE=gobgp + sudo: required + services: + - docker + - env: + - TEST=route_server_policy_test.py DOCKER_IMAGE=gobgp + sudo: required + services: + - docker + - env: + - TEST=route_server_softreset_test.py DOCKER_IMAGE=gobgp + sudo: required + services: + - docker + - env: + - TEST=route_server_test.py DOCKER_IMAGE=gobgp + sudo: required + services: + - docker + - env: + - TEST=route_server_test2.py DOCKER_IMAGE=gobgp + sudo: required + services: + - docker -go_import_path: github.com/osrg/gobgp +cache: + pip: true -script: - - if [[ "$TRAVIS_GO_VERSION" == "1.5" ]]; then test -z "$(go fmt ./...)"; fi && bash test/scenario_test/ci-scripts/travis-build-script.sh $SCENARIO +go_import_path: github.com/osrg/gobgp notifications: slack: diff --git a/test/scenario_test/ci-scripts/travis-build-script.sh b/test/scenario_test/ci-scripts/travis-build-script.sh index 3ea28407..4fd654db 100644..100755 --- a/test/scenario_test/ci-scripts/travis-build-script.sh +++ b/test/scenario_test/ci-scripts/travis-build-script.sh @@ -1,121 +1,5 @@ +#!/usr/bin/env sh -SCENARIO=$1 echo "travis-build-script.sh" -export GOBGP=`pwd` - -if [ "$SCENARIO" != "true" ]; then - echo "execute unit test." - go version - go test -v ./... || exit "$?" - python $GOBGP/test/scenario_test/ci-scripts/build_embeded_go.py $GOBGP/docs/sources/lib.md - exit $? -fi - -echo "Docker version" -docker version -echo "" - -export GOBGP_IMAGE=gobgp - -sudo apt-get -q update -sudo apt-get -q -y install iputils-arping bridge-utils lv -sudo wget https://raw.github.com/jpetazzo/pipework/master/pipework -O /usr/local/bin/pipework -sudo chmod 755 /usr/local/bin/pipework - -sudo -H pip --quiet install -r $GOBGP/test/pip-requires.txt - -ls -al -git log | head -20 - -sudo fab -f $GOBGP/test/lib/base.py make_gobgp_ctn:tag=$GOBGP_IMAGE -[ "$?" != 0 ] && exit "$?" - -cd $GOBGP/test/scenario_test - -PIDS=() - -sudo PYTHONPATH=$GOBGP/test python route_server_test.py --gobgp-image $GOBGP_IMAGE --test-prefix rs -x & -PIDS=("${PIDS[@]}" $!) - -sudo PYTHONPATH=$GOBGP/test python route_server_test2.py --gobgp-image $GOBGP_IMAGE --test-prefix rs2 -x & -PIDS=("${PIDS[@]}" $!) - -sudo PYTHONPATH=$GOBGP/test python route_server_softreset_test.py --gobgp-image $GOBGP_IMAGE --test-prefix rs3 -x & -PIDS=("${PIDS[@]}" $!) - -sudo PYTHONPATH=$GOBGP/test python route_server_ipv4_v6_test.py --gobgp-image $GOBGP_IMAGE --test-prefix v6 -x & -PIDS=("${PIDS[@]}" $!) - -sudo PYTHONPATH=$GOBGP/test python bgp_router_test.py --gobgp-image $GOBGP_IMAGE --test-prefix bgp -x & -PIDS=("${PIDS[@]}" $!) - -sudo PYTHONPATH=$GOBGP/test python ibgp_router_test.py --gobgp-image $GOBGP_IMAGE --test-prefix ibgp -x & -PIDS=("${PIDS[@]}" $!) - -sudo PYTHONPATH=$GOBGP/test python evpn_test.py --gobgp-image $GOBGP_IMAGE --test-prefix evpn -x & -PIDS=("${PIDS[@]}" $!) - -sudo PYTHONPATH=$GOBGP/test python flow_spec_test.py --gobgp-image $GOBGP_IMAGE --test-prefix flow -x & -PIDS=("${PIDS[@]}" $!) - -sudo PYTHONPATH=$GOBGP/test python route_reflector_test.py --gobgp-image $GOBGP_IMAGE --test-prefix rr -x & -PIDS=("${PIDS[@]}" $!) - -for (( i = 0; i < ${#PIDS[@]}; ++i )) -do - wait ${PIDS[$i]} - if [ $? != 0 ]; then - exit 1 - fi -done - -PIDS=() - -sudo PYTHONPATH=$GOBGP/test python global_policy_test.py --gobgp-image $GOBGP_IMAGE --test-prefix gpol -x & -PIDS=("${PIDS[@]}" $!) - -sudo PYTHONPATH=$GOBGP/test python route_server_as2_test.py --gobgp-image $GOBGP_IMAGE --test-prefix as2 -x & -PIDS=("${PIDS[@]}" $!) - -sudo PYTHONPATH=$GOBGP/test python graceful_restart_test.py --gobgp-image $GOBGP_IMAGE --test-prefix gr -x & -PIDS=("${PIDS[@]}" $!) - -sudo PYTHONPATH=$GOBGP/test python bgp_zebra_test.py --gobgp-image $GOBGP_IMAGE --test-prefix z -x & -PIDS=("${PIDS[@]}" $!) - - -for (( i = 0; i < ${#PIDS[@]}; ++i )) -do - wait ${PIDS[$i]} - if [ $? != 0 ]; then - exit 1 - fi -done - -PIDS=() - -# route server malformed message test -NUM=$(sudo PYTHONPATH=$GOBGP/test python route_server_malformed_test.py --test-index -1 -s 2> /dev/null | awk '/invalid/{print $NF}') -PARALLEL_NUM=10 -for (( i = 1; i < $(( $NUM + 1)); ++i )) -do - sudo PYTHONPATH=$GOBGP/test python route_server_malformed_test.py --gobgp-image $GOBGP_IMAGE --test-prefix mal$i --test-index $i -x --gobgp-log-level debug & - PIDS=("${PIDS[@]}" $!) - sleep 3 -done - -for (( i = 0; i < ${#PIDS[@]}; ++i )) -do - wait ${PIDS[$i]} - if [ $? != 0 ]; then - exit 1 - fi -done - -sudo PYTHONPATH=$GOBGP/test python route_server_policy_test.py --gobgp-image $GOBGP_IMAGE --test-prefix p -x --gobgp-log-level debug - -sudo PYTHONPATH=$GOBGP/test python route_server_policy_grpc_test.py --gobgp-image $GOBGP_IMAGE --test-prefix pg -x --gobgp-log-level debug - -echo 'all tests passed successfully' -exit 0 +sudo PYTHONPATH=test python test/scenario_test/$TEST --gobgp-image $DOCKER_IMAGE -x -s diff --git a/test/scenario_test/ci-scripts/travis-install-script.sh b/test/scenario_test/ci-scripts/travis-install-script.sh new file mode 100755 index 00000000..43b6885f --- /dev/null +++ b/test/scenario_test/ci-scripts/travis-install-script.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env sh + +echo "travis-install-script.sh" + +sudo -H pip --quiet install -r test/pip-requires.txt + +sudo fab -f test/lib/base.py make_gobgp_ctn:tag=$DOCKER_IMAGE |