Skip to content

Commit

Permalink
test: Make test application scalable
Browse files Browse the repository at this point in the history
also fixes github CI and makes the linger stress test run multiple times
  • Loading branch information
david-cermak committed Oct 23, 2024
1 parent b15cd2d commit 3ec12c3
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 20 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand All @@ -55,7 +55,7 @@ jobs:
if: always()
steps:
- name: Download Artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
path: artifacts

Expand Down
File renamed without changes.
File renamed without changes.
11 changes: 0 additions & 11 deletions test/apps/test_apps.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
17 changes: 11 additions & 6 deletions test/ci/test_apps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3ec12c3

Please sign in to comment.