tests: metrics: Move metrics specific function to metrics gha-run.sh

`compress_metrics_results_dir()` is only used by the metrics GHA.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
Fabiano Fidêncio 2023-07-12 20:56:55 +02:00
parent 3ffd48bc16
commit bd08d745f4
2 changed files with 14 additions and 14 deletions

View File

@ -241,20 +241,6 @@ function restart_containerd_service() {
return 0 return 0
} }
# @path_results: path to the input metric-results folder
# @tarball_fname: path and filename to the output tarball
function compress_metrics_results_dir()
{
local path_results="${1:-results}"
local tarball_fname="${2:-}"
[ -z "${tarball_fname}" ] && die "Missing the tarball filename or the path to save the tarball results is incorrect."
[ ! -d "${path_results}" ] && die "Missing path to the results folder."
cd "${path_results}" && tar -czf "${tarball_fname}" *.json && cd -
info "tarball generated: ${tarball_fname}"
}
function create_symbolic_links() { function create_symbolic_links() {
local KATA_HYPERVISOR="${1}" local KATA_HYPERVISOR="${1}"

View File

@ -26,6 +26,20 @@ function install_checkmetrics() {
popd popd
} }
# @path_results: path to the input metric-results folder
# @tarball_fname: path and filename to the output tarball
function compress_metrics_results_dir()
{
local path_results="${1:-results}"
local tarball_fname="${2:-}"
[ -z "${tarball_fname}" ] && die "Missing the tarball filename or the path to save the tarball results is incorrect."
[ ! -d "${path_results}" ] && die "Missing path to the results folder."
cd "${path_results}" && tar -czf "${tarball_fname}" *.json && cd -
info "tarball generated: ${tarball_fname}"
}
function check_metrics() { function check_metrics() {
local cm_base_file="${checkmetrics_config_dir}/checkmetrics-json-${KATA_HYPERVISOR}-kata-metric8.toml" local cm_base_file="${checkmetrics_config_dir}/checkmetrics-json-${KATA_HYPERVISOR}-kata-metric8.toml"
checkmetrics --debug --percentage --basefile "${cm_base_file}" --metricsdir "${results_dir}" checkmetrics --debug --percentage --basefile "${cm_base_file}" --metricsdir "${results_dir}"