aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/output_summary.sh
blob: d67f2aa86a71d4aa1aa1935208b824803a4de13d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#!/bin/bash

echo '_____________________________ Results ______________________'
echo ''
echo '************************************************************'
echo '************************************************************'
echo '************ Infrastructure-healthcheck Results ************'
echo '************************************************************'
echo '************************************************************'
if [ -f "./public/$1/infrastructure-healthcheck/k8s/kubernetes-status/onap-k8s.log" ]; then
    echo '--------> onap-k8s'
    grep '>>>' "./public/$1/infrastructure-healthcheck/k8s/kubernetes-status/onap-k8s.log" | tr ',' '\n' | sed 's/>>>/ */; s/\[\([^]]\)/[\'$'\n   - \\1/; s/^[ ]\([^\* ]\)/   - \\1/'
else
    echo '--------> onap-k8s NOT executed'
fi
if [ -f "./public/$1/infrastructure-healthcheck/k8s/onap-helm/onap-helm.log" ]; then
    echo '--------> onap-helm'
    grep '>>>' "./public/$1/infrastructure-healthcheck/k8s/onap-helm/onap-helm.log" | tr ',' '\n' | sed 's/>>>/ */; s/\[\([^]]\)/[\'$'\n   - \\1/; s/^[ ]\([^\* ]\)/   - \\1/'
else
    echo '--------> onap-helm NOT executed'
fi
echo ''
echo '************************************************************'
echo '************************************************************'
echo '********************* Healthcheck Results ******************'
echo '************************************************************'
echo '************************************************************'
if [ -f "./public/$1/xtesting-healthcheck/full/xtesting.log" ]; then
    echo '--------> robot full healthcheck tests'
    sed -n '/xtesting.core.robotframework - INFO - $/,/Output/p' "./public/$1/xtesting-healthcheck/full/xtesting.log"
else
    echo '--------> robot full healthcheck tests NOT executed'
fi
echo ''
echo '************************************************************'
echo '************************************************************'
echo '********************* Basic tests Results ******************'
echo '************************************************************'
echo '************************************************************'
if [ -f "./public/$1/xtesting-healthcheck/healthdist/xtesting.log" ]; then
    echo '--------> healthdist (vFW onboarding and distribution)'
    sed -n '/xtesting.core.robotframework - INFO - $/,/Output/p' "./public/$1/xtesting-healthcheck/healthdist/xtesting.log" | grep '::' | grep '|'
else
    echo '--------> healthdist tests NOT executed'
fi
if [ -f "./public/$1/xtesting-healthcheck/postinstall/xtesting.log" ]; then
    echo '--------> postinstall tests (dmaap and A&AI)'
    sed -n '/xtesting.core.robotframework - INFO - $/,/Output/p' "./public/$1/xtesting-healthcheck/postinstall/xtesting.log" | grep '::' | grep '|'
else
    echo '--------> postinstall tests NOT executed'
fi
if [ -f "./public/$1/xtesting-smoke-usecases-robot/cmpv2/xtesting.log" ]; then
    echo '--------> CMPv2 tests'
    sed -n '/xtesting.core.robotframework - INFO - $/,/Output/p' "./public/$1/xtesting-smoke-usecases-robot/cmpv2/xtesting.log" | grep '::' | grep '|'
else
    echo '--------> CMPv2 tests NOT executed'
fi
if [ -f "./public/$1/xtesting-smoke-usecases-robot/dcaemod/xtesting.log" ]; then
    echo '--------> DCAEMOD tests'
    sed -n '/xtesting.core.robotframework - INFO - $/,/Output/p' "./public/$1/xtesting-smoke-usecases-robot/dcaemod/xtesting.log" |  grep '|'
else
    echo '--------> DCAEMOD tests NOT executed'
fi
if [ -f "./public/$1/xtesting-smoke-usecases-robot/hv-ves/xtesting.log" ]; then
    echo '--------> HV-VES tests'
    sed -n '/xtesting.core.robotframework - INFO - $/,/Output/p' "./public/$1/xtesting-smoke-usecases-robot/hv-ves/xtesting.log" | grep '::' | grep '|'
else
    echo '--------> HV-VES tests NOT executed'
fi
if [ -f "./public/$1/xtesting-smoke-usecases-robot/ves-collector/xtesting.log" ]; then
    echo '--------> VES collector tests'
    sed -n '/xtesting.core.robotframework - INFO - $/,/Output/p' "./public/$1/xtesting-smoke-usecases-robot/ves-collector/xtesting.log" | grep '::' | grep '|'
else
    echo '--------> VES collector tests NOT executed'
fi
if [ -f "./public/$1/smoke-usecases/basic_onboard/xtesting.log" ]; then
    echo "--------> Basic Onboard tests (SDC)"
    NORMAL_RUN=$(grep -A2 RESULT "./public/$1/smoke-usecases/basic_onboard/xtesting.log" | grep basic_onboard | grep -v ERROR | awk {'print $2 ": "  $8 " (" $6 ")"'})
    if [ -z "$NORMAL_RUN" ]
    then
        RESULT=$(tail -n 1 "./public/$1/smoke-usecases/basic_onboard/xtesting.log" | cut -d'-' -f6 | cut -d':' -f 2)
        echo "basic_onboard: $RESULT"
        echo "basic_onboard hasn't finished well, check logs"
    else
        echo "$NORMAL_RUN"
    fi

else
    echo "--------> Basic onboard tests NOT executed"
fi
if [ -f "./public/$1/smoke-usecases/basic_cds/xtesting.log" ]; then
    echo "--------> CDS tests"
    NORMAL_RUN=$(grep -A2 RESULT "./public/$1/smoke-usecases/basic_cds/xtesting.log" | grep basic_cds | grep -v ERROR | awk {'print $2 ": "  $8 " (" $6 ")"'})
    if [ -z "$NORMAL_RUN" ]
    then
        RESULT=$(tail -n 1 "./public/$1/smoke-usecases/basic_cds/xtesting.log" | cut -d'-' -f6 | cut -d':' -f 2)
        echo "basic_cds: $RESULT"
        echo "basic_cds hasn't finished well, check logs"
    else
        echo "$NORMAL_RUN"
    fi
else
    echo "--------> CDS tests NOT executed"
fi
echo ''

echo '************************************************************'
echo '************************************************************'
echo '******************** End to End usecases *******************'
echo '************************************************************'
echo '************************************************************'
for test in pnf-registrate 5gbulkpm;do
    if [ -f "./public/$1/xtesting-smoke-usecases-robot/$test/xtesting.log" ]; then
        echo "--------> $test tests"
        sed -n '/xtesting.core.robotframework - INFO - $/,/Output/p' "./public/$1/xtesting-smoke-usecases-robot/$test/xtesting.log" | grep '::' | grep '|'
    else
        echo "--------> $test tests NOT executed"
    fi
done

for test in basic_vm basic_network basic_cnf basic_vm_macro basic_clamp pnf_macro cds_resource_resolution basic_cnf_macro;do
    if [ -f "./public/$1/smoke-usecases/$test/xtesting.log" ]; then
        echo "--------> $test tests"
        NORMAL_RUN=$(grep -A2 RESULT "./public/$1/smoke-usecases/$test/xtesting.log" |grep $test | grep -v ERROR | awk {'print $2 ": "  $8 " (" $6 ")"'})
        if [ -z "$NORMAL_RUN" ]
        then
            RESULT=$(tail -n 1 "./public/$1/smoke-usecases/$test/xtesting.log" | cut -d'-' -f6 | cut -d':' -f 2)
            echo "$test: $RESULT"
            echo "$test hasn't finished well, check logs"
        else
            echo "$NORMAL_RUN"
        fi
    else
        echo "--------> $test tests NOT executed"
    fi
done
echo ''

echo '************************************************************'
echo '************************************************************'
echo '********************** Security tests **********************'
echo '************************************************************'
echo '************************************************************'
for test in nonssl_endpoints jdpw_ports kube_hunter root_pods unlimitted_pods;do
    if [ -f "./public/$1/security/$test/xtesting.log" ]; then
        echo "--------> $test tests"
        NORMAL_RUN=$(grep -A2 RESULT "./public/$1/security/$test/xtesting.log" |grep $test | grep -v -E -- 'DEBUG|INFO|ERROR' | awk {'print $2 ": "  $8 " (" $6 ")"'})
        if [ -z "$NORMAL_RUN" ]
        then
            RESULT=$(tail -n 1 "./public/$1/security/$test/xtesting.log" | cut -d'-' -f6 | cut -d':' -f 2)
            echo "$test: $RESULT"
            echo "$test hasn't finished well, check logs"
        else
            echo "$NORMAL_RUN"
        fi
    else
        echo "--------> $test tests NOT executed"
    fi
done
echo ''
echo '____________________________________________________________'