Don't verify Danube and verify Euphrates
[releng.git] / utils / test / dashboard / install.sh
1 #!/bin/bash
2
3 usage="
4 Script to install dashboard automatically.
5 This script should be run under root.
6
7 usage:
8     bash $(basename "$0") [-h|--help] [-t <test_name>]
9
10 where:
11     -h|--help         show this help text
12     -p|--project      project dashboard
13       <project_name>"
14
15 # Parse parameters
16 while [[ $# > 0 ]]
17     do
18     key="$1"
19     case $key in
20         -h|--help)
21             echo "$usage"
22             exit 0
23             shift
24         ;;
25         -p|--project)
26             PROJECT="$2"
27             shift
28         ;;
29         *)
30             echo "unknown option $1 $2"
31             exit 1
32         ;;
33     esac
34     shift # past argument or value
35 done
36
37 if [[ $(whoami) != "root" ]]; then
38     echo "Error: This script must be run as root!"
39     exit 1
40 fi
41
42 if [ -z ${PROJECT+x} ]; then
43     echo "project must be specified"
44     exit 1
45 fi
46
47 if [ $PROJECT != "functest" ] && [ $PROJECT != "qtip" ];then
48     echo "unsupported project $PROJECT"
49     exit 1
50 fi
51
52 cp -f dashboard/$PROJECT/format.py dashboard/mongo2elastic
53 cp -f dashboard/$PROJECT/testcases.yaml etc/
54 python setup.py install