Files
kata-containers/tests/metrics/gha-run.sh
David Esparza f152f0e8c3 metrics: Add launch-times to metrics tests
This test measures the duration of a workload that starts, and then
immediately stops the contianer. Also measures the workload period,
the time to quit period, and the time to kernel period.

Fixes: #7049

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
2023-06-19 10:40:16 -06:00

44 lines
884 B
Bash
Executable File

#!/bin/bash
#
# Copyright (c) 2023 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
set -o errexit
set -o nounset
set -o pipefail
metrics_dir="$(dirname "$(readlink -f "$0")")"
source "${metrics_dir}/lib/common.bash"
function init_env() {
metrics_onetime_init
disable_ksm
}
function run_test_launchtimes() {
hypervisor="${1}"
echo "Running launchtimes tests: "
init_env
if [ "${hypervisor}" = 'qemu' ]; then
echo "qemu"
bash time/launch_times.sh -i public.ecr.aws/ubuntu/ubuntu:latest -n 20
elif [ "${hypervisor}" = 'clh' ]; then
echo "clh"
fi
}
function main() {
action="${1:-}"
case "${action}" in
run-test-launchtimes-qemu) run_test_launchtimes "qemu" ;;
run-test-launchtimes-clh) run_test_launchtimes "clh" ;;
*) >&2 echo "Invalid argument"; exit 2 ;;
esac
}
main "$@"