Skip to content

Commit

Permalink
kernel-performance-tests: Add container load test
Browse files Browse the repository at this point in the history
Add a cyclictest ptest with container start/stop in background.

Signed-off-by: Chaitanya Vadrevu <[email protected]>
  • Loading branch information
chaitu236 authored and amstewart committed Nov 30, 2023
1 parent a300dcc commit 30d75a9
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

function setup_container_load()
{
docker pull hello-world
}

function start_container_load()
{
while true; do
docker run hello-world > /dev/null
sleep 1
done
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
./test_kernel_cyclictest_hackbench.sh
./test_kernel_cyclictest_fio.sh
./test_kernel_cyclictest_iperf.sh
./test_kernel_cyclictest_container_load.sh
exit 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
source ./run-cyclictest
source ./run-container-load

# start background container load
setup_container_load
start_container_load &

# measure the system latency under container load
run_cyclictest "container"

# clean-up
kill $(jobs -p) 2>/dev/null

exit $CYCLICTEST_RESULT
6 changes: 5 additions & 1 deletion recipes-kernel/kernel-tests/kernel-performance-tests.bb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-files:"
S = "${WORKDIR}"

DEPENDS = "virtual/kernel"
RDEPENDS:${PN}-ptest += "bash rt-tests fio iperf3 python3 python3-pip"
RDEPENDS:${PN}-ptest += "bash rt-tests fio iperf3 python3 python3-pip docker"
RDEPENDS:${PN}-ptest:append:x64 = " fw-printenv"
RDEPENDS:${PN}-ptest:append:armv7a = " u-boot-fw-utils"

Expand All @@ -27,6 +27,8 @@ SRC_URI += "\
file://test_kernel_cyclictest_hackbench.sh \
file://test_kernel_cyclictest_fio.sh \
file://test_kernel_cyclictest_iperf.sh \
file://run-container-load \
file://test_kernel_cyclictest_container_load.sh \
"

do_install_ptest:append() {
Expand All @@ -39,6 +41,8 @@ do_install_ptest:append() {
install -m 0755 ${S}/test_kernel_cyclictest_hackbench.sh ${D}${PTEST_PATH}
install -m 0755 ${S}/test_kernel_cyclictest_fio.sh ${D}${PTEST_PATH}
install -m 0755 ${S}/test_kernel_cyclictest_iperf.sh ${D}${PTEST_PATH}
install -m 0755 ${S}/run-container-load ${D}${PTEST_PATH}
install -m 0755 ${S}/test_kernel_cyclictest_container_load.sh ${D}${PTEST_PATH}
}

pkg_postinst_ontarget:${PN}-ptest:append() {
Expand Down

0 comments on commit 30d75a9

Please sign in to comment.