mirror of
https://github.com/toradex/rt-validation.git
synced 2025-06-20 11:52:00 +00:00
Add rt-tests and stress-tests
Related-to: TOR-1198 Signed-off-by: Ming Liu <ming.liu@toradex.com>
This commit is contained in:
parent
15373623de
commit
f42ce32faa
21
README.md
21
README.md
@ -1,3 +1,24 @@
|
|||||||
# rt-validation
|
# rt-validation
|
||||||
|
|
||||||
Containers to validate real-time (PREEMPT_RT) support in TorizonCore
|
Containers to validate real-time (PREEMPT_RT) support in TorizonCore
|
||||||
|
|
||||||
|
|
||||||
|
# Build containers (on target machine)
|
||||||
|
|
||||||
|
For armhf:
|
||||||
|
```
|
||||||
|
docker build -t torizon/rt-validation-stress stress-tests
|
||||||
|
docker build -t torizon/rt-validation-rt rt-tests
|
||||||
|
```
|
||||||
|
|
||||||
|
For arm64:
|
||||||
|
```
|
||||||
|
docker build --build-arg IMAGE_ARCH=linux/arm64 -t torizon/rt-validation-stress stress-tests
|
||||||
|
docker build --build-arg IMAGE_ARCH=linux/arm64 -t torizon/rt-validation-rt rt-tests
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
# Run the tests (on target machine)
|
||||||
|
|
||||||
|
docker run --rm -it --privileged -v /dev:/dev -v /tmp:/tmp -v /media/$USER/YOUR-USB-DISK-MOUNTPOINT:/mnt/pendrive torizon/rt-validation-stress
|
||||||
|
docker run --rm -it --privileged -v /dev:/dev -v /tmp:/tmp torizon/rt-validation-rt
|
||||||
|
10
rt-tests/Dockerfile
Normal file
10
rt-tests/Dockerfile
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
ARG IMAGE_ARCH=linux/arm
|
||||||
|
# For IMX8 use IMAGE_ARCH=linux/arm64
|
||||||
|
ARG IMAGE_TAG=1-buster
|
||||||
|
FROM --platform=$IMAGE_ARCH torizon/debian:$IMAGE_TAG
|
||||||
|
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends rt-tests \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
CMD ["cyclictest","-S","-p99","-i1000","-m","-D20m", "-q", "|", "tee", "cyclictest.log"]
|
12
stress-tests/Dockerfile
Normal file
12
stress-tests/Dockerfile
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
ARG IMAGE_ARCH=linux/arm
|
||||||
|
# For IMX8 use IMAGE_ARCH=linux/arm64
|
||||||
|
ARG IMAGE_TAG=1-buster
|
||||||
|
FROM --platform=$IMAGE_ARCH torizon/debian:$IMAGE_TAG
|
||||||
|
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends iperf3 rt-tests \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
COPY / /
|
||||||
|
|
||||||
|
CMD ["/stress-tests.sh"]
|
27
stress-tests/stress-tests.sh
Executable file
27
stress-tests/stress-tests.sh
Executable file
@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# CPU load
|
||||||
|
while true; do hackbench >/dev/null 2>&1; done &
|
||||||
|
|
||||||
|
# I/O load (eMMC read)
|
||||||
|
while true; do du /usr >/dev/null 2>&1; done &
|
||||||
|
while true; do find / -name a* >/dev/null 2>&1; done &
|
||||||
|
|
||||||
|
# I/O load (USB read/write)
|
||||||
|
if mount | grep /mnt/pendrive >/dev/null; then
|
||||||
|
cd /mnt/pendrive
|
||||||
|
tar -cf file.tar -C /var/log --exclude=lost+found -p .
|
||||||
|
while true; do rm -rf output; mkdir -p output; tar xfv file.tar -C output/ >/dev/null 2>&1; done &
|
||||||
|
fi
|
||||||
|
|
||||||
|
# RTC read/write
|
||||||
|
while true; do hwclock >/dev/null 2>&1; sleep 0.1; done &
|
||||||
|
while true; do hwclock -w >/dev/null 2>&1; sleep 0.1; done &
|
||||||
|
|
||||||
|
# Network load
|
||||||
|
while true; do iperf3 -c bouygues.iperf.fr -P 10 >/dev/null 2>&1; done
|
||||||
|
|
||||||
|
echo "RT stress tests started successfully!"
|
||||||
|
|
||||||
|
# Dont exit
|
||||||
|
while true; do sleep 1; done
|
Loading…
Reference in New Issue
Block a user