-# Copyright (c) 2021 Cisco and/or its affiliates.
-# Copyright (c) 2021 PANTHEON.tech s.r.o.
+# Copyright (c) 2023 Cisco and/or its affiliates.
+# Copyright (c) 2023 PANTHEON.tech s.r.o.
# 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:
cd "${VPP_DIR}" || die "Change directory command failed."
TARGET="$(readlink -f "$1")"
mkdir -p "${TARGET}" || die "Directory creation failed."
- file_list=("output.xml" "log.html" "report.html")
- file_list+=("tests" "tests_output_raw.tar.xz")
+ file_list=("output.xml" "log.html" "report.html" "tests")
for filename in "${file_list[@]}"; do
mv "${ARCHIVE_DIR}/${filename}" "${TARGET}/${filename}" || {
die "Attempt to move '${filename}' failed."
}
-function archive_parse_test_results () {
-
- # Arguments:
- # - ${1}: Directory to archive to. Required. Parent has to exist.
- # Variables read:
- # - TARGET - Target directory.
- # Functions called:
- # - die - Print to stderr and exit, defined in common.sh
- # - archive_test_results - Archiving results.
- # - parse_bmrr_results - See definition in this file.
-
- set -exuo pipefail
-
- archive_test_results "$1" || die
- parse_bmrr_results "${TARGET}" || {
- die "The function should have died on error."
- }
-}
-
-
function build_vpp_ubuntu_amd64 () {
# This function is using make pkg-verify to build VPP with all dependencies
# of parent build.
# Functions called:
# - die - Print to stderr and exit, defined in common.sh
- # - parse_bmrr_results - See definition in this file.
# Exit code:
# - 0 - If the comparison utility sees no regression (nor data error).
# - 1 - If the comparison utility sees a regression (or data error).
}
-function parse_bmrr_results () {
-
- # Currently "parsing" is just two greps.
- # TODO: Re-use PAL parsing code, make parsing more general and centralized.
- #
- # Arguments:
- # - ${1} - Path to (existing) directory holding robot output.xml result.
- # Files read:
- # - output.xml - From argument location.
- # Files updated:
- # - results.txt - (Re)created, in argument location.
- # Functions called:
- # - die - Print to stderr and exit, defined in common.sh
-
- set -exuo pipefail
-
- rel_dir="$(readlink -e "${1}")" || die "Readlink failed."
- in_file="${rel_dir}/output.xml"
- out_file="${rel_dir}/results.txt"
- # TODO: Do we need to check echo exit code explicitly?
- echo "Parsing ${in_file} putting results into ${out_file}"
- echo "TODO: Re-use parts of PAL when they support subsample test parsing."
- pattern='Maximum Receive Rate trial results in packets'
- pattern+=' per second: .*\]</status>'
- grep -o "${pattern}" "${in_file}" | grep -o '\[.*\]' > "${out_file}" || {
- die "Some parsing grep command has failed."
- }
-}
-
-
function select_build () {
# Arguments: