add united test suite entrance script
[bottlenecks.git] / ci / common.sh
1 #!/bin/bash
2
3 # All rights reserved. This program and the accompanying materials
4 # are made available under the terms of the Apache License, Version 2.0
5 # which accompanies this distribution, and is available at
6 # http://www.apache.org/licenses/LICENSE-2.0
7 #
8
9 mkdir -p /home/opnfv/bottlenecks/config
10 config_file=/home/opnfv/functest/config/bottlenecks_cfg.yaml
11
12 if [ ! -f ${config_file} ]; then
13     default_config_file=$(find /home/opnfv/repos -name bottlenecks_cfg.yaml)
14     cp $default_config_file $config_file
15     echo "bottlenecks_cfg.yaml not provided. Using default one"
16 fi
17
18 SUITE_PREFIX_CONFIG=$(cat $config_file | grep -w suite_prefix_config | awk 'END {print $NF}')
19
20 info () {
21     logger -s -t "bottlenecks.info" "$*"
22 }
23
24 error () {
25     logger -s -t "bottlenecks.error" "$*"
26     exit 1
27 }