Initiate packetization of Testing reporting
[releng.git] / utils / test / reporting / docker / reporting.sh
1 #!/bin/bash
2
3 export PYTHONPATH="${PYTHONPATH}:./reporting"
4 export CONFIG_REPORTING_YAML=./reporting/reporting.yaml
5
6 declare -a versions=(danube master)
7 declare -a projects=(functest storperf yardstick qtip)
8
9 project=$1
10 reporting_type=$2
11
12 # create Directories if needed
13 for i in "${versions[@]}"
14 do
15     for j in "${projects[@]}"
16        do
17            mkdir -p display/$i/$j
18        done
19 done
20
21 # copy images, js, css, 3rd_party
22 cp -Rf 3rd_party display
23 cp -Rf css display
24 cp -Rf html/* display
25 cp -Rf img display
26 cp -Rf js display
27
28 # if nothing is precised run all the reporting generation
29 #  projet   |        option
30 #   $1      |          $2
31 # functest  | status, vims, tempest
32 # yardstick | status
33 # storperf  | status
34 # qtip      | status
35
36 function report_project()
37 {
38   project=$1
39   dir=$2
40   type=$3
41   echo "********************************"
42   echo " $project reporting "
43   echo "********************************"
44   python ./reporting/$dir/reporting-$type.py
45   if [ $? ]; then
46     echo "$project reporting $type...OK"
47   else
48     echo "$project reporting $type...KO"
49   fi
50 }
51
52 if [ -z "$1" ]; then
53   echo "********************************"
54   echo " * Static status reporting     *"
55   echo "********************************"
56   for i in "${projects[@]}"
57   do
58     report_project $i $i "status"
59     sleep 5
60   done
61   report_project "QTIP" "qtip" "status"
62
63
64   echo "Functest reporting vIMS..."
65   report_project "functest" "functest" "vims"
66   echo "reporting vIMS...OK"
67   sleep 5
68   echo "Functest reporting Tempest..."
69   report_project "functest" "functest" "tempest"
70   echo "reporting Tempest...OK"
71   sleep 5
72
73 else
74   if [ -z "$2" ]; then
75     reporting_type="status"
76   fi
77   report_project $project $project $reporting_type
78 fi