mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-05-01 21:24:36 +00:00
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:
parent
fd19f4082f
commit
6339605a14
7
tests/stability/agent_stability_test.sh
Normal file → Executable file
7
tests/stability/agent_stability_test.sh
Normal file → Executable file
@ -34,8 +34,9 @@ function setup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function exec_loop {
|
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 "echo 'hello world' > file"
|
||||||
|
$cmd "ls /file"
|
||||||
$cmd "rm -rf /file"
|
$cmd "rm -rf /file"
|
||||||
$cmd "touch /tmp/execWorks"
|
$cmd "touch /tmp/execWorks"
|
||||||
$cmd "ls /tmp | grep execWorks"
|
$cmd "ls /tmp | grep execWorks"
|
||||||
@ -51,10 +52,10 @@ function teardown {
|
|||||||
}
|
}
|
||||||
trap teardown EXIT
|
trap teardown EXIT
|
||||||
|
|
||||||
echo "Starting stability test"
|
info "Starting stability test"
|
||||||
setup
|
setup
|
||||||
|
|
||||||
echo "Running stability test"
|
info "Running stability test"
|
||||||
while [[ $end_time > $(date +%s) ]]; do
|
while [[ $end_time > $(date +%s) ]]; do
|
||||||
exec_loop
|
exec_loop
|
||||||
done
|
done
|
||||||
|
@ -26,16 +26,16 @@ function main() {
|
|||||||
sudo -E "${CTR_EXE}" i import "${DOCKER_IMAGE}.tar"
|
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}" 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"
|
info "Write one million rows"
|
||||||
local WRITE_CMD="./opt/cassandra/tools/bin/cassandra-stress write n=1000000 -rate threads=50"
|
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"
|
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"
|
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"
|
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"
|
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
|
clean_env_ctr
|
||||||
}
|
}
|
||||||
|
@ -26,32 +26,32 @@ function main() {
|
|||||||
# Run 1 iomix stressor (mix of I/O operations) for 20 seconds with verbose output
|
# Run 1 iomix stressor (mix of I/O operations) for 20 seconds with verbose output
|
||||||
info "Running iomix stressor test"
|
info "Running iomix stressor test"
|
||||||
IOMIX_CMD="stress-ng --iomix 1 -t 20 -v"
|
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
|
# Run cpu stressors and virtual memory stressors for 5 minutes
|
||||||
info "Running memory stressors for 5 minutes"
|
info "Running memory stressors for 5 minutes"
|
||||||
MEMORY_CMD="stress-ng --cpu 2 --vm 4 -t 5m"
|
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
|
# Run shared memory stressors
|
||||||
info "Running 8 shared memory stressors"
|
info "Running 8 shared memory stressors"
|
||||||
SHARED_CMD="stress-ng --shm 0"
|
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
|
# Run all stressors one by one on all CPUs
|
||||||
info "Running all stressors one by one"
|
info "Running all stressors one by one"
|
||||||
STRESSORS_CMD="stress-ng --seq 0 -t 10 --tz -v"
|
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
|
# Test floating point on CPU for 60 seconds
|
||||||
info "Running floating tests on CPU"
|
info "Running floating tests on CPU"
|
||||||
FLOAT_CMD="stress-ng --matrix 1 -t 1m"
|
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
|
# Runs two instances of the CPU stressors, one instance of the matrix
|
||||||
info "Running instances of the CPU stressors"
|
info "Running instances of the CPU stressors"
|
||||||
INSTANCE_CMD='stress-ng --cpu 2 --matrix 1 --mq 3 -t 5m'
|
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
|
clean_env_ctr
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user