mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-18 06:44:23 +01:00
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>
44 lines
884 B
Bash
Executable File
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 "$@"
|