[LTP] [PATCH 0/6] Introduce a concept of test max_runtime

Cyril Hrubis chrubis@suse.cz
Mon Oct 25 18:01:28 CEST 2021


This patchset introduces a concept of test max_runtime and convert all
tests that were (mis)using timeout to get around timeouts when a test
runtime was longer than expected timeout.

Generally this removes quite a bit of code and makes things simpler
since it's easier to set up a runtime and compute test timeout based on
that rather than the other way around.

If this gets merged I may follow up with other changes, there are a few
tests that deliberately set up timeout to be 10 or 20 seconds in order
to timeout faster than the default 360. So logicall followup would be
setting the default timeout somewhat shorter and get rid of these as
well.

Cyril Hrubis (6):
  lib: tst_test: Move timeout scaling out of fork_testrun()
  lib: Add .max_runtime and tst_remaining_runtime()
  mtest06/mmap3: Convert to tst_remaining_runtime()
  syscalls/gettimeofday02: Convert to tst_remaining_runtime()
  cve-2015-3290: convert tst_remining_runtime()
  lib: Add tst_set_runtime() & remove tst_set_timeout()

 include/tst_fuzzy_sync.h                      |  7 ++-
 include/tst_test.h                            | 19 +++++-
 include/tst_timer_test.h                      |  3 +
 lib/newlib_tests/.gitignore                   |  4 +-
 lib/newlib_tests/test18.c                     | 22 -------
 lib/newlib_tests/test_max_runtime01.c         | 28 +++++++++
 lib/newlib_tests/test_max_runtime02.c         | 29 +++++++++
 lib/newlib_tests/test_max_runtime03.c         | 35 +++++++++++
 lib/newlib_tests/tst_fuzzy_sync01.c           |  1 +
 lib/newlib_tests/tst_fuzzy_sync02.c           |  1 +
 lib/newlib_tests/tst_fuzzy_sync03.c           |  1 +
 lib/tst_test.c                                | 62 ++++++++++++-------
 lib/tst_timer_test.c                          |  4 +-
 runtest/mm                                    |  2 +-
 testcases/cve/cve-2014-0196.c                 |  1 +
 testcases/cve/cve-2015-3290.c                 |  8 +--
 testcases/cve/cve-2016-7117.c                 |  1 +
 testcases/cve/cve-2017-2671.c                 |  1 +
 testcases/kernel/crypto/af_alg02.c            |  4 +-
 testcases/kernel/crypto/af_alg07.c            |  1 +
 testcases/kernel/crypto/pcrypt_aead01.c       |  3 +-
 testcases/kernel/mem/mtest01/mtest01.c        |  9 ++-
 testcases/kernel/mem/mtest06/mmap1.c          | 27 ++------
 testcases/kernel/mem/mtest06/mmap3.c          | 12 +---
 testcases/kernel/mem/thp/thp04.c              |  1 +
 testcases/kernel/pty/pty03.c                  |  1 +
 testcases/kernel/pty/pty05.c                  |  1 +
 testcases/kernel/sound/snd_seq01.c            |  2 +-
 testcases/kernel/sound/snd_timer01.c          |  1 +
 testcases/kernel/syscalls/bind/bind06.c       |  2 +-
 .../clock_nanosleep/clock_nanosleep02.c       |  1 +
 .../syscalls/epoll_pwait/epoll_pwait03.c      |  1 +
 .../kernel/syscalls/epoll_wait/epoll_wait02.c |  1 +
 .../kernel/syscalls/epoll_wait/epoll_wait04.c |  2 +-
 .../syscalls/futex/futex_cmp_requeue01.c      |  2 +-
 .../kernel/syscalls/futex/futex_wait05.c      |  1 +
 .../syscalls/gettimeofday/gettimeofday02.c    | 35 +----------
 testcases/kernel/syscalls/inotify/inotify09.c |  1 +
 .../kernel/syscalls/ipc/shmctl/shmctl05.c     |  2 +-
 .../kernel/syscalls/move_pages/move_pages12.c |  4 +-
 .../kernel/syscalls/nanosleep/nanosleep01.c   |  1 +
 testcases/kernel/syscalls/poll/poll02.c       |  1 +
 testcases/kernel/syscalls/prctl/prctl09.c     |  1 +
 testcases/kernel/syscalls/pselect/pselect01.c |  1 +
 testcases/kernel/syscalls/select/select02.c   |  1 +
 testcases/kernel/syscalls/sendmsg/sendmsg03.c |  1 +
 .../kernel/syscalls/setsockopt/setsockopt06.c |  1 +
 .../kernel/syscalls/setsockopt/setsockopt07.c |  1 +
 .../syscalls/timerfd/timerfd_settime02.c      |  1 +
 testcases/kernel/syscalls/writev/writev03.c   |  1 +
 testcases/network/can/cve/can_bcm01.c         |  1 +
 testcases/network/packet/fanout01.c           |  1 +
 testcases/network/sockets/vsock01.c           |  1 +
 53 files changed, 219 insertions(+), 137 deletions(-)
 delete mode 100644 lib/newlib_tests/test18.c
 create mode 100644 lib/newlib_tests/test_max_runtime01.c
 create mode 100644 lib/newlib_tests/test_max_runtime02.c
 create mode 100644 lib/newlib_tests/test_max_runtime03.c

-- 
2.32.0



More information about the ltp mailing list