diff options
author | fumihiko kakuma <kakuma@valinux.co.jp> | 2016-10-28 09:10:19 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-10-29 06:27:54 +0900 |
commit | 76061634a00d3f7fd541c8fe7fba86f1620005ab (patch) | |
tree | 571e114409c0f808adca4913ccbc74ac99db05c8 | |
parent | cd068e53ea44eea05ffde1baf5140e69ddc764b0 (diff) |
Add scripts which install a dependency package
These install packages depended on a scenario test tool.
Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
3 files changed, 93 insertions, 0 deletions
diff --git a/ryu/tests/integrated/common/install_docker_test_pkg.sh b/ryu/tests/integrated/common/install_docker_test_pkg.sh new file mode 100644 index 00000000..a771dfc1 --- /dev/null +++ b/ryu/tests/integrated/common/install_docker_test_pkg.sh @@ -0,0 +1,43 @@ +#!/bin/bash +set -ex + +RYU_PATH=`dirname $0` + +source ${RYU_PATH}/install_docker_test_pkg_common.sh + +function add_docker_aptline { + sudo apt-get update + if ! apt-cache search docker-engine | grep docker-engine; then + VER=`lsb_release -r` + if echo $VER | grep 12.04; then + REL_NAME=precise + elif echo $VER | grep 14.04; then + REL_NAME=trusty + elif echo $VER | grep 15.10; then + REL_NAME=wily + elif echo $VER | grep 16.04; then + REL_NAME=xenial + else + retrun 1 + fi + RELEASE=ubuntu-$REL_NAME + sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D + sudo sh -c "echo deb https://apt.dockerproject.org/repo $RELEASE main > /etc/apt/sources.list.d/docker.list" + fi +} + +init_variables +process_options "$@" + +if [ $APTLINE_DOCKER -eq 1 ]; then + add_docker_aptline +fi + +sudo apt-get update +if apt-cache search docker-engine | grep docker-engine; then + DOCKER_PKG=docker-engine +else + DOCKER_PKG=docker.io +fi +sudo apt-get install -y $DOCKER_PKG +install_depends_pkg diff --git a/ryu/tests/integrated/common/install_docker_test_pkg_common.sh b/ryu/tests/integrated/common/install_docker_test_pkg_common.sh new file mode 100644 index 00000000..3a54c4c7 --- /dev/null +++ b/ryu/tests/integrated/common/install_docker_test_pkg_common.sh @@ -0,0 +1,37 @@ +#!/bin/bash +set -ex + +function init_variables { + APTLINE_DOCKER=0 + DIR_BASE=/tmp + SUDO_PIP="" +} + +function process_options { + local max + local i + max=$# + i=1 + while [ $i -le $max ]; do + case "$1" in + -a|--add-docker-aptline) + APTLINE_DOCKER=1 + ;; + -d|--download-dir) + shift; ((i++)) + DIR_BASE=$1 + ;; + -s|--sudo-pip) + SUDO_PIP=sudo + ;; + esac + shift; ((i++)) + done +} + +function install_depends_pkg { + sudo rm -rf $DIR_BASE/pipework + git clone https://github.com/jpetazzo/pipework.git $DIR_BASE/pipework + sudo install -m 0755 $DIR_BASE/pipework/pipework /usr/local/bin/pipework + $SUDO_PIP pip install docker-py pycrypto nsenter +} diff --git a/ryu/tests/integrated/common/install_docker_test_pkg_for_travis.sh b/ryu/tests/integrated/common/install_docker_test_pkg_for_travis.sh new file mode 100644 index 00000000..9128c777 --- /dev/null +++ b/ryu/tests/integrated/common/install_docker_test_pkg_for_travis.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -ex + +RYU_PATH=`dirname $0` + +source ${RYU_PATH}/install_docker_test_pkg_common.sh + +init_variables +process_options "$@" +SUDO_PIP="" + +sudo apt-get update +install_depends_pkg |