stability: General improvements for soak parallel test

This PR has better variable definitons as well the use of a variable
which is already defined in the metrics common script for soak parallel
test.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
This commit is contained in:
Gabriela Cervantes 2024-07-04 16:32:46 +00:00
parent 6d56abbdad
commit 757f37d956
2 changed files with 5 additions and 5 deletions

View File

@ -40,13 +40,13 @@ function main() {
local not_started_count="${NUM_CONTAINERS}"
clean_env_ctr
sudo -E ctr i pull "${IMAGE}"
sudo -E "${CTR_EXE}" i pull "${IMAGE}"
info "Creating ${NUM_CONTAINERS} containers"
for ((i=1; i<= "${NUM_CONTAINERS}"; i++)); do
containers+=($(random_name))
sudo -E ctr run -d --runtime "${CTR_RUNTIME}" "${IMAGE}" "${containers[-1]}" sh -c "${PAYLOAD_ARGS}"
sudo -E "${CTR_EXE}" run -d --runtime "${CTR_RUNTIME}" "${IMAGE}" "${containers[-1]}" sh -c "${PAYLOAD_ARGS}"
((not_started_count--))
info "$not_started_count remaining containers"
done

View File

@ -53,7 +53,7 @@ function check_vsock_active() {
}
function count_containers() {
sudo ctr c list -q | wc -l
sudo "${CTR_EXE}" c list -q | wc -l
}
function check_all_running() {
@ -124,7 +124,7 @@ function go() {
local i
for ((i=1; i<= ${MAX_CONTAINERS}; i++)); do
containers+=($(random_name))
sudo ctr run --runtime=${CTR_RUNTIME} -d ${nginx_image} ${containers[-1]} sh -c ${COMMAND}
sudo "${CTR_EXE}" run --runtime="${CTR_RUNTIME}" -d "${nginx_image}" "${containers[-1]}" sh -c "${COMMAND}"
((how_many++))
done
@ -177,7 +177,7 @@ function init() {
nginx_image="docker.io/library/nginx:$nginx_version"
# Pull nginx image
sudo ctr image pull ${nginx_image}
sudo "${CTR_EXE}" image pull "${nginx_image}"
if [ $? != 0 ]; then
die "Unable to retry docker image ${nginx_image}"
fi