[Fuego] [fuego-core 7/7] LTP: automatically obtain the list of tests

[email protected] Sun, 18 Jul 2021 16:40:12 +0530
Newsgroups dev.linux.lists.fuego
Message-ID <[email protected]>
From: Nguyen Dat Tho <[email protected]>

 set ALLTESTS, ALLPTSTESTS and ALLRTTESTS automatically by
 listing all possible runtests

Signed-off-by: Nguyen Dat Tho <[email protected]>
Signed-off-by: Daniel Sangorrin <[email protected]>
Signed-off-by: venkata pyla <[email protected]>
---
 tests/Functional.LTP/fuego_test.sh | 47 +++---------------------------
 1 file changed, 4 insertions(+), 43 deletions(-)

diff --git a/tests/Functional.LTP/fuego_test.sh b/tests/Functional.LTP/fuego_test.sh
index 16d556f..23dfc6c 100755
--- a/tests/Functional.LTP/fuego_test.sh
+++ b/tests/Functional.LTP/fuego_test.sh
@@ -4,49 +4,6 @@ tarball=ltp-full-20210524.tar.bz2
 
 NEED_ROOT=1
 
-ALLTESTS="
-admin_tools         fs_perms_simple       ltp-aio-stress.part2  net_stress.interface
-can                 fs_readonly           ltplite               net_stress.ipsec_dccp             sched
-cap_bounds          fsx                   lvm.part1             net_stress.ipsec_icmp             scsi_debug.part1
-commands            hugetlb               lvm.part2             net_stress.ipsec_sctp             securebits
-connectors          hyperthreading        math                  net_stress.ipsec_tcp              smack
-containers          ima                   mm                    net_stress.ipsec_udp              stress.part1
-controllers         input                 modules               net_stress.multicast              stress.part2
-cpuhotplug          io                    net.features          net_stress.route                  stress.part3
-crashme             io_cd                 net.ipv6              net.tcp_cmds                      syscalls
-cve                 io_floppy             net.ipv6_lib          net.tirpc_tests                   syscalls-ipc
-dio                 ipc                   net.multicast         network_commands                  timers
-dma_thread_diotest  kernel_misc           net.nfs               nptl                              tpm_tools
-fcntl-locktests     ltp-aiodio.part1      net.rpc               numa                              tracing
-filecaps            ltp-aiodio.part2      net.rpc_tests         pipes                             s390x_tests
-fs                  ltp-aiodio.part3      net.sctp              power_management_tests            uevent
-fs_bind             ltp-aiodio.part4      net_stress.appl       power_management_tests_exclusive  crypto
-fs_ext4             ltp-aio-stress.part1  net_stress.broken_ip  pty
-smoketest"
-
-ALLPTSTESTS="AIO MEM MSG SEM SIG THR TMR TPS"
-
-# This list can be obtained by doing ./testscripts/test_realtime.sh -t list
-ALLRTTESTS="
-perf/latency
-func/measurement
-func/hrtimer-prio
-func/gtod_latency
-func/periodic_cpu_load
-func/pthread_kill_latency
-func/sched_football
-func/pi-tests
-func/thread_clock
-func/rt-migrate
-func/matrix_mult
-func/prio-preempt
-func/prio-wake
-func/pi_perf
-func/sched_latency
-func/async_handler
-func/sched_jitter
-"
-
 # OK - the logic here is a bit complicated
 # We support several different usage scenarios:
 #   1: fuego builds, deploys and installs LTP
@@ -444,6 +401,10 @@ function test_run {
         cmd "sed -i 's/^dio30 diotest6 -b 65536 -n 100 -i 100 -o 1024000/dio30 diotest6 -b 65536 -n 5 -i 100 -o 1024000/' $LTP_DESTDIR/runtest/dio"
         cmd "sed -i 's/^msgctl11 msgctl11/msgctl11 msgctl11 -n 5/' $LTP_DESTDIR/runtest/syscalls"
 
+        ALLTESTS=$(ls $LTP_DESTDIR/runtest)
+        ALLPTSTESTS=$(grep 'usage: $(basename "$0")' $LTP_DESTDIR/bin/run-posix-option-group-test.sh | sed -e 's/^.*\[\(.*\)\]/\1/g' -e 's/|/ /g')
+        ALLRTTESTS=$(find $LTP_DESTDIR/testcases/realtime -type f -name run_auto.sh -printf '%h\n' | sed 's/^.*realtime\///g')
+
         TESTS=""
         PTSTESTS=""
         RTTESTS=""
-- 
2.20.1