tests: Add general stability fixes

This PR adds general stability fixes.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
This commit is contained in:
Gabriela Cervantes 2023-10-02 16:17:31 +00:00
parent fd19f4082f
commit 6339605a14
3 changed files with 14 additions and 13 deletions

7
tests/stability/agent_stability_test.sh Normal file → Executable file
View File

@ -34,8 +34,9 @@ function setup {
}
function exec_loop {
cmd="sudo ctr t exec --exec-id 1 $CONTAINER_NAME sh -c"
cmd="sudo ctr t exec --exec-id $(random_name) $CONTAINER_NAME sh -c"
$cmd "echo 'hello world' > file"
$cmd "ls /file"
$cmd "rm -rf /file"
$cmd "touch /tmp/execWorks"
$cmd "ls /tmp | grep execWorks"
@ -51,10 +52,10 @@ function teardown {
}
trap teardown EXIT
echo "Starting stability test"
info "Starting stability test"
setup
echo "Running stability test"
info "Running stability test"
while [[ $end_time > $(date +%s) ]]; do
exec_loop
done

View File

@ -26,16 +26,16 @@ function main() {
sudo -E "${CTR_EXE}" i import "${DOCKER_IMAGE}.tar"
sudo -E "${CTR_EXE}" run -d --runtime "${CTR_RUNTIME}" "${IMAGE}" "${CONTAINER_NAME}" sh -c "${PAYLOAD_ARGS}"
sudo -E "${CTR_EXE}" t exec --exec-id 1 "${CONTAINER_NAME}" sh -c "${CMD}"
sudo -E "${CTR_EXE}" t exec --exec-id "$(random_name)" "${CONTAINER_NAME}" sh -c "${CMD}"
info "Write one million rows"
local WRITE_CMD="./opt/cassandra/tools/bin/cassandra-stress write n=1000000 -rate threads=50"
sudo -E "${CTR_EXE}" t exec --exec-id 2 "${CONTAINER_NAME}" sh -c "${WRITE_CMD}"
sudo -E "${CTR_EXE}" t exec --exec-id "$(random_name)" "${CONTAINER_NAME}" sh -c "${WRITE_CMD}"
info "Load one row with default schema"
local CQL_WRITE_CMD="./opt/cassandra/tools/bin/cassandra-stress write n=1 c1=one -mode native cql3 -log file-create_schema.log"
sudo -E "${CTR_EXE}" t exec --exec-id 3 "${CONTAINER_NAME}" sh -c "${CQL_WRITE_CMD}"
sudo -E "${CTR_EXE}" t exec --exec-id "$(random_name)" "${CONTAINER_NAME}" sh -c "${CQL_WRITE_CMD}"
info "Run a write workload using CQL"
local REAL_WRITE_CMD="./opt/cassandra/tools/bin/cassandra-stress write n=1000000 cl=one -mode native cql3 -schema keyspace='keyspace1' -log file=load_1M_rows.log"
sudo -E "${CTR_EXE}" t exec --exec-id 4 "${CONTAINER_NAME}" sh -c "${REAL_WRITE_CMD}"
sudo -E "${CTR_EXE}" t exec --exec-id "$(random_name)" "${CONTAINER_NAME}" sh -c "${REAL_WRITE_CMD}"
clean_env_ctr
}

View File

@ -26,32 +26,32 @@ function main() {
# 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 1 "${CONTAINER_NAME}" sh -c "${IOMIX_CMD}"
sudo -E ctr 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 2 "${CONTAINER_NAME}" sh -c "${MEMORY_CMD}"
sudo -E ctr t exec --exec-id "$(random_name)" "${CONTAINER_NAME}" sh -c "${MEMORY_CMD}"
# Run shared memory stressors
info "Running 8 shared memory stressors"
SHARED_CMD="stress-ng --shm 0"
sudo -E ctr t exec --exec-id 3 "${CONTAINER_NAME}" sh -c "${SHARED_CMD}"
sudo -E ctr t exec --exec-id "$(random_name)" "${CONTAINER_NAME}" sh -c "${SHARED_CMD}"
# Run all stressors one by one on all CPUs
info "Running all stressors one by one"
STRESSORS_CMD="stress-ng --seq 0 -t 10 --tz -v"
sudo -E ctr t exec --exec-id 4 "${CONTAINER_NAME}" sh -c "${STRESSORS_CMD}"
sudo -E ctr t exec --exec-id "$(random_name)" "${CONTAINER_NAME}" sh -c "${STRESSORS_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 5 "${CONTAINER_NAME}" sh -c "${FLOAT_CMD}"
sudo -E ctr 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 5m'
sudo -E ctr t exec --exec-id 6 "${CONTAINER_NAME}" sh -c "${INSTANCE_CMD}"
sudo -E ctr t exec --exec-id "$(random_name)" "${CONTAINER_NAME}" sh -c "${INSTANCE_CMD}"
clean_env_ctr
}