All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] Rename tst_test_* to tst_require_*
@ 2019-10-11  9:07 Joerg Vehlow
  2019-10-11  9:07 ` [LTP] [PATCH 1/2] shell: Rename s/tst_test_cmds/tst_require_cmds/ Joerg Vehlow
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Joerg Vehlow @ 2019-10-11  9:07 UTC (permalink / raw)
  To: ltp

Hi,

these patches rename tst_test_* to tst_require_*, to better describe
their use. There is also tst_require_root, that has the same
behavior: It also calls tst_brk in case of a failing requirement.

You can also get this patch from the following repo:
https://github.com/MofX/ltp/commits/rename_tst_test-tst_require

J?rg

doc/test-writing-guidelines.txt                                                      |  2 +-
testcases/commands/mkfs/mkfs01.sh                                                    |  2 +-
testcases/kernel/containers/netns/netns_breakns.sh                                   |  2 +-
testcases/kernel/containers/netns/netns_helper.sh                                    |  4 ++--
testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh                           |  2 +-
testcases/kernel/controllers/memcg/functional/memcg_lib.sh                           |  4 ++--
testcases/kernel/device-drivers/zram/zram01.sh                                       |  2 +-
testcases/kernel/device-drivers/zram/zram_lib.sh                                     |  6 +++---
testcases/kernel/fs/ext4-new-features/ext4-delalloc-mballoc/ext4-alloc-test.sh       |  2 +-
testcases/kernel/fs/ext4-new-features/ext4-journal-checksum/ext4_journal_checksum.sh |  2 +-
testcases/kernel/fs/ext4-new-features/ext4-online-defrag/ext4_online_defrag_test.sh  |  4 ++--
testcases/kernel/fs/ext4-new-features/ext4-uninit-groups/ext4_uninit_groups_test.sh  |  2 +-
testcases/kernel/fs/iso9660/isofs.sh                                                 |  2 +-
testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh                      |  2 +-
testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh                      |  2 +-
testcases/kernel/io/stress_floppy/stress_floppy                                      |  2 +-
testcases/kernel/power_management/runpwtests05.sh                                    |  2 +-
testcases/kernel/power_management/runpwtests_exclusive01.sh                          |  2 +-
testcases/kernel/power_management/runpwtests_exclusive02.sh                          |  2 +-
testcases/kernel/power_management/runpwtests_exclusive03.sh                          |  2 +-
testcases/kernel/power_management/runpwtests_exclusive04.sh                          |  2 +-
testcases/kernel/power_management/runpwtests_exclusive05.sh                          |  2 +-
testcases/lib/test.sh                                                                |  2 +-
testcases/lib/tst_net.sh                                                             | 10 +++++-----
testcases/lib/tst_test.sh                                                            | 12 ++++++------
testcases/network/multicast/mc_commo/mc_commo.sh                                     |  2 +-
testcases/network/multicast/mc_member/mc_member.sh                                   |  2 +-
testcases/network/stress/dns/dns-stress.sh                                           |  2 +-
testcases/network/stress/ftp/ftp-download-stress.sh                                  |  2 +-
testcases/network/stress/ftp/ftp-download-stress01-rmt.sh                            |  2 +-
testcases/network/stress/ftp/ftp-download-stress02-rmt.sh                            |  2 +-
testcases/network/stress/ftp/ftp-upload-stress.sh                                    |  4 ++--
testcases/network/stress/ftp/ftp-upload-stress01-rmt.sh                              |  2 +-
testcases/network/stress/ftp/ftp-upload-stress02-rmt.sh                              |  2 +-
testcases/network/stress/http/http-stress01-rmt.sh                                   |  2 +-
testcases/network/stress/http/http-stress02-rmt.sh                                   |  2 +-
testcases/network/stress/interface/if-lib.sh                                         |  2 +-
testcases/network/stress/ns-tools/tst_net_stress.sh                                  |  2 +-
testcases/network/stress/ssh/ssh-stress.sh                                           |  2 +-
testcases/network/tcp_cmds/ipneigh/ipneigh01.sh                                      |  2 +-
testcases/network/tcp_cmds/ping/ping01.sh                                            |  2 +-
testcases/network/tcp_cmds/ping/ping02.sh                                            |  2 +-
testcases/network/tcp_cmds/rlogin/rlogin01.sh                                        |  2 +-
testcases/network/tcp_cmds/sendfile/sendfile01.sh                                    |  2 +-
testcases/network/tcp_cmds/tcpdump/tcpdump01.sh                                      |  2 +-
testcases/network/tcp_cmds/telnet/telnet01.sh                                        |  2 +-
testcases/network/tcp_cmds/tracepath/tracepath01.sh                                  |  2 +-
testcases/network/virt/virt_lib.sh                                                   |  4 ++--
testcases/network/xinetd/xinetd_tests.sh                                             |  2 +-
49 files changed, 65 insertions(+), 65 deletions(-)




^ permalink raw reply	[flat|nested] 16+ messages in thread

* [LTP] [PATCH 1/2] shell: Rename s/tst_test_cmds/tst_require_cmds/
  2019-10-11  9:07 [LTP] Rename tst_test_* to tst_require_* Joerg Vehlow
@ 2019-10-11  9:07 ` Joerg Vehlow
  2019-10-11  9:07 ` [LTP] [PATCH 2/2] shell: Rename s/tst_test_drivers/tst_require_drivers/ Joerg Vehlow
  2019-10-11 10:06 ` [LTP] Rename tst_test_* to tst_require_* Petr Vorel
  2 siblings, 0 replies; 16+ messages in thread
From: Joerg Vehlow @ 2019-10-11  9:07 UTC (permalink / raw)
  To: ltp

From: Joerg Vehlow <joerg.vehlow@aox-tech.de>

This require describes the function of the command better than test.
"tst_require_root" is also a well established name in ltp api with the
same semantic.

Signed-off-by: Joerg Vehlow <joerg.vehlow@aox-tech.de>
---
 doc/test-writing-guidelines.txt                        |  2 +-
 testcases/commands/mkfs/mkfs01.sh                      |  2 +-
 testcases/kernel/containers/netns/netns_breakns.sh     |  2 +-
 testcases/kernel/containers/netns/netns_helper.sh      |  4 ++--
 .../kernel/controllers/cgroup_fj/cgroup_fj_common.sh   |  2 +-
 .../kernel/controllers/memcg/functional/memcg_lib.sh   |  4 ++--
 testcases/kernel/device-drivers/zram/zram01.sh         |  2 +-
 testcases/kernel/device-drivers/zram/zram_lib.sh       |  6 +++---
 .../ext4-delalloc-mballoc/ext4-alloc-test.sh           |  2 +-
 .../ext4-journal-checksum/ext4_journal_checksum.sh     |  2 +-
 .../ext4-online-defrag/ext4_online_defrag_test.sh      |  4 ++--
 .../ext4-uninit-groups/ext4_uninit_groups_test.sh      |  2 +-
 testcases/kernel/fs/iso9660/isofs.sh                   |  2 +-
 .../hotplug/cpu_hotplug/functional/cpuhotplug01.sh     |  2 +-
 .../hotplug/cpu_hotplug/functional/cpuhotplug05.sh     |  2 +-
 testcases/kernel/io/stress_floppy/stress_floppy        |  2 +-
 testcases/kernel/power_management/runpwtests05.sh      |  2 +-
 .../kernel/power_management/runpwtests_exclusive01.sh  |  2 +-
 .../kernel/power_management/runpwtests_exclusive02.sh  |  2 +-
 .../kernel/power_management/runpwtests_exclusive03.sh  |  2 +-
 .../kernel/power_management/runpwtests_exclusive04.sh  |  2 +-
 .../kernel/power_management/runpwtests_exclusive05.sh  |  2 +-
 testcases/lib/test.sh                                  |  2 +-
 testcases/lib/tst_net.sh                               | 10 +++++-----
 testcases/lib/tst_test.sh                              |  8 ++++----
 testcases/network/multicast/mc_commo/mc_commo.sh       |  2 +-
 testcases/network/multicast/mc_member/mc_member.sh     |  2 +-
 testcases/network/stress/dns/dns-stress.sh             |  2 +-
 testcases/network/stress/ftp/ftp-download-stress.sh    |  2 +-
 .../network/stress/ftp/ftp-download-stress01-rmt.sh    |  2 +-
 .../network/stress/ftp/ftp-download-stress02-rmt.sh    |  2 +-
 testcases/network/stress/ftp/ftp-upload-stress.sh      |  4 ++--
 .../network/stress/ftp/ftp-upload-stress01-rmt.sh      |  2 +-
 .../network/stress/ftp/ftp-upload-stress02-rmt.sh      |  2 +-
 testcases/network/stress/http/http-stress01-rmt.sh     |  2 +-
 testcases/network/stress/http/http-stress02-rmt.sh     |  2 +-
 testcases/network/stress/interface/if-lib.sh           |  2 +-
 testcases/network/stress/ns-tools/tst_net_stress.sh    |  2 +-
 testcases/network/stress/ssh/ssh-stress.sh             |  2 +-
 testcases/network/tcp_cmds/ipneigh/ipneigh01.sh        |  2 +-
 testcases/network/tcp_cmds/ping/ping01.sh              |  2 +-
 testcases/network/tcp_cmds/ping/ping02.sh              |  2 +-
 testcases/network/tcp_cmds/rlogin/rlogin01.sh          |  2 +-
 testcases/network/tcp_cmds/sendfile/sendfile01.sh      |  2 +-
 testcases/network/tcp_cmds/tcpdump/tcpdump01.sh        |  2 +-
 testcases/network/tcp_cmds/telnet/telnet01.sh          |  2 +-
 testcases/network/tcp_cmds/tracepath/tracepath01.sh    |  2 +-
 testcases/network/virt/virt_lib.sh                     |  4 ++--
 testcases/network/xinetd/xinetd_tests.sh               |  2 +-
 49 files changed, 63 insertions(+), 63 deletions(-)

diff --git a/doc/test-writing-guidelines.txt b/doc/test-writing-guidelines.txt
index 6da87baa7..176fc2b06 100644
--- a/doc/test-writing-guidelines.txt
+++ b/doc/test-writing-guidelines.txt
@@ -2150,7 +2150,7 @@ TST_NEEDS_CMDS="modinfo modprobe"
 Setting '$TST_NEEDS_CMDS' to a string listing required commands will check for
 existence each of them and exits the test with 'TCONF' on first missing.
 
-Alternatively the 'tst_test_cmds()' function can be used to do the same on
+Alternatively the 'tst_require_cmds()' function can be used to do the same on
 runtime, since sometimes we need to the check at runtime too.
 
 'tst_check_cmds()' can be used for requirements just for a particular test
diff --git a/testcases/commands/mkfs/mkfs01.sh b/testcases/commands/mkfs/mkfs01.sh
index 16b1a8fab..81f1a168c 100755
--- a/testcases/commands/mkfs/mkfs01.sh
+++ b/testcases/commands/mkfs/mkfs01.sh
@@ -37,7 +37,7 @@ parse_args()
 setup()
 {
 	if [ -n "$TST_FS_TYPE" ]; then
-		tst_test_cmds mkfs.${TST_FS_TYPE}
+		tst_require_cmds mkfs.${TST_FS_TYPE}
 	fi
 
 	ROD_SILENT mkdir -p mntpoint
diff --git a/testcases/kernel/containers/netns/netns_breakns.sh b/testcases/kernel/containers/netns/netns_breakns.sh
index 3ef8f9896..c7aa2c34c 100755
--- a/testcases/kernel/containers/netns/netns_breakns.sh
+++ b/testcases/kernel/containers/netns/netns_breakns.sh
@@ -61,7 +61,7 @@ fi
 
 
 # TEST CASE #2
-tst_test_cmds ifconfig
+tst_require_cmds ifconfig
 $NS_EXEC $NS_HANDLE0 $NS_TYPE ifconfig veth1 $IFCONF_IN6_ARG $IP1/$NETMASK 2>/dev/null
 if [ $? -ne 0 ]; then
 	tst_resm TPASS "controlling device over ioctl"
diff --git a/testcases/kernel/containers/netns/netns_helper.sh b/testcases/kernel/containers/netns/netns_helper.sh
index a9d045964..c765a0cb9 100755
--- a/testcases/kernel/containers/netns/netns_helper.sh
+++ b/testcases/kernel/containers/netns/netns_helper.sh
@@ -110,7 +110,7 @@ tst_check_iproute()
 netns_setup()
 {
 	tst_require_root
-	tst_test_cmds ip modprobe
+	tst_require_cmds ip modprobe
 
 	modprobe veth > /dev/null 2>&1
 
@@ -139,7 +139,7 @@ netns_setup()
 		;;
 	ioctl)
 		USE_IFCONFIG=1
-		tst_test_cmds ifconfig
+		tst_require_cmds ifconfig
 		;;
 	*)
 		tst_brkm TBROK \
diff --git a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
index f6083756a..5594fe9de 100755
--- a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
+++ b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
@@ -83,7 +83,7 @@ create_subgroup()
 setup()
 {
     tst_require_root
-    tst_test_cmds killall
+    tst_require_cmds killall
 
     if [ ! -f /proc/cgroups ]; then
         tst_brkm TCONF "Kernel does not support for control groups"
diff --git a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
index aadaae4d2..22ef4f5e2 100755
--- a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
+++ b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
@@ -35,7 +35,7 @@ if [ $? -ne 0 ]; then
 fi
 
 # Check for dependencies
-tst_test_cmds killall
+tst_require_cmds killall
 
 # Post 4.16 kernel updates stat in batch (> 32 pages) every time
 PAGESIZES=$(( $PAGESIZE * 33 ))
@@ -83,7 +83,7 @@ TST_CLEANUP=cleanup
 
 shmmax_setup()
 {
-	tst_test_cmds bc
+	tst_require_cmds bc
 
 	shmmax=`cat /proc/sys/kernel/shmmax`
 	if [ $(echo "$shmmax < $HUGEPAGESIZE" |bc) -eq 1 ]; then
diff --git a/testcases/kernel/device-drivers/zram/zram01.sh b/testcases/kernel/device-drivers/zram/zram01.sh
index 9508211ab..cabe40d0b 100755
--- a/testcases/kernel/device-drivers/zram/zram01.sh
+++ b/testcases/kernel/device-drivers/zram/zram01.sh
@@ -58,7 +58,7 @@ TST_CLEANUP="zram_cleanup"
 
 zram_fill_fs()
 {
-	tst_test_cmds awk bc dd free
+	tst_require_cmds awk bc dd free
 	local mem_free0=$(free -m | awk 'NR==2 {print $4}')
 
 	for i in $(seq 0 $(($dev_num - 1))); do
diff --git a/testcases/kernel/device-drivers/zram/zram_lib.sh b/testcases/kernel/device-drivers/zram/zram_lib.sh
index d0e7704a8..d51b527f6 100755
--- a/testcases/kernel/device-drivers/zram/zram_lib.sh
+++ b/testcases/kernel/device-drivers/zram/zram_lib.sh
@@ -155,7 +155,7 @@ zram_set_memlimit()
 zram_makeswap()
 {
 	tst_resm TINFO "make swap with zram device(s)"
-	tst_test_cmds mkswap swapon swapoff
+	tst_require_cmds mkswap swapon swapoff
 	local i=0
 	for i in $(seq 0 $(($dev_num - 1))); do
 		mkswap /dev/zram$i > err.log 2>&1
@@ -179,7 +179,7 @@ zram_makeswap()
 
 zram_swapoff()
 {
-	tst_test_cmds swapoff
+	tst_require_cmds swapoff
 	local i=
 	for i in $(seq 0 $dev_makeswap); do
 		swapoff /dev/zram$i > err.log 2>&1
@@ -195,7 +195,7 @@ zram_swapoff()
 
 zram_makefs()
 {
-	tst_test_cmds mkfs
+	tst_require_cmds mkfs
 	local i=0
 	for fs in $zram_filesystems; do
 		# if requested fs not supported default it to ext2
diff --git a/testcases/kernel/fs/ext4-new-features/ext4-delalloc-mballoc/ext4-alloc-test.sh b/testcases/kernel/fs/ext4-new-features/ext4-delalloc-mballoc/ext4-alloc-test.sh
index 25ebdafc6..4ead8096d 100755
--- a/testcases/kernel/fs/ext4-new-features/ext4-delalloc-mballoc/ext4-alloc-test.sh
+++ b/testcases/kernel/fs/ext4-new-features/ext4-delalloc-mballoc/ext4-alloc-test.sh
@@ -117,7 +117,7 @@ ext4_test_delalloc_mballoc()
 # main
 ext4_setup
 
-tst_test_cmds ffsb
+tst_require_cmds ffsb
 
 DELALLOC=( "delalloc" "nodelalloc" )
 DIRECT_IO=( 0 1 )
diff --git a/testcases/kernel/fs/ext4-new-features/ext4-journal-checksum/ext4_journal_checksum.sh b/testcases/kernel/fs/ext4-new-features/ext4-journal-checksum/ext4_journal_checksum.sh
index 9edb89397..7674f78b0 100755
--- a/testcases/kernel/fs/ext4-new-features/ext4-journal-checksum/ext4_journal_checksum.sh
+++ b/testcases/kernel/fs/ext4-new-features/ext4-journal-checksum/ext4_journal_checksum.sh
@@ -94,7 +94,7 @@ ext4_test_journal_checksum()
 # main
 ext4_setup
 
-tst_test_cmds ffsb
+tst_require_cmds ffsb
 
 DATA=( "writeback" "ordered" "journal" )
 COMMIT=( 1 100 )
diff --git a/testcases/kernel/fs/ext4-new-features/ext4-online-defrag/ext4_online_defrag_test.sh b/testcases/kernel/fs/ext4-new-features/ext4-online-defrag/ext4_online_defrag_test.sh
index 11261e470..2dee00972 100755
--- a/testcases/kernel/fs/ext4-new-features/ext4-online-defrag/ext4_online_defrag_test.sh
+++ b/testcases/kernel/fs/ext4-new-features/ext4-online-defrag/ext4_online_defrag_test.sh
@@ -35,7 +35,7 @@ FILE=1
 DIR=2
 FILESYSTEM=3
 
-tst_test_cmds e4defrag
+tst_require_cmds e4defrag
 E4DEFRAG=`which e4defrag`
 
 age_filesystem()
@@ -161,7 +161,7 @@ ext4_test_online_defrag()
 # main
 ext4_setup
 
-tst_test_cmds ffsb
+tst_require_cmds ffsb
 
 DEFRAG=( $FILE $DIR $FILESYSTEM )
 AGING=( $EMPTY $SMALL $LARGE )
diff --git a/testcases/kernel/fs/ext4-new-features/ext4-uninit-groups/ext4_uninit_groups_test.sh b/testcases/kernel/fs/ext4-new-features/ext4-uninit-groups/ext4_uninit_groups_test.sh
index d39afae56..8baca7857 100755
--- a/testcases/kernel/fs/ext4-new-features/ext4-uninit-groups/ext4_uninit_groups_test.sh
+++ b/testcases/kernel/fs/ext4-new-features/ext4-uninit-groups/ext4_uninit_groups_test.sh
@@ -114,7 +114,7 @@ ext4_test_uninit_groups()
 # main
 ext4_setup
 
-tst_test_cmds ffsb
+tst_require_cmds ffsb
 
 ORLOV=( "orlov" "oldalloc" )
 DELALLOC=( "delalloc" "nodelalloc" )
diff --git a/testcases/kernel/fs/iso9660/isofs.sh b/testcases/kernel/fs/iso9660/isofs.sh
index 71eb35b1c..5f90354d9 100755
--- a/testcases/kernel/fs/iso9660/isofs.sh
+++ b/testcases/kernel/fs/iso9660/isofs.sh
@@ -102,7 +102,7 @@ gen_fs_tree "$MAKE_FILE_SYS_DIR" 1
 # Make ISO9660 file system with different options.
 # Mount the ISO9660 file system with different mount options.
 
-tst_test_cmds mkisofs
+tst_require_cmds mkisofs
 
 for mkisofs_opt in \
 	" " \
diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh
index 9bafcd180..1ba937cc7 100755
--- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh
+++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh
@@ -109,7 +109,7 @@ done
 
 LOOP_COUNT=1
 
-tst_test_cmds perl
+tst_require_cmds perl
 
 if [ $(get_present_cpus_num) -lt 2 ]; then
 	tst_brkm TCONF "system doesn't have required CPU hotplug support"
diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh
index 2828da578..95a8f4a2d 100755
--- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh
+++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh
@@ -59,7 +59,7 @@ done
 
 LOOP_COUNT=1
 
-tst_test_cmds sar
+tst_require_cmds sar
 
 if [ $(get_present_cpus_num) -lt 2 ]; then
 	tst_brkm TCONF "system doesn't have required CPU hotplug support"
diff --git a/testcases/kernel/io/stress_floppy/stress_floppy b/testcases/kernel/io/stress_floppy/stress_floppy
index deb939000..7510f0888 100755
--- a/testcases/kernel/io/stress_floppy/stress_floppy
+++ b/testcases/kernel/io/stress_floppy/stress_floppy
@@ -40,7 +40,7 @@ setup()
 {
 	tst_tmpdir
 
-	tst_test_cmds fdformat tar dump cpio dd mkfs mkdosfs
+	tst_require_cmds fdformat tar dump cpio dd mkfs mkdosfs
 
 	TCtmp=$(pwd)
 }
diff --git a/testcases/kernel/power_management/runpwtests05.sh b/testcases/kernel/power_management/runpwtests05.sh
index 43e234d01..1c87d8d0c 100755
--- a/testcases/kernel/power_management/runpwtests05.sh
+++ b/testcases/kernel/power_management/runpwtests05.sh
@@ -35,7 +35,7 @@ else
 	max_sched_smt=1
 fi
 
-tst_test_cmds python3
+tst_require_cmds python3
 
 if ! grep sched_debug -qw /proc/cmdline ; then
 	tst_brkm TCONF "Kernel cmdline parameter 'sched_debug' needed," \
diff --git a/testcases/kernel/power_management/runpwtests_exclusive01.sh b/testcases/kernel/power_management/runpwtests_exclusive01.sh
index 9fefcbf6e..3a824e5eb 100755
--- a/testcases/kernel/power_management/runpwtests_exclusive01.sh
+++ b/testcases/kernel/power_management/runpwtests_exclusive01.sh
@@ -35,7 +35,7 @@ else
 	max_sched_smt=1
 fi
 
-tst_test_cmds python3
+tst_require_cmds python3
 
 hyper_threaded=$(is_hyper_threaded)
 multi_socket=$(is_multi_socket)
diff --git a/testcases/kernel/power_management/runpwtests_exclusive02.sh b/testcases/kernel/power_management/runpwtests_exclusive02.sh
index 2cd0ecb05..fa445185e 100755
--- a/testcases/kernel/power_management/runpwtests_exclusive02.sh
+++ b/testcases/kernel/power_management/runpwtests_exclusive02.sh
@@ -33,7 +33,7 @@ else
 	max_sched_smt=1
 fi
 
-tst_test_cmds python3
+tst_require_cmds python3
 
 hyper_threaded=$(is_hyper_threaded)
 multi_socket=$(is_multi_socket)
diff --git a/testcases/kernel/power_management/runpwtests_exclusive03.sh b/testcases/kernel/power_management/runpwtests_exclusive03.sh
index ab3a5d11d..0d5724825 100755
--- a/testcases/kernel/power_management/runpwtests_exclusive03.sh
+++ b/testcases/kernel/power_management/runpwtests_exclusive03.sh
@@ -35,7 +35,7 @@ else
 	max_sched_smt=1
 fi
 
-tst_test_cmds python3
+tst_require_cmds python3
 
 hyper_threaded=$(is_hyper_threaded)
 multi_socket=$(is_multi_socket)
diff --git a/testcases/kernel/power_management/runpwtests_exclusive04.sh b/testcases/kernel/power_management/runpwtests_exclusive04.sh
index 438ef603f..15e031a43 100755
--- a/testcases/kernel/power_management/runpwtests_exclusive04.sh
+++ b/testcases/kernel/power_management/runpwtests_exclusive04.sh
@@ -27,7 +27,7 @@ export TST_TOTAL=2
 # Checking test environment
 check_kervel_arch
 
-tst_test_cmds python3
+tst_require_cmds python3
 
 hyper_threaded=$(is_hyper_threaded)
 multi_socket=$(is_multi_socket)
diff --git a/testcases/kernel/power_management/runpwtests_exclusive05.sh b/testcases/kernel/power_management/runpwtests_exclusive05.sh
index 3a9afdbf2..9d4e01683 100755
--- a/testcases/kernel/power_management/runpwtests_exclusive05.sh
+++ b/testcases/kernel/power_management/runpwtests_exclusive05.sh
@@ -35,7 +35,7 @@ else
 	max_sched_smt=1
 fi
 
-tst_test_cmds python3
+tst_require_cmds python3
 
 hyper_threaded=$(is_hyper_threaded)
 multi_socket=$(is_multi_socket)
diff --git a/testcases/lib/test.sh b/testcases/lib/test.sh
index 7cc3bb2fe..a15fb0540 100644
--- a/testcases/lib/test.sh
+++ b/testcases/lib/test.sh
@@ -151,7 +151,7 @@ tst_rmdir()
 #
 # Checks if commands passed as arguments exists
 #
-tst_test_cmds()
+tst_require_cmds()
 {
 	local cmd
 	for cmd in $*; do
diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
index 6c3ae708d..078b05847 100644
--- a/testcases/lib/tst_net.sh
+++ b/testcases/lib/tst_net.sh
@@ -108,7 +108,7 @@ tst_require_root_()
 
 init_ltp_netspace()
 {
-	tst_test_cmds ip
+	tst_require_cmds ip
 	tst_require_root_
 
 	local pid=
@@ -318,7 +318,7 @@ tst_get_hwaddrs()
 # LINK: link number starting from 0. Default value is '0'.
 tst_hwaddr()
 {
-	tst_test_cmds awk
+	tst_require_cmds awk
 
 	local type="${1:-lhost}"
 	local link_num="${2:-0}"
@@ -334,7 +334,7 @@ tst_hwaddr()
 # LINK: link number starting from 0. Default value is '0'.
 tst_iface()
 {
-	tst_test_cmds awk
+	tst_require_cmds awk
 
 	local type="${1:-lhost}"
 	local link_num="${2:-0}"
@@ -481,7 +481,7 @@ tst_add_ipaddr()
 # LINK: link number starting from 0. Default value is '0'.
 tst_restore_ipaddr()
 {
-	tst_test_cmds ip
+	tst_require_cmds ip
 	tst_require_root_
 
 	local type="${1:-lhost}"
@@ -651,7 +651,7 @@ tst_ping()
 	local ret=0
 
 	echo "$dst_addr" | grep -q ':' && cmd="ping6"
-	tst_test_cmds $cmd
+	tst_require_cmds $cmd
 
 	# ping cmd use 56 as default message size
 	for size in ${msg_sizes:-"56"}; do
diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index e0b24c6b9..125e3a105 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -284,7 +284,7 @@ tst_mkfs()
 		tst_brk TBROK "No device specified"
 	fi
 
-	tst_test_cmds mkfs.$fs_type
+	tst_require_cmds mkfs.$fs_type
 
 	tst_res TINFO "Formatting $device with $fs_type extra opts='$fs_opts'"
 	ROD_SILENT mkfs.$fs_type $fs_opts $device
@@ -306,7 +306,7 @@ tst_cmd_available()
 	fi
 }
 
-tst_test_cmds()
+tst_require_cmds()
 {
 	local cmd
 	for cmd in $*; do
@@ -448,7 +448,7 @@ tst_run()
 	[ "$TST_DISABLE_APPARMOR" = 1 ] && tst_disable_apparmor
 	[ "$TST_DISABLE_SELINUX" = 1 ] && tst_disable_selinux
 
-	tst_test_cmds $TST_NEEDS_CMDS
+	tst_require_cmds $TST_NEEDS_CMDS
 	tst_test_drivers $TST_NEEDS_DRIVERS
 
 	if [ -n "$TST_MIN_KVER" ]; then
@@ -513,7 +513,7 @@ tst_run()
 	#TODO check that test reports some results for each test function call
 	while [ $TST_ITERATIONS -gt 0 ]; do
 		if [ -n "$TST_TEST_DATA" ]; then
-			tst_test_cmds cut tr wc
+			tst_require_cmds cut tr wc
 			_tst_max=$(( $(echo $TST_TEST_DATA | tr -cd "$TST_TEST_DATA_IFS" | wc -c) +1))
 			for _tst_i in $(seq $_tst_max); do
 				_tst_data="$(echo "$TST_TEST_DATA" | cut -d"$TST_TEST_DATA_IFS" -f$_tst_i)"
diff --git a/testcases/network/multicast/mc_commo/mc_commo.sh b/testcases/network/multicast/mc_commo/mc_commo.sh
index 6852f17ca..b5370801a 100755
--- a/testcases/network/multicast/mc_commo/mc_commo.sh
+++ b/testcases/network/multicast/mc_commo/mc_commo.sh
@@ -36,7 +36,7 @@ TST_USE_LEGACY_API=1
 
 do_setup()
 {
-	tst_test_cmds netstat pgrep
+	tst_require_cmds netstat pgrep
 
 	OCTET=$(ps -ewf | grep [m]c_commo | wc -l | awk '{print $1}')
 	GROUP_ADDR=224.0.0.$OCTET
diff --git a/testcases/network/multicast/mc_member/mc_member.sh b/testcases/network/multicast/mc_member/mc_member.sh
index 0f41a5f2b..f41b03ace 100755
--- a/testcases/network/multicast/mc_member/mc_member.sh
+++ b/testcases/network/multicast/mc_member/mc_member.sh
@@ -38,7 +38,7 @@ TST_USE_LEGACY_API=1
 
 setup()
 {
-	tst_test_cmds netstat
+	tst_require_cmds netstat
 	tst_tmpdir
 }
 
diff --git a/testcases/network/stress/dns/dns-stress.sh b/testcases/network/stress/dns/dns-stress.sh
index 7689b28bc..dfc2ed5e0 100755
--- a/testcases/network/stress/dns/dns-stress.sh
+++ b/testcases/network/stress/dns/dns-stress.sh
@@ -43,7 +43,7 @@ cleanup()
 common_setup()
 {
 	tst_require_root
-	tst_test_cmds named dig
+	tst_require_cmds named dig
 
 	if [ "$TST_IPV6" ]; then
 		record="AAAA"
diff --git a/testcases/network/stress/ftp/ftp-download-stress.sh b/testcases/network/stress/ftp/ftp-download-stress.sh
index 75babdba0..4320bbd6f 100755
--- a/testcases/network/stress/ftp/ftp-download-stress.sh
+++ b/testcases/network/stress/ftp/ftp-download-stress.sh
@@ -42,7 +42,7 @@ cleanup()
 setup()
 {
 	tst_require_root
-	tst_test_cmds pkill vsftpd
+	tst_require_cmds pkill vsftpd
 	tst_tmpdir
 
 	tst_resm TINFO "run FTP over IPv$TST_IPVER"
diff --git a/testcases/network/stress/ftp/ftp-download-stress01-rmt.sh b/testcases/network/stress/ftp/ftp-download-stress01-rmt.sh
index a87f2ac0a..54f43d02f 100755
--- a/testcases/network/stress/ftp/ftp-download-stress01-rmt.sh
+++ b/testcases/network/stress/ftp/ftp-download-stress01-rmt.sh
@@ -28,7 +28,7 @@ server_ipaddr="$1"
 filename="$2"
 filesize="$3"
 
-tst_test_cmds curl
+tst_require_cmds curl
 
 echo $server_ipaddr | grep ':' > /dev/null
 if [ $? -eq 0 ]; then
diff --git a/testcases/network/stress/ftp/ftp-download-stress02-rmt.sh b/testcases/network/stress/ftp/ftp-download-stress02-rmt.sh
index 95a8a411c..599d21055 100755
--- a/testcases/network/stress/ftp/ftp-download-stress02-rmt.sh
+++ b/testcases/network/stress/ftp/ftp-download-stress02-rmt.sh
@@ -24,7 +24,7 @@ TST_TOTAL=1
 
 . test.sh
 
-tst_test_cmds awk killall
+tst_require_cmds awk killall
 
 server_ipaddr="$1"
 filename="$2"
diff --git a/testcases/network/stress/ftp/ftp-upload-stress.sh b/testcases/network/stress/ftp/ftp-upload-stress.sh
index 5b8fb740a..602dc4ed6 100755
--- a/testcases/network/stress/ftp/ftp-upload-stress.sh
+++ b/testcases/network/stress/ftp/ftp-upload-stress.sh
@@ -42,7 +42,7 @@ cleanup()
 setup()
 {
 	tst_require_root
-	tst_test_cmds pkill vsftpd
+	tst_require_cmds pkill vsftpd
 	tst_tmpdir
 
 	tst_resm TINFO "run FTP over IPv$TST_IPVER"
@@ -57,7 +57,7 @@ setup()
 	getenforce 2> /dev/null | grep -q Enforcing
 	if [ $? -eq 0 ]; then
 		tst_resm TINFO "configuring SELinux FTP parameters"
-		tst_test_cmds chcon setsebool
+		tst_require_cmds chcon setsebool
 		setsebool allow_ftpd_anon_write 1 || \
 			tst_brkm TBROK "Failed to allow ftpd anonymous write"
 		chcon -R -t public_content_rw_t $FTP_UPLOAD_DIR || \
diff --git a/testcases/network/stress/ftp/ftp-upload-stress01-rmt.sh b/testcases/network/stress/ftp/ftp-upload-stress01-rmt.sh
index 0042f09b1..d4a9fe903 100755
--- a/testcases/network/stress/ftp/ftp-upload-stress01-rmt.sh
+++ b/testcases/network/stress/ftp/ftp-upload-stress01-rmt.sh
@@ -30,7 +30,7 @@ urldir="$2"
 filename="$3"
 filesize="$4"
 
-tst_test_cmds curl
+tst_require_cmds curl
 
 cleanup()
 {
diff --git a/testcases/network/stress/ftp/ftp-upload-stress02-rmt.sh b/testcases/network/stress/ftp/ftp-upload-stress02-rmt.sh
index d266fb2ca..cba8f32cf 100755
--- a/testcases/network/stress/ftp/ftp-upload-stress02-rmt.sh
+++ b/testcases/network/stress/ftp/ftp-upload-stress02-rmt.sh
@@ -25,7 +25,7 @@ TST_CLEANUP="cleanup"
 
 . test.sh
 
-tst_test_cmds killall
+tst_require_cmds killall
 
 server_ipaddr="$1"
 urldir="$2"
diff --git a/testcases/network/stress/http/http-stress01-rmt.sh b/testcases/network/stress/http/http-stress01-rmt.sh
index 69abcf070..dcea6866b 100755
--- a/testcases/network/stress/http/http-stress01-rmt.sh
+++ b/testcases/network/stress/http/http-stress01-rmt.sh
@@ -24,7 +24,7 @@ TST_TOTAL=1
 
 . test.sh
 
-tst_test_cmds awk curl
+tst_require_cmds awk curl
 
 # Check the arguments
 [ $# -ne 3 ] && tst_brkm TBROK "Usage: $0 server_ipaddr filename filesize"
diff --git a/testcases/network/stress/http/http-stress02-rmt.sh b/testcases/network/stress/http/http-stress02-rmt.sh
index 52efc92cc..1734c2bd3 100755
--- a/testcases/network/stress/http/http-stress02-rmt.sh
+++ b/testcases/network/stress/http/http-stress02-rmt.sh
@@ -24,7 +24,7 @@ TST_TOTAL=1
 
 . test.sh
 
-tst_test_cmds awk curl
+tst_require_cmds awk curl
 
 if [ $# -ne 5 ]; then
 	tst_brkm TBROK "Usage: $0 server_addr fname fsize duration connections"
diff --git a/testcases/network/stress/interface/if-lib.sh b/testcases/network/stress/interface/if-lib.sh
index 90030a146..b398be1ad 100644
--- a/testcases/network/stress/interface/if-lib.sh
+++ b/testcases/network/stress/interface/if-lib.sh
@@ -30,7 +30,7 @@ if_setup()
 		tst_brk TBROK "Missing or wrong -c parameter: '$CMD', use 'ip' or '$IF_CMD'"
 	fi
 
-	tst_test_cmds "$CMD"
+	tst_require_cmds "$CMD"
 	netstress_setup
 	TST_CLEANUP="${TST_CLEANUP:-netstress_cleanup}"
 }
diff --git a/testcases/network/stress/ns-tools/tst_net_stress.sh b/testcases/network/stress/ns-tools/tst_net_stress.sh
index c686ae4b8..ae040bcf1 100644
--- a/testcases/network/stress/ns-tools/tst_net_stress.sh
+++ b/testcases/network/stress/ns-tools/tst_net_stress.sh
@@ -26,7 +26,7 @@ MCAST_IPV6_ADDR="${MCAST_IPV6_ADDR_PREFIX}:1"
 netstress_setup()
 {
 	TST_NEEDS_ROOT=1
-	tst_test_cmds pgrep pkill
+	tst_require_cmds pgrep pkill
 }
 
 # Cleanup for tests using netstress.
diff --git a/testcases/network/stress/ssh/ssh-stress.sh b/testcases/network/stress/ssh/ssh-stress.sh
index c4299a4a9..516bce765 100755
--- a/testcases/network/stress/ssh/ssh-stress.sh
+++ b/testcases/network/stress/ssh/ssh-stress.sh
@@ -46,7 +46,7 @@ setup()
 	trap "tst_brkm TBROK 'test interrupted'" INT
 
 	tst_require_root
-	tst_test_cmds pkill sshd ssh od
+	tst_require_cmds pkill sshd ssh od
 
 	# Get the sshd command with absolute path
 	SSHD=$(which sshd)
diff --git a/testcases/network/tcp_cmds/ipneigh/ipneigh01.sh b/testcases/network/tcp_cmds/ipneigh/ipneigh01.sh
index 852b32f1c..e15dd708c 100755
--- a/testcases/network/tcp_cmds/ipneigh/ipneigh01.sh
+++ b/testcases/network/tcp_cmds/ipneigh/ipneigh01.sh
@@ -34,7 +34,7 @@ do_setup()
 		;;
 	esac
 
-	tst_test_cmds $CMD ping$TST_IPV6
+	tst_require_cmds $CMD ping$TST_IPV6
 }
 
 usage()
diff --git a/testcases/network/tcp_cmds/ping/ping01.sh b/testcases/network/tcp_cmds/ping/ping01.sh
index 9e5828645..bc9c1f99b 100755
--- a/testcases/network/tcp_cmds/ping/ping01.sh
+++ b/testcases/network/tcp_cmds/ping/ping01.sh
@@ -23,7 +23,7 @@ do_setup()
 
 	PING_CMD=ping${TST_IPV6}
 
-	tst_test_cmds $PING_CMD
+	tst_require_cmds $PING_CMD
 }
 
 do_test()
diff --git a/testcases/network/tcp_cmds/ping/ping02.sh b/testcases/network/tcp_cmds/ping/ping02.sh
index b245210c5..e0a63c5f6 100755
--- a/testcases/network/tcp_cmds/ping/ping02.sh
+++ b/testcases/network/tcp_cmds/ping/ping02.sh
@@ -15,7 +15,7 @@ do_setup()
 
 	PING=ping${TST_IPV6}
 
-	tst_test_cmds $PING
+	tst_require_cmds $PING
 }
 
 do_test()
diff --git a/testcases/network/tcp_cmds/rlogin/rlogin01.sh b/testcases/network/tcp_cmds/rlogin/rlogin01.sh
index 260e238f2..c34ab1c4e 100755
--- a/testcases/network/tcp_cmds/rlogin/rlogin01.sh
+++ b/testcases/network/tcp_cmds/rlogin/rlogin01.sh
@@ -25,7 +25,7 @@ TST_USE_LEGACY_API=1
 
 setup()
 {
-	tst_test_cmds rlogin expect
+	tst_require_cmds rlogin expect
 
 	if [ -z $RUSER ]; then
 		RUSER=root
diff --git a/testcases/network/tcp_cmds/sendfile/sendfile01.sh b/testcases/network/tcp_cmds/sendfile/sendfile01.sh
index 1677ec305..1e4739ad2 100755
--- a/testcases/network/tcp_cmds/sendfile/sendfile01.sh
+++ b/testcases/network/tcp_cmds/sendfile/sendfile01.sh
@@ -47,7 +47,7 @@ do_setup()
 
 	FILES=${FILES:-"ascii.sm ascii.med ascii.lg ascii.jmb"}
 
-	tst_test_cmds diff stat
+	tst_require_cmds diff stat
 
 	tst_tmpdir
 }
diff --git a/testcases/network/tcp_cmds/tcpdump/tcpdump01.sh b/testcases/network/tcp_cmds/tcpdump/tcpdump01.sh
index e8ecdec98..32953e7e0 100755
--- a/testcases/network/tcp_cmds/tcpdump/tcpdump01.sh
+++ b/testcases/network/tcp_cmds/tcpdump/tcpdump01.sh
@@ -29,7 +29,7 @@ TST_CLEANUP=do_cleanup
 do_setup()
 {
 	ping_cmd=ping$TST_IPV6
-	tst_test_cmds tcpdump kill $ping_cmd
+	tst_require_cmds tcpdump kill $ping_cmd
 	outfile="tcpdump_out"
 	numloops=20
 	tst_tmpdir
diff --git a/testcases/network/tcp_cmds/telnet/telnet01.sh b/testcases/network/tcp_cmds/telnet/telnet01.sh
index d87cc8bb6..a6e6024fb 100755
--- a/testcases/network/tcp_cmds/telnet/telnet01.sh
+++ b/testcases/network/tcp_cmds/telnet/telnet01.sh
@@ -25,7 +25,7 @@ TST_USE_LEGACY_API=1
 
 setup()
 {
-	tst_test_cmds telnet expect
+	tst_require_cmds telnet expect
 
 	if [ -z $RUSER ]; then
 		RUSER=root
diff --git a/testcases/network/tcp_cmds/tracepath/tracepath01.sh b/testcases/network/tcp_cmds/tracepath/tracepath01.sh
index 037fca066..2b75c1004 100755
--- a/testcases/network/tcp_cmds/tracepath/tracepath01.sh
+++ b/testcases/network/tcp_cmds/tracepath/tracepath01.sh
@@ -16,7 +16,7 @@ setup()
 		cmd="tracepath$TST_IPVER"
 		tst_cmd_available $cmd || cmd="tracepath -6"
 	fi
-	tst_test_cmds $(echo $cmd | cut -f 1 -d' ')
+	tst_require_cmds $(echo $cmd | cut -f 1 -d' ')
 
 	if $cmd -V >/dev/null 2>&1; then
 		tst_res TINFO "traceroute version:"
diff --git a/testcases/network/virt/virt_lib.sh b/testcases/network/virt/virt_lib.sh
index 2be0ffbe1..f488932ff 100644
--- a/testcases/network/virt/virt_lib.sh
+++ b/testcases/network/virt/virt_lib.sh
@@ -50,7 +50,7 @@ virt_lib_setup()
 	;;
 	esac
 
-	tst_test_cmds "ip"
+	tst_require_cmds "ip"
 
 	virt_add ltp_v0 || \
 		tst_brk TCONF "iproute2 or kernel doesn't support $virt_type"
@@ -256,7 +256,7 @@ vxlan_setup_subnet_uni()
 
 vxlan_setup_subnet_multi()
 {
-	tst_test_cmds "od"
+	tst_require_cmds "od"
 	local b1=$(($(od -An -d -N1 /dev/urandom) % 254 + 1))
 	local b2=$(($(od -An -d -N1 /dev/urandom) % 254 + 1))
 	local b3=$(($(od -An -d -N1 /dev/urandom) % 254 + 1))
diff --git a/testcases/network/xinetd/xinetd_tests.sh b/testcases/network/xinetd/xinetd_tests.sh
index f7fa77f74..e2c2dfd8d 100755
--- a/testcases/network/xinetd/xinetd_tests.sh
+++ b/testcases/network/xinetd/xinetd_tests.sh
@@ -30,7 +30,7 @@ setup()
 
 	tst_tmpdir
 
-	tst_test_cmds xinetd diff telnet
+	tst_require_cmds xinetd diff telnet
 
 	check_addr="127.0.0.1"
 	ip a | grep -q inet6 && check_addr="$check_addr ::1"
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [LTP] [PATCH 2/2] shell: Rename s/tst_test_drivers/tst_require_drivers/
  2019-10-11  9:07 [LTP] Rename tst_test_* to tst_require_* Joerg Vehlow
  2019-10-11  9:07 ` [LTP] [PATCH 1/2] shell: Rename s/tst_test_cmds/tst_require_cmds/ Joerg Vehlow
@ 2019-10-11  9:07 ` Joerg Vehlow
  2019-10-11 10:06 ` [LTP] Rename tst_test_* to tst_require_* Petr Vorel
  2 siblings, 0 replies; 16+ messages in thread
From: Joerg Vehlow @ 2019-10-11  9:07 UTC (permalink / raw)
  To: ltp

From: Joerg Vehlow <joerg.vehlow@aox-tech.de>

This require describes the function of the command better than test.
"tst_require_root" is also a well established name in ltp api with the
same semantic.

Signed-off-by: Joerg Vehlow <joerg.vehlow@aox-tech.de>
---
 testcases/lib/tst_test.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index 125e3a105..4c9a92c2c 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -326,7 +326,7 @@ tst_check_cmds()
 	return 0
 }
 
-tst_test_drivers()
+tst_require_drivers()
 {
 	[ $# -eq 0 ] && return 0
 
@@ -449,7 +449,7 @@ tst_run()
 	[ "$TST_DISABLE_SELINUX" = 1 ] && tst_disable_selinux
 
 	tst_require_cmds $TST_NEEDS_CMDS
-	tst_test_drivers $TST_NEEDS_DRIVERS
+	tst_require_drivers $TST_NEEDS_DRIVERS
 
 	if [ -n "$TST_MIN_KVER" ]; then
 		tst_kvcmp -lt "$TST_MIN_KVER" && \
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [LTP] Rename tst_test_* to tst_require_*
  2019-10-11  9:07 [LTP] Rename tst_test_* to tst_require_* Joerg Vehlow
  2019-10-11  9:07 ` [LTP] [PATCH 1/2] shell: Rename s/tst_test_cmds/tst_require_cmds/ Joerg Vehlow
  2019-10-11  9:07 ` [LTP] [PATCH 2/2] shell: Rename s/tst_test_drivers/tst_require_drivers/ Joerg Vehlow
@ 2019-10-11 10:06 ` Petr Vorel
  2019-10-11 12:36   ` Cyril Hrubis
  2019-10-11 13:03   ` Clemens Famulla-Conrad
  2 siblings, 2 replies; 16+ messages in thread
From: Petr Vorel @ 2019-10-11 10:06 UTC (permalink / raw)
  To: ltp

Hi,

Cc: Li and Clemens

> these patches rename tst_test_* to tst_require_*, to better describe
> their use. There is also tst_require_root, that has the same
> behavior: It also calls tst_brk in case of a failing requirement.

> You can also get this patch from the following repo:
> https://github.com/MofX/ltp/commits/rename_tst_test-tst_require

sorry for not thinking first, I wonder if we want to sync
tst_test_* (function name) vs $TST_NEEDS_* (test API variable name),
e.g.: tst_require_drivers $TST_NEEDS_DRIVERS

i.e. either of these:
s/tst_test_/tst_needs_/
s/TST_NEEDS_/TST_REQUIRE_/

I consider *require* as more descriptive than *needs*,
but changing to *require* would require more work :).

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [LTP] Rename tst_test_* to tst_require_*
  2019-10-11 10:06 ` [LTP] Rename tst_test_* to tst_require_* Petr Vorel
@ 2019-10-11 12:36   ` Cyril Hrubis
  2019-10-11 13:03   ` Clemens Famulla-Conrad
  1 sibling, 0 replies; 16+ messages in thread
From: Cyril Hrubis @ 2019-10-11 12:36 UTC (permalink / raw)
  To: ltp

Hi!
> > these patches rename tst_test_* to tst_require_*, to better describe
> > their use. There is also tst_require_root, that has the same
> > behavior: It also calls tst_brk in case of a failing requirement.
> 
> > You can also get this patch from the following repo:
> > https://github.com/MofX/ltp/commits/rename_tst_test-tst_require
> 
> sorry for not thinking first, I wonder if we want to sync
> tst_test_* (function name) vs $TST_NEEDS_* (test API variable name),
> e.g.: tst_require_drivers $TST_NEEDS_DRIVERS
> 
> i.e. either of these:
> s/tst_test_/tst_needs_/
> s/TST_NEEDS_/TST_REQUIRE_/

I guess that I started bike-shedding here, I should have been silent I
guess...

I do consider this names to mean something different in the contexts,
i.e. "needs" is something that is expressed in metadata, while "require"
is part of a function name. But hey I'm by no means native speaker, so
who know, and also I would prefer to work on the actual code, which is
more fruitful than API renames.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [LTP] Rename tst_test_* to tst_require_*
  2019-10-11 10:06 ` [LTP] Rename tst_test_* to tst_require_* Petr Vorel
  2019-10-11 12:36   ` Cyril Hrubis
@ 2019-10-11 13:03   ` Clemens Famulla-Conrad
  2019-10-11 13:10     ` Cyril Hrubis
                       ` (2 more replies)
  1 sibling, 3 replies; 16+ messages in thread
From: Clemens Famulla-Conrad @ 2019-10-11 13:03 UTC (permalink / raw)
  To: ltp

On Fri, 2019-10-11 at 12:06 +0200, Petr Vorel wrote:
> Hi,
> 
> Cc: Li and Clemens
> 
> > these patches rename tst_test_* to tst_require_*, to better
> > describe
> > their use. There is also tst_require_root, that has the same
> > behavior: It also calls tst_brk in case of a failing requirement.
> > You can also get this patch from the following repo:
> > https://github.com/MofX/ltp/commits/rename_tst_test-tst_require
> 
> sorry for not thinking first, I wonder if we want to sync
> tst_test_* (function name) vs $TST_NEEDS_* (test API variable name),
> e.g.: tst_require_drivers $TST_NEEDS_DRIVERS

I fully agree with Petr that we must be consistent in naming between
variable- and function-name.

> 
> i.e. either of these:
> s/tst_test_/tst_needs_/
> s/TST_NEEDS_/TST_REQUIRE_/
> 
> I consider *require* as more descriptive than *needs*,
> but changing to *require* would require more work :).

If we use needs or require ? Hard question - when I search for synonyms
from one or the other, I don't see a big different. Without looking on
the impact, require sounds also more descriptive.

thx, Clemens

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [LTP] Rename tst_test_* to tst_require_*
  2019-10-11 13:03   ` Clemens Famulla-Conrad
@ 2019-10-11 13:10     ` Cyril Hrubis
  2019-10-11 14:00       ` Petr Vorel
  2019-10-11 13:28     ` Li Wang
  2019-10-11 13:39     ` Joerg Vehlow
  2 siblings, 1 reply; 16+ messages in thread
From: Cyril Hrubis @ 2019-10-11 13:10 UTC (permalink / raw)
  To: ltp

Hi!
> If we use needs or require ? Hard question - when I search for synonyms
> from one or the other, I don't see a big different. Without looking on
> the impact, require sounds also more descriptive.

There is about thousand of uses of *NEEDS_FOO and *needs_foo in the new
library tests, so renaming to tst_needs_foo would be the least painful.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [LTP] Rename tst_test_* to tst_require_*
  2019-10-11 13:03   ` Clemens Famulla-Conrad
  2019-10-11 13:10     ` Cyril Hrubis
@ 2019-10-11 13:28     ` Li Wang
  2019-10-11 13:39     ` Joerg Vehlow
  2 siblings, 0 replies; 16+ messages in thread
From: Li Wang @ 2019-10-11 13:28 UTC (permalink / raw)
  To: ltp

On Fri, Oct 11, 2019 at 9:03 PM Clemens Famulla-Conrad <
cfamullaconrad@suse.de> wrote:

> On Fri, 2019-10-11 at 12:06 +0200, Petr Vorel wrote:
> > Hi,
> >
> > Cc: Li and Clemens
> >
> > > these patches rename tst_test_* to tst_require_*, to better
> > > describe
> > > their use. There is also tst_require_root, that has the same
> > > behavior: It also calls tst_brk in case of a failing requirement.
> > > You can also get this patch from the following repo:
> > > https://github.com/MofX/ltp/commits/rename_tst_test-tst_require
> >
> > sorry for not thinking first, I wonder if we want to sync
> > tst_test_* (function name) vs $TST_NEEDS_* (test API variable name),
> > e.g.: tst_require_drivers $TST_NEEDS_DRIVERS
>
> I fully agree with Petr that we must be consistent in naming between
> variable- and function-name.
>

+1


>
> >
> > i.e. either of these:
> > s/tst_test_/tst_needs_/
> > s/TST_NEEDS_/TST_REQUIRE_/
> >
> > I consider *require* as more descriptive than *needs*,
> > but changing to *require* would require more work :).
>
> If we use needs or require ? Hard question - when I search for synonyms
> from one or the other, I don't see a big different. Without looking on
> the impact, require sounds also more descriptive.
>

Yes, I have the same feeling here.

FYI:
  needs: because it's important
  require: because it's a necessity

https://www.englishcurrent.com/grammar/difference-need-require-verbs/

-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20191011/f0a81006/attachment-0001.htm>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [LTP] Rename tst_test_* to tst_require_*
  2019-10-11 13:03   ` Clemens Famulla-Conrad
  2019-10-11 13:10     ` Cyril Hrubis
  2019-10-11 13:28     ` Li Wang
@ 2019-10-11 13:39     ` Joerg Vehlow
  2 siblings, 0 replies; 16+ messages in thread
From: Joerg Vehlow @ 2019-10-11 13:39 UTC (permalink / raw)
  To: ltp


> On Fri, 2019-10-11 at 12:06 +0200, Petr Vorel wrote:
>> Hi,
>>
>> Cc: Li and Clemens
>>
>>> these patches rename tst_test_* to tst_require_*, to better
>>> describe
>>> their use. There is also tst_require_root, that has the same
>>> behavior: It also calls tst_brk in case of a failing requirement.
>>> You can also get this patch from the following repo:
>>> https://github.com/MofX/ltp/commits/rename_tst_test-tst_require
>> sorry for not thinking first, I wonder if we want to sync
>> tst_test_* (function name) vs $TST_NEEDS_* (test API variable name),
>> e.g.: tst_require_drivers $TST_NEEDS_DRIVERS
> I fully agree with Petr that we must be consistent in naming between
> variable- and function-name.
Actually I am more with cyril's reasoning, that one is metadata and one 
is function call here.
It wasn't consistent in the past. The require is more like an imperative 
here and the needs is
descriptive.
I'm also no native speaker, but in my opinon needing a command sounds a 
bit strange.
One thing I found is that a need is required for living, while a 
requirement must be
fulfilled, for something to happen. With this definition requirement 
fits. There is also the term
requierement in software engineering and no term "needment"

But strangely I still have no problem with TST_NEEDS_*, but I would also 
be ok with
TST_REQUIRES_. Actually I'd propably chose it, if I was designing the 
library.

I do not really like renaming tst_test_* to test_needs_*. Needs does not 
sound
strong enough to me in that context.? But I just made a quick search for 
"needs_"
and there is so much needs in the c library as well, that touching all 
of this is maybe
to much.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [LTP] Rename tst_test_* to tst_require_*
  2019-10-11 13:10     ` Cyril Hrubis
@ 2019-10-11 14:00       ` Petr Vorel
  2019-10-24 12:28         ` Cyril Hrubis
  0 siblings, 1 reply; 16+ messages in thread
From: Petr Vorel @ 2019-10-11 14:00 UTC (permalink / raw)
  To: ltp

Hi,

> > If we use needs or require ? Hard question - when I search for synonyms
> > from one or the other, I don't see a big different. Without looking on
> > the impact, require sounds also more descriptive.

> There is about thousand of uses of *NEEDS_FOO and *needs_foo in the new
> library tests, so renaming to tst_needs_foo would be the least painful.
+1.

Sorry for starting such a big discussion just about API naming.
I care about these things, because good docs and consistent API are less
important than good quality code, but helps new users.

Thank you for all your input, I agree with points other raised, but getting it
right would be to intrusive change (touching every test is a bit too much).

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [LTP] Rename tst_test_* to tst_require_*
  2019-10-11 14:00       ` Petr Vorel
@ 2019-10-24 12:28         ` Cyril Hrubis
  2019-10-24 12:48           ` Petr Vorel
  0 siblings, 1 reply; 16+ messages in thread
From: Cyril Hrubis @ 2019-10-24 12:28 UTC (permalink / raw)
  To: ltp

Hi!
> > > If we use needs or require ? Hard question - when I search for synonyms
> > > from one or the other, I don't see a big different. Without looking on
> > > the impact, require sounds also more descriptive.
> 
> > There is about thousand of uses of *NEEDS_FOO and *needs_foo in the new
> > library tests, so renaming to tst_needs_foo would be the least painful.
> +1.
> 
> Sorry for starting such a big discussion just about API naming.
> I care about these things, because good docs and consistent API are less
> important than good quality code, but helps new users.
> 
> Thank you for all your input, I agree with points other raised, but getting it
> right would be to intrusive change (touching every test is a bit too much).

I would like to end the bikeshedding now and also get the tests fixed so
here is the proposal. If anyone wants to send a patch that unifies the
API on tst_needs_* please do so. If no one starts at least working on
that in a week or two, let's merge this patchset. Does that sound
reasonable to everyone?

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [LTP] Rename tst_test_* to tst_require_*
  2019-10-24 12:28         ` Cyril Hrubis
@ 2019-10-24 12:48           ` Petr Vorel
  2019-11-06 16:26             ` Cyril Hrubis
  0 siblings, 1 reply; 16+ messages in thread
From: Petr Vorel @ 2019-10-24 12:48 UTC (permalink / raw)
  To: ltp

Hi,

> I would like to end the bikeshedding now and also get the tests fixed so
> here is the proposal. If anyone wants to send a patch that unifies the
> API on tst_needs_* please do so. If no one starts at least working on
> that in a week or two, let's merge this patchset. Does that sound
> reasonable to everyone?
+1

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [LTP] Rename tst_test_* to tst_require_*
  2019-10-24 12:48           ` Petr Vorel
@ 2019-11-06 16:26             ` Cyril Hrubis
  2019-11-06 17:01               ` Petr Vorel
  2019-11-07 11:32               ` Petr Vorel
  0 siblings, 2 replies; 16+ messages in thread
From: Cyril Hrubis @ 2019-11-06 16:26 UTC (permalink / raw)
  To: ltp

Hi!
> > I would like to end the bikeshedding now and also get the tests fixed so
> > here is the proposal. If anyone wants to send a patch that unifies the
> > API on tst_needs_* please do so. If no one starts at least working on
> > that in a week or two, let's merge this patchset. Does that sound
> > reasonable to everyone?

Gentle reminder, this timeouts tomorrow when I will apply the original
patches, unless someone steps in.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [LTP] Rename tst_test_* to tst_require_*
  2019-11-06 16:26             ` Cyril Hrubis
@ 2019-11-06 17:01               ` Petr Vorel
  2019-11-07 11:09                 ` Petr Vorel
  2019-11-07 11:32               ` Petr Vorel
  1 sibling, 1 reply; 16+ messages in thread
From: Petr Vorel @ 2019-11-06 17:01 UTC (permalink / raw)
  To: ltp

Hi,

> > > I would like to end the bikeshedding now and also get the tests fixed so
> > > here is the proposal. If anyone wants to send a patch that unifies the
> > > API on tst_needs_* please do so. If no one starts at least working on
> > > that in a week or two, let's merge this patchset. Does that sound
> > > reasonable to everyone?

> Gentle reminder, this timeouts tomorrow when I will apply the original
> patches, unless someone steps in.
OK, if nobody objects, tomorrow I'll modify Joerg's patchset to be
"Rename tst_test_* to tst_needs_*" and push it on his behalf.

I like *require* more, but it's better to have the same name for variables
and functions.

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [LTP] Rename tst_test_* to tst_require_*
  2019-11-06 17:01               ` Petr Vorel
@ 2019-11-07 11:09                 ` Petr Vorel
  0 siblings, 0 replies; 16+ messages in thread
From: Petr Vorel @ 2019-11-07 11:09 UTC (permalink / raw)
  To: ltp

Hi,

> > Gentle reminder, this timeouts tomorrow when I will apply the original
> > patches, unless someone steps in.
> OK, if nobody objects, tomorrow I'll modify Joerg's patchset to be
> "Rename tst_test_* to tst_needs_*" and push it on his behalf.

> I like *require* more, but it's better to have the same name for variables
> and functions.
Actually thinking about it twice, I'm going to apply the original patch.
*require* is really more descriptive.

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [LTP] Rename tst_test_* to tst_require_*
  2019-11-06 16:26             ` Cyril Hrubis
  2019-11-06 17:01               ` Petr Vorel
@ 2019-11-07 11:32               ` Petr Vorel
  1 sibling, 0 replies; 16+ messages in thread
From: Petr Vorel @ 2019-11-07 11:32 UTC (permalink / raw)
  To: ltp

Hi,

> > > I would like to end the bikeshedding now and also get the tests fixed so
> > > here is the proposal. If anyone wants to send a patch that unifies the
> > > API on tst_needs_* please do so. If no one starts at least working on
> > > that in a week or two, let's merge this patchset. Does that sound
> > > reasonable to everyone?

> Gentle reminder, this timeouts tomorrow when I will apply the original
> patches, unless someone steps in.
Merged this patch (rebased).
Thanks all for their input.

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2019-11-07 11:32 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-11  9:07 [LTP] Rename tst_test_* to tst_require_* Joerg Vehlow
2019-10-11  9:07 ` [LTP] [PATCH 1/2] shell: Rename s/tst_test_cmds/tst_require_cmds/ Joerg Vehlow
2019-10-11  9:07 ` [LTP] [PATCH 2/2] shell: Rename s/tst_test_drivers/tst_require_drivers/ Joerg Vehlow
2019-10-11 10:06 ` [LTP] Rename tst_test_* to tst_require_* Petr Vorel
2019-10-11 12:36   ` Cyril Hrubis
2019-10-11 13:03   ` Clemens Famulla-Conrad
2019-10-11 13:10     ` Cyril Hrubis
2019-10-11 14:00       ` Petr Vorel
2019-10-24 12:28         ` Cyril Hrubis
2019-10-24 12:48           ` Petr Vorel
2019-11-06 16:26             ` Cyril Hrubis
2019-11-06 17:01               ` Petr Vorel
2019-11-07 11:09                 ` Petr Vorel
2019-11-07 11:32               ` Petr Vorel
2019-10-11 13:28     ` Li Wang
2019-10-11 13:39     ` Joerg Vehlow

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.