test: Make test application scalable

also fixes github CI and makes the linger stress test run multiple times
This commit is contained in:
David Cermak
2024-10-23 10:00:27 +02:00
parent b15cd2de75
commit 3ec12c3be0
6 changed files with 14 additions and 20 deletions
+3 -3
View File
@@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install deps
run: |
sudo apt-get install check ninja-build doxygen
@@ -41,7 +41,7 @@ jobs:
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: Test Results ${{ matrix.compiler }}
path: "*.xml"
@@ -55,7 +55,7 @@ jobs:
if: always()
steps:
- name: Download Artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
path: artifacts
-11
View File
@@ -21,17 +21,6 @@ Suite* create_suite(const char* name, testfunc *tests, size_t num_tests, SFun se
return s;
}
void lwip_check_ensure_no_alloc(unsigned int skip)
{
int i;
unsigned int mask;
for (i = 0, mask = 1; i < MEMP_MAX; i++, mask <<= 1) {
if (!(skip & mask)) {
fail_unless(lwip_stats.memp[i]->used == 0);
}
}
}
int main(void)
{
int number_failed;
+11 -6
View File
@@ -4,17 +4,22 @@ set -e
export LWIP_DIR=`pwd`
export LWIP_CONTRIB_DIR=`pwd`/contrib
TEST_APPS="socket_no_linger socket_linger socket_linger_reuse"
STRESS_TEST_APPS="socket_linger"
cd test/apps
# Prepare a failing report in case we get stuck (check in no-fork mode)
python socket_linger_stress_test.py failed > ${LWIP_DIR}/socket_linger_stress_test.xml
for cfg in config_no_linger config_linger config_linger_reuse; do
cmake -DCI_BUILD=1 -DTEST_CONFIG=${cfg} -B ${cfg} -G Ninja .
cmake --build ${cfg}/
timeout 10 ./${cfg}/lwip_test_apps
for app in $TEST_APPS; do
cmake -DCI_BUILD=1 -DTEST_CONFIG=${app} -B ${app} -G Ninja .
cmake --build ${app}/
timeout 10 ./${app}/lwip_test_apps
[ -f check2junit.py ] &&
python ${LWIP_DIR}/check2junit.py lwip_test_apps.xml > ${LWIP_DIR}/${cfg}.xml
python ${LWIP_DIR}/check2junit.py lwip_test_apps.xml > ${LWIP_DIR}/${app}.xml
done
# Run the lingering test multiple times
for run in {1..10}; do ( timeout 10 ./config_linger/lwip_test_apps ) || exit 1 ; done
for stress_cfg in $STRESS_TEST_APPS; do
for run in {1..1000}; do ( timeout 10 ./$stress_cfg/lwip_test_apps ) || exit 1 ; done;
done
# All good, regenerate the stress test-report, since the test succeeded
python socket_linger_stress_test.py > ${LWIP_DIR}/socket_linger_stress_test.xml