1
0
mirror of https://github.com/kata-containers/kata-containers.git synced 2025-05-11 01:46:30 +00:00

tests: Use variable already defined in stability tests

This PR uses the CTR_EXE which is already defined in the metrics common
script to have uniformity across the multiple stability tests.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
This commit is contained in:
Gabriela Cervantes 2024-07-04 16:21:24 +00:00
parent ddb8a94677
commit 3e6c32c3c8

View File

@ -18,27 +18,27 @@ function main() {
init_env
check_cmds "${cmds[@]}"
sudo -E ctr run -d --runtime "${CTR_RUNTIME}" "${IMAGE}" "${CONTAINER_NAME}" sh -c "${PAYLOAD_ARGS}"
sudo -E "${CTR_EXE}" run -d --runtime "${CTR_RUNTIME}" "${IMAGE}" "${CONTAINER_NAME}" sh -c "${PAYLOAD_ARGS}"
# Run 1 iomix stressor (mix of I/O operations) for 20 seconds with verbose output
info "Running iomix stressor test"
IOMIX_CMD="stress-ng --iomix 1 -t 20 -v"
sudo -E ctr t exec --exec-id "$(random_name)" "${CONTAINER_NAME}" sh -c "${IOMIX_CMD}"
sudo -E "${CTR_EXE}" t exec --exec-id "$(random_name)" "${CONTAINER_NAME}" sh -c "${IOMIX_CMD}"
# Run cpu stressors and virtual memory stressors for 5 minutes
info "Running memory stressors for 5 minutes"
MEMORY_CMD="stress-ng --cpu 2 --vm 4 -t 5m"
sudo -E ctr t exec --exec-id "$(random_name)" "${CONTAINER_NAME}" sh -c "${MEMORY_CMD}"
sudo -E "${CTR_EXE}" t exec --exec-id "$(random_name)" "${CONTAINER_NAME}" sh -c "${MEMORY_CMD}"
# Test floating point on CPU for 60 seconds
info "Running floating tests on CPU"
FLOAT_CMD="stress-ng --matrix 1 -t 1m"
sudo -E ctr t exec --exec-id "$(random_name)" "${CONTAINER_NAME}" sh -c "${FLOAT_CMD}"
sudo -E "${CTR_EXE}" t exec --exec-id "$(random_name)" "${CONTAINER_NAME}" sh -c "${FLOAT_CMD}"
# Runs two instances of the CPU stressors, one instance of the matrix
info "Running instances of the CPU stressors"
INSTANCE_CMD='stress-ng --cpu 2 --matrix 1 --mq 3 -t 3m'
sudo -E ctr t exec --exec-id "$(random_name)" "${CONTAINER_NAME}" sh -c "${INSTANCE_CMD}"
sudo -E "${CTR_EXE}" t exec --exec-id "$(random_name)" "${CONTAINER_NAME}" sh -c "${INSTANCE_CMD}"
clean_env_ctr
}