diff --git a/tests/common.bash b/tests/common.bash index cffec13045..046ae694e1 100644 --- a/tests/common.bash +++ b/tests/common.bash @@ -176,11 +176,6 @@ function extract_kata_env() { RUNTIME_PATH="$(echo "${kata_env}" | jq -r ${runtime_path})" SHARED_FS="$(echo "${kata_env}" | jq -r ${shared_fs})" - # get_kata_memory_and_vcpus() function measures the memory and the number of vcpus - # from a kata container, and saves these values ​​in the variables: - # 'MEASURED_CONTAINER_NUM_VCPUS' and 'MEASURED_CONTAINER_TOTAL_MEM' - get_kata_memory_and_vcpus - # get the requested memory and num of vcpus from the kata config file. config_content="$(cat ${RUNTIME_CONFIG_PATH} | grep -vE "^#")" REQ_MEMORY="$(echo "${config_content}" | grep -i default_memory | cut -d "=" -f2 | awk '{print $1}')" diff --git a/tests/metrics/lib/json.bash b/tests/metrics/lib/json.bash index e2705cfba7..a1033c7723 100755 --- a/tests/metrics/lib/json.bash +++ b/tests/metrics/lib/json.bash @@ -43,6 +43,11 @@ function metrics_json_init() { despaced_name="$(echo ${TEST_NAME} | sed 's/[ \/]/-/g')" json_filename="${RESULT_DIR}/${despaced_name}.json" + # get_kata_memory_and_vcpus() function measures the memory and the number of vcpus + # from a kata container, and saves these values ​​in the variables: + # 'MEASURED_CONTAINER_NUM_VCPUS' and 'MEASURED_CONTAINER_TOTAL_MEM' + get_kata_memory_and_vcpus + local json="$(cat << EOF "@timestamp" : $(timestamp_ms) EOF