Merge "add memory_load scenario"
[yardstick.git] / tests / ci / docker / yardstick-ci / run_tests.sh
1 #!/bin/bash
2 ##############################################################################
3 # Copyright (c) 2015 Ericsson AB and others.
4 #
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10
11 set -e
12
13 : ${YARDSTICK_REPO:='https://gerrit.opnfv.org/gerrit/yardstick'}
14 : ${YARDSTICK_REPO_DIR:='/home/opnfv/yardstick'}
15 : ${YARDSTICK_BRANCH:='master'} # branch, tag, sha1 or refspec
16
17 : ${RELENG_REPO:='https://gerrit.opnfv.org/gerrit/releng'}
18 : ${RELENG_REPO_DIR:='/home/opnfv/repos/releng'}
19 : ${RELENG_BRANCH:='master'} # branch, tag, sha1 or refspec
20
21 git_checkout()
22 {
23     if git cat-file -e $1^{commit} 2>/dev/null; then
24         # branch, tag or sha1 object
25         git checkout $1
26     else
27         # refspec / changeset
28         git fetch --tags --progress $2 $1
29         git checkout FETCH_HEAD
30     fi
31 }
32
33 echo
34 echo "INFO: Updating releng -> $RELENG_BRANCH"
35 if [ ! -d $RELENG_REPO_DIR ]; then
36     git clone $RELENG_REPO $RELENG_REPO_DIR
37 fi
38 cd $RELENG_REPO_DIR
39 git checkout master && git pull
40 git_checkout $RELENG_BRANCH $RELENG_REPO
41
42 echo
43 echo "INFO: Updating yardstick -> $YARDSTICK_BRANCH"
44 if [ ! -d $YARDSTICK_REPO_DIR ]; then
45     git clone $YARDSTICK_REPO $YARDSTICK_REPO_DIR
46 fi
47 cd $YARDSTICK_REPO_DIR
48 git checkout master && git pull
49 git_checkout $YARDSTICK_BRANCH $YARDSTICK_REPO
50
51 # setup the environment
52 source $YARDSTICK_REPO_DIR/tests/ci/prepare_env.sh
53
54 # run tests
55 $YARDSTICK_REPO_DIR/tests/ci/yardstick-verify $@