From bdd42e03b0e8ce99888d8ead6a622113af6d2ab5 Mon Sep 17 00:00:00 2001 From: MatthewLi Date: Mon, 11 Apr 2016 22:27:16 -0400 Subject: unit ci docker test entrance for different test suites JIRA: BOTTLENECK-48 Change-Id: I317c374166c51612be2aaa934738c9c50068c6b1 Signed-off-by: MatthewLi --- ci/docker/Dockerfile | 2 +- ci/docker_run.sh | 36 ++++++++++++++++++++++++++++++++++++ ci/rubbos_docker_run.sh | 36 ------------------------------------ ci/run.sh | 3 +-- 4 files changed, 38 insertions(+), 39 deletions(-) create mode 100755 ci/docker_run.sh delete mode 100755 ci/rubbos_docker_run.sh (limited to 'ci') diff --git a/ci/docker/Dockerfile b/ci/docker/Dockerfile index bb6d64ef..217c1361 100644 --- a/ci/docker/Dockerfile +++ b/ci/docker/Dockerfile @@ -8,7 +8,6 @@ ############################################################################## FROM ubuntu:14.04 -MAINTAINER Qi Liang LABEL image=opnfv/bottlenecks @@ -19,6 +18,7 @@ ENV REPOS_DIR /home/opnfv ENV BOTTLENECKS_REPO_DIR ${REPOS_DIR}/bottlenecks ENV RELENG_REPO_DIR ${REPOS_DIR}/releng +#new test suite required packages can be added here RUN apt-get update && apt-get install -y \ curl \ wget \ diff --git a/ci/docker_run.sh b/ci/docker_run.sh new file mode 100755 index 00000000..89300d4f --- /dev/null +++ b/ci/docker_run.sh @@ -0,0 +1,36 @@ +#!/bin/bash +############################################################################## +# Copyright (c) 2015 Huawei Technologies Co.,Ltd and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +set -ex + +docker build -t opnfv/bottlenecks ${BOTTLENECKS_TOP_DIR}/ci/docker/ + +if [ x"${GERRIT_REFSPEC_DEBUG}" != x ]; then + opts="--privileged=true" + BOTTLENECKS_BRANCH=${GERRIT_REFSPEC_DEBUG} +else + opts="--privileged=true --rm" + BOTTLENECKS_BRANCH=${GIT_BRANCH##origin/} +fi + +envs="-e INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} -e NODE_NAME=${NODE_NAME} -e EXTERNAL_NET=${EXTERNAL_NETWORK} -e BOTTLENECKS_BRANCH=${BOTTLENECKS_BRANCH} -e GERRIT_REFSPEC_DEBUG=${GERRIT_REFSPEC_DEBUG} -e BOTTLENECKS_DB_TARGET=${BOTTLENECKS_DB_TARGET} -e PACKAGE_URL=${PACKAGE_URL}" +volumes="-v ${BOTTLENECKS_TOP_DIR}:${BOTTLENECKS_TOP_DIR}" +run_testsuite=${BOTTLENECKS_TOP_DIR}/run_tests.sh -s ${SUITE_NAME} + +echo ${envs} ${ops} ${volumes} + +# Run docker +cmd="sudo docker run ${opts} ${envs} ${volumes} opnfv/bottlenecks ${run_testsuite}" +echo "Bottlenecks: Running docker cmd: ${cmd}" +${cmd} + +echo "Bottlenecks: done!" + +set +ex diff --git a/ci/rubbos_docker_run.sh b/ci/rubbos_docker_run.sh deleted file mode 100755 index 2eb3e16c..00000000 --- a/ci/rubbos_docker_run.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -############################################################################## -# Copyright (c) 2015 Huawei Technologies Co.,Ltd and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - -set -ex - -docker build -t opnfv/bottlenecks ${BOTTLENECKS_TOP_DIR}/ci/docker/ - -if [ x"${GERRIT_REFSPEC_DEBUG}" != x ]; then - opts="--privileged=true" - BOTTLENECKS_BRANCH=${GERRIT_REFSPEC_DEBUG} -else - opts="--privileged=true --rm" - BOTTLENECKS_BRANCH=${GIT_BRANCH##origin/} -fi - -envs="-e INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} -e NODE_NAME=${NODE_NAME} -e EXTERNAL_NET=${EXTERNAL_NETWORK} -e BOTTLENECKS_BRANCH=${BOTTLENECKS_BRANCH} -e GERRIT_REFSPEC_DEBUG=${GERRIT_REFSPEC_DEBUG} -e BOTTLENECKS_DB_TARGET=${BOTTLENECKS_DB_TARGET} -e PACKAGE_URL=${PACKAGE_URL}" -volumes="-v ${BOTTLENECKS_TOP_DIR}:${BOTTLENECKS_TOP_DIR}" -run_rubbos_testsuite=${BOTTLENECKS_TOP_DIR}/run_tests.sh -s rubbos - -echo ${envs} ${ops} ${volumes} - -# Run docker -cmd="sudo docker run ${opts} ${envs} ${volumes} opnfv/bottlenecks ${run_rubbos_testsuite}" -echo "Bottlenecks: Running docker cmd: ${cmd}" -${cmd} - -echo "Bottlenecks: done!" - -set +ex diff --git a/ci/run.sh b/ci/run.sh index a507df08..6572bfa5 100755 --- a/ci/run.sh +++ b/ci/run.sh @@ -14,7 +14,6 @@ SCRIPT_DIR=`cd ${BASH_SOURCE[0]%/*};pwd` export BOTTLENECKS_TOP_DIR=$SCRIPT_DIR/../ export GERRIT_REFSPEC_DEBUG=$1 -$SCRIPT_DIR/rubbos_docker_run.sh +$SCRIPT_DIR/docker_run.sh set +ex - -- cgit 1.2.3-korg