summaryrefslogtreecommitdiffstats
path: root/integration/src/main/scripts/reports
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2022-06-17 10:44:27 +0100
committerliamfallon <liam.fallon@est.tech>2022-06-17 10:47:38 +0100
commitcd44921c7e00e699b27697d3e5be4fc3433b81a2 (patch)
treeb06c916c12e9075571f51b1978105357bb81900d /integration/src/main/scripts/reports
parentb3223fd59ea60d98948e23073833a010c027a8a2 (diff)
Restructure scripts in policy-parent
- Moved the scripts into src/main/scripts - created src/main/resources - added pf_release_data.csv to src/main/resources, this file will be - added a n ew release phase to release the mdoels-simulator image pf_release_data.sh: Used to find the correct versions of images to use for the CSIT tests, the current lookup scripts can't cope with snapshots being deleted after they time out. Issue-ID: POLICY-4233 Change-Id: Idb5a4a624c06114f0f480c599e87f5596705ea07 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'integration/src/main/scripts/reports')
-rwxr-xr-xintegration/src/main/scripts/reports/pf_status_report.sh120
1 files changed, 120 insertions, 0 deletions
diff --git a/integration/src/main/scripts/reports/pf_status_report.sh b/integration/src/main/scripts/reports/pf_status_report.sh
new file mode 100755
index 00000000..c979066c
--- /dev/null
+++ b/integration/src/main/scripts/reports/pf_status_report.sh
@@ -0,0 +1,120 @@
+#!/bin/bash
+
+# ============LICENSE_START================================================
+# ONAP
+# =========================================================================
+# Copyright (C) 2022 Nordix Foundation.
+# =========================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ============LICENSE_END==================================================
+#
+
+function health_check() {
+ health_dir="$1"
+
+ health_report_temp_file=$(mktemp)
+
+ report_month=$( \
+ curl -s "https://logs.onap.org/onap-integration/daily/$health_dir"/ | \
+ grep href | \
+ sort | \
+ tail -1 | \
+ sed -e 's/^.*href="//' \
+ -e 's/\/".*$//'
+ )
+
+ report_last_health=$( \
+ curl -s "https://logs.onap.org/onap-integration/daily/$health_dir/$report_month/" | \
+ grep href | \
+ sort | \
+ tail -1 | \
+ sed -e 's/^.*href="//' \
+ -e 's/\/".*$//'
+ )
+
+ curl -s --output "$health_report_temp_file" \
+ "https://logs.onap.org/onap-integration/daily/$health_dir/$report_month/$report_last_health/xtesting-healthcheck/full/full/report.html"
+ health_check_result=$(
+ gunzip -c "$health_report_temp_file" | \
+ grep 'window.output\["stats"\]' | \
+ sed 's/},{/}\n{/g' | \
+ grep health-policy | \
+ sed -e 's/{//g' \
+ -e 's/}//g' \
+ -e 's/"//g' \
+ -e 's/label://' | \
+ awk -F',' '{printf("%s,%s,%s\n", $3,$4,$2)}'
+ )
+
+ report_day="${report_last_health%%_*}"
+ report_hour_minute="${report_last_health#*_}"
+ report_hour_minute="${report_hour_minute/-/:}"
+ echo "$health_dir,$report_month-$report_day $report_hour_minute,$health_check_result"
+}
+
+echo ""
+echo "health checks"
+echo "-------------"
+
+health_check onap-daily-dt-oom-master
+health_check onap-daily-dt-oom-jakarta
+health_check onap-daily-dt-oom-istanbul
+health_check onap_daily_pod4_master
+
+jenkins_report_temp_file=$(mktemp)
+
+curl -s https://jenkins.onap.org/view/policy/ | \
+ sed -e 's/<tr id=/\n<tr id=/g' \
+ -e 's/><td data=/\n><td data=/g' | \
+ grep 'tr id=' | \
+ sed -e 's/"//g' \
+ -e 's/<tr id=//' \
+ -e 's/class= //' > "$jenkins_report_temp_file"
+
+echo ""
+echo "failing jobs"
+echo "------------"
+
+grep "job-status-red" "$jenkins_report_temp_file" | \
+ grep -v stage |
+ cut -f1 -d' '
+
+echo ""
+echo "warning jobs"
+echo "------------"
+
+grep "job-status-yellow" "$jenkins_report_temp_file" | \
+ grep -v clm |
+ cut -f1 -d' '
+
+echo ""
+echo "invalid jobs"
+echo "------------"
+grep -v -E "(blue|red|yellow|verify|merge)" "$jenkins_report_temp_file" | \
+ cut -f1 -d' '
+
+echo ""
+echo "bugs"
+echo "----"
+curl -s https://jira.onap.org/issues/?jql=PROJECT%20%3D%20POLICY%20AND%20issuetype%20%3D%20Bug%20AND%20status%20!%3D%20Closed%20ORDER%20BY%20key%20ASC \ |
+ grep 'data-issue-table-model-state' | \
+ sed -e 's/&quot/\"/g' \
+ -e 's/.*";jiraHasIssues";:true,";page";:[0-9]*,";pageSize";:[0-9]*,";startIndex";:[0-9]*,";table";:\[//' \
+ -e 's/,";title";:";";,";total";:[0-9]*,";url";:";";,";sortBy";:\].*$//' \
+ -e 's/}}/}}\n/g' | \
+ grep 'POLICY-' | \
+ sed -e 's/^.*key=/key=/g' \
+ -e 's/";:";/=/g' \
+ -e 's/";,";/,/g' \
+ -e 's/^.*key=/key=/g' \
+ -e 's/";:{";description=.*$//'