added the role swiftoperator as functest tempest test case
[joid.git] / ci / tools.sh
1 ##############################################################################
2 # Copyright (c) 2017 Nokia and others.
3 #
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9
10 # include only once
11 [ ! -z "$_tools_included" ] && return || readonly _tools_included=true
12
13 #######################################
14 # Echo printing in yellow bold color
15 # Arguments:
16 #   Same as for echo
17 # Returns:
18 #   None
19 #######################################
20 function echo_info { (
21     # don't clutter the script output with the xtrace of the echo command
22     { set +x; } 2> /dev/null
23
24     yellow_bold='\033[1;33m'
25     color_off='\033[0m'
26     echo "${@:1:($#-1)}" -e "$yellow_bold${@: -1}$color_off";
27   )
28 }
29
30 #######################################
31 # Echo error (to stderr)
32 # Arguments:
33 #   Same as for echo
34 # Returns:
35 #   None
36 #######################################
37 function echo_error { (
38     # don't clutter the script output with the xtrace of the echo command
39     { set +x; } 2> /dev/null
40
41     red_bold='\033[1;31m'
42     color_off='\033[0m'
43     >&2 echo "${@:1:($#-1)}" -e "$red_bold${@: -1}$color_off";
44   )
45 }
46
47 #######################################
48 # Echo warning (to stderr)
49 # Arguments:
50 #   Same as for echo
51 # Returns:
52 #   None
53 #######################################
54 function echo_warning { (
55     # don't clutter the script output with the xtrace of the echo command
56     { set +x; } 2> /dev/null
57
58     red_italic='\033[3;91m'
59     color_off='\033[0m'
60     >&2 echo "${@:1:($#-1)}" -e "$red_italic${@: -1}$color_off";
61   )
62 }