* [LTP] [PATCH 1/3] shell: Remove old kernel version check below 3.10
@ 2022-12-27 9:20 Yang Xu
2022-12-27 9:20 ` [LTP] [PATCH 2/3] Remove old kernel version check when using tst_kvercmp under 3.10 Yang Xu
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Yang Xu @ 2022-12-27 9:20 UTC (permalink / raw)
To: ltp
We have raised the minimal kernel version from 3.0 to 3.10,
so remove these useless check.
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
doc/shell-test-api.txt | 6 +++---
.../tracing/dynamic_debug/dynamic_debug01.sh | 16 ++++------------
testcases/network/virt/virt_lib.sh | 8 --------
3 files changed, 7 insertions(+), 23 deletions(-)
diff --git a/doc/shell-test-api.txt b/doc/shell-test-api.txt
index 7f0ca02a7..df6a56874 100644
--- a/doc/shell-test-api.txt
+++ b/doc/shell-test-api.txt
@@ -661,9 +661,9 @@ if tst_kvcmp -le 4.0.0; then
tst_brk TCONF "Kernel newer than 4.0.0 is needed"
fi
-# Exit the test if kernel is newer than 3.8 and older than 4.0.1
-if tst_kvcmp -gt 3.8 -a -lt 4.0.1; then
- tst_brk TCONF "Kernel must be older than 3.8 or newer than 4.0.1"
+# Exit the test if kernel is newer than 3.16 and older than 4.0.1
+if tst_kvcmp -gt 3.16 -a -lt 4.0.1; then
+ tst_brk TCONF "Kernel must be older than 3.16 or newer than 4.0.1"
fi
-------------------------------------------------------------------------------
diff --git a/testcases/kernel/tracing/dynamic_debug/dynamic_debug01.sh b/testcases/kernel/tracing/dynamic_debug/dynamic_debug01.sh
index 9d0575b90..ebb961fd9 100755
--- a/testcases/kernel/tracing/dynamic_debug/dynamic_debug01.sh
+++ b/testcases/kernel/tracing/dynamic_debug/dynamic_debug01.sh
@@ -21,8 +21,7 @@ DEBUGFS_WAS_MOUNTED=0
DEBUGFS_PATH=""
DEBUGFS_CONTROL=""
DYNDEBUG_STATEMENTS="./debug_statements"
-EMPTY_FLAG="-"
-NEW_INTERFACE=0
+EMPTY_FLAG="=_"
mount_debugfs()
{
@@ -55,11 +54,6 @@ setup()
tst_brk TBROK "Unable to find $DEBUGFS_CONTROL"
fi
- if tst_kvcmp -ge 3.4 ; then
- NEW_INTERFACE=1
- EMPTY_FLAG="=_"
- fi
-
grep -v "^#" "$DEBUGFS_CONTROL" > "$DYNDEBUG_STATEMENTS"
}
@@ -83,10 +77,8 @@ do_all_flags()
for INPUT_LINE in $ALL_INPUTS; do
do_flag "+p" "$OPTION" "$INPUT_LINE"
- if tst_kvcmp -ge 3.2 || [ $NEW_INTERFACE -eq 1 ] ; then
- do_flag "+flmt" "$OPTION" "$INPUT_LINE"
- do_flag "-flmt" "$OPTION" "$INPUT_LINE"
- fi
+ do_flag "+flmt" "$OPTION" "$INPUT_LINE"
+ do_flag "-flmt" "$OPTION" "$INPUT_LINE"
do_flag "-p" "$OPTION" "$INPUT_LINE"
done
@@ -131,7 +123,7 @@ cleanup()
FLAGS_SET=$(awk -v emp="$EMPTY_FLAG" '$3 != emp' $DYNDEBUG_STATEMENTS)
fi
if [ "$FLAGS_SET" ] ; then
- FLAG_PREFIX=$([ $NEW_INTERFACE -eq 1 ] && echo "" || echo "+")
+ FLAG_PREFIX=$(echo "")
/bin/echo "$FLAGS_SET" | while read -r FLAG_LINE ; do
/bin/echo -n "$FLAG_LINE" \
| awk -v prf="$FLAG_PREFIX" -F " |:" \
diff --git a/testcases/network/virt/virt_lib.sh b/testcases/network/virt/virt_lib.sh
index 98a9bb6aa..e919bc3a5 100644
--- a/testcases/network/virt/virt_lib.sh
+++ b/testcases/network/virt/virt_lib.sh
@@ -44,10 +44,6 @@ virt_lib_setup()
{
case "$virt_type" in
vxlan|geneve)
- if tst_kvcmp -lt "3.8"; then
- tst_brk TCONF "test must be run with kernel 3.8 or newer"
- fi
-
if [ "$TST_IPV6" ] && tst_kvcmp -lt "3.12"; then
tst_brk TCONF "test must be run with kernels >= 3.12"
fi
@@ -252,10 +248,6 @@ virt_minimize_timeout()
vxlan_setup_subnet_uni()
{
- if tst_kvcmp -lt "3.10"; then
- tst_brk TCONF "test must be run with kernel 3.10 or newer"
- fi
-
[ "$(ip link add type $virt_type help 2>&1 | grep remote)" ] || \
tst_brk TCONF "iproute doesn't support remote unicast address"
--
2.31.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [LTP] [PATCH 2/3] Remove old kernel version check when using tst_kvercmp under 3.10
2022-12-27 9:20 [LTP] [PATCH 1/3] shell: Remove old kernel version check below 3.10 Yang Xu
@ 2022-12-27 9:20 ` Yang Xu
2023-01-02 12:01 ` Petr Vorel
2022-12-27 9:20 ` [LTP] [PATCH 3/3] Remove old kernel version check when using min_kver " Yang Xu
2023-01-02 9:37 ` [LTP] [PATCH 1/3] shell: Remove old kernel version check below 3.10 Petr Vorel
2 siblings, 1 reply; 9+ messages in thread
From: Yang Xu @ 2022-12-27 9:20 UTC (permalink / raw)
To: ltp
We have raised the minimal kernel version from 3.0 to 3.10,
so remove these useless check.
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
include/lapi/init_module.h | 12 ------------
.../kernel/containers/userns/userns_helper.h | 3 ---
.../controllers/cgroup_xattr/cgroup_xattr.c | 5 -----
testcases/kernel/device-drivers/acpi/ltp_acpi.c | 15 ---------------
.../kernel/firmware/fw_load_user/fw_load.c | 5 -----
testcases/kernel/input/input_helper.c | 17 ++++-------------
.../security/prot_hsymlinks/prot_hsymlinks.c | 4 ----
.../kernel/syscalls/fallocate/fallocate04.c | 9 ++-------
.../syscalls/finit_module/finit_module01.c | 2 --
.../syscalls/finit_module/finit_module02.c | 2 --
testcases/kernel/syscalls/ioctl/ioctl01.c | 8 --------
testcases/kernel/syscalls/ipc/msgrcv/msgrcv07.c | 3 +--
testcases/kernel/syscalls/madvise/madvise02.c | 3 +--
testcases/kernel/syscalls/mbind/mbind01.c | 6 ------
testcases/kernel/syscalls/mlockall/mlockall02.c | 3 +--
testcases/kernel/syscalls/pipe2/pipe2_01.c | 4 ----
.../kernel/syscalls/sockioctl/sockioctl01.c | 3 +--
testcases/network/netstress/netstress.c | 3 ---
18 files changed, 10 insertions(+), 97 deletions(-)
diff --git a/include/lapi/init_module.h b/include/lapi/init_module.h
index fe35ec3ae..ba0d2b266 100644
--- a/include/lapi/init_module.h
+++ b/include/lapi/init_module.h
@@ -22,16 +22,4 @@ static inline int finit_module(int fd, const char *param_values, int flags)
return tst_syscall(__NR_finit_module, fd, param_values, flags);
}
-static inline void finit_module_supported_by_kernel(void)
-{
- long ret;
-
- if ((tst_kvercmp(3, 8, 0)) < 0) {
- /* Check if the syscall is backported on an older kernel */
- ret = syscall(__NR_finit_module, 0, "", 0);
- if (ret == -1 && errno == ENOSYS)
- tst_brk(TCONF, "Test not supported on kernel version < v3.8");
- }
-}
-
#endif /* LAPI_INIT_MODULE_H__ */
diff --git a/testcases/kernel/containers/userns/userns_helper.h b/testcases/kernel/containers/userns/userns_helper.h
index 2759d32c2..be47690ea 100644
--- a/testcases/kernel/containers/userns/userns_helper.h
+++ b/testcases/kernel/containers/userns/userns_helper.h
@@ -29,9 +29,6 @@ static int check_newuser(void)
{
int pid, status;
- if (tst_kvercmp(3, 8, 0) < 0)
- tst_brkm(TCONF, NULL, "CLONE_NEWUSER not supported");
-
pid = do_clone_unshare_test(T_CLONE, CLONE_NEWUSER, dummy_child, NULL);
if (pid == -1)
tst_brkm(TCONF | TERRNO, NULL, "CLONE_NEWUSER not supported");
diff --git a/testcases/kernel/controllers/cgroup_xattr/cgroup_xattr.c b/testcases/kernel/controllers/cgroup_xattr/cgroup_xattr.c
index 71a03d12c..a870118f5 100644
--- a/testcases/kernel/controllers/cgroup_xattr/cgroup_xattr.c
+++ b/testcases/kernel/controllers/cgroup_xattr/cgroup_xattr.c
@@ -150,11 +150,6 @@ void setup(int argc, char *argv[])
if (access("/proc/cgroups", F_OK) == -1)
tst_brkm(TCONF, NULL, "Kernel doesn't support cgroups");
- if (tst_kvercmp(3, 7, 0) < 0) {
- tst_brkm(TCONF, NULL,
- "Test must be run with kernel 3.7 or newer");
- }
-
for (i = 0; i < ARRAY_SIZE(tkeys); ++i) {
if (!strcmp(tkeys[i].name, "security.")) {
tkeys[i].good = tst_kvercmp(3, 15, 0) < 0;
diff --git a/testcases/kernel/device-drivers/acpi/ltp_acpi.c b/testcases/kernel/device-drivers/acpi/ltp_acpi.c
index 08d4d8632..7dba04552 100644
--- a/testcases/kernel/device-drivers/acpi/ltp_acpi.c
+++ b/testcases/kernel/device-drivers/acpi/ltp_acpi.c
@@ -57,8 +57,6 @@ static int tc_acpi_str(void)
int res, ret = 0;
char descr[4096], sysfs_path[4096];
- int not_kver_3_7 = tst_kvercmp(3, 7, 0) < 0;
-
while (1) {
SAFE_FILE_PRINTF(cleanup, dev_tcase, "%d", ACPI_TRAVERSE);
@@ -86,19 +84,6 @@ static int tc_acpi_str(void)
continue;
}
- /*
- * Find device description in sysfs.
- *
- * New sysfs interface to export device description
- * implemented since Linux 3.7
- */
- if (not_kver_3_7) {
- tst_resm(TINFO, "sysfs _STR check required Linux 3.7+");
- ret = TCONF;
- /* continue, we can still traverse ACPI devices */
- continue;
- }
-
strcat(sysfs_path, "/description");
if (access(sysfs_path, R_OK)) {
tst_resm(TINFO, "can't find description file '%s'",
diff --git a/testcases/kernel/firmware/fw_load_user/fw_load.c b/testcases/kernel/firmware/fw_load_user/fw_load.c
index e81d159f6..83648b625 100644
--- a/testcases/kernel/firmware/fw_load_user/fw_load.c
+++ b/testcases/kernel/firmware/fw_load_user/fw_load.c
@@ -114,11 +114,6 @@ void setup(int argc, char *argv[])
tst_require_root();
- if (tst_kvercmp(3, 7, 0) < 0) {
- tst_brkm(TCONF, NULL,
- "Test must be run with kernel 3.7 or newer");
- }
-
char fw_size_param[19];
snprintf(fw_size_param, 19, "fw_size=%d", fw_size);
char *const mod_params[2] = { fw_size_param, NULL };
diff --git a/testcases/kernel/input/input_helper.c b/testcases/kernel/input/input_helper.c
index c4736eadd..09530fb4d 100644
--- a/testcases/kernel/input/input_helper.c
+++ b/testcases/kernel/input/input_helper.c
@@ -249,27 +249,18 @@ int check_sync_event(struct input_event *iev)
int no_events_queued(int fd, int stray_sync_event)
{
struct pollfd fds = {.fd = fd, .events = POLLIN};
- int ret, res, sync_event_ignored;
+ int ret, res;
struct input_event ev;
- if (tst_kvercmp(3, 7, 0) < 0 && stray_sync_event)
- sync_event_ignored = 1;
-
ret = poll(&fds, 1, 30);
if (ret > 0) {
res = read(fd, &ev, sizeof(ev));
if (res == sizeof(ev)) {
- if (sync_event_ignored && check_sync_event(&ev)) {
- ret = 0;
- tst_resm(TINFO,
- "Ignoring stray sync event (known problem)");
- } else {
- tst_resm(TINFO,
- "Unexpected ev type=%i code=%i value=%i",
- ev.type, ev.code, ev.value);
- }
+ tst_resm(TINFO,
+ "Unexpected ev type=%i code=%i value=%i",
+ ev.type, ev.code, ev.value);
}
}
diff --git a/testcases/kernel/security/prot_hsymlinks/prot_hsymlinks.c b/testcases/kernel/security/prot_hsymlinks/prot_hsymlinks.c
index 369df2b22..20f33527c 100644
--- a/testcases/kernel/security/prot_hsymlinks/prot_hsymlinks.c
+++ b/testcases/kernel/security/prot_hsymlinks/prot_hsymlinks.c
@@ -193,10 +193,6 @@ static void setup(int argc, char *argv[])
tst_require_root();
- if (tst_kvercmp(3, 7, 0) < 0)
- tst_brkm(TCONF, NULL,
- "Test must be run with kernel 3.7 or newer");
-
if (eaccess("/etc/passwd", W_OK)) {
tst_brkm(TCONF, NULL,
"/etc/passwd is not accessible");
diff --git a/testcases/kernel/syscalls/fallocate/fallocate04.c b/testcases/kernel/syscalls/fallocate/fallocate04.c
index 0014241da..ff372a9bf 100644
--- a/testcases/kernel/syscalls/fallocate/fallocate04.c
+++ b/testcases/kernel/syscalls/fallocate/fallocate04.c
@@ -121,13 +121,8 @@ static void test02(void)
tst_brk(TFAIL | TERRNO,
"fallocate() or lseek() failed");
}
- if (tst_kvercmp(3, 1, 0) < 0) {
- tst_res(TINFO, "lseek() doesn't support SEEK_HOLE, "
- "this is expected for < 3.1 kernels");
- } else {
- tst_brk(TBROK | TERRNO,
- "lseek() doesn't support SEEK_HOLE");
- }
+ tst_brk(TBROK | TERRNO,
+ "lseek() doesn't support SEEK_HOLE");
} else {
tst_res(TINFO, "found a hole at '%ld' offset", ret);
}
diff --git a/testcases/kernel/syscalls/finit_module/finit_module01.c b/testcases/kernel/syscalls/finit_module/finit_module01.c
index 21c35f101..f960b2e40 100644
--- a/testcases/kernel/syscalls/finit_module/finit_module01.c
+++ b/testcases/kernel/syscalls/finit_module/finit_module01.c
@@ -25,8 +25,6 @@ static char *mod_path;
static void setup(void)
{
- finit_module_supported_by_kernel();
-
tst_module_exists(MODULE_NAME, &mod_path);
fd = SAFE_OPEN(mod_path, O_RDONLY|O_CLOEXEC);
diff --git a/testcases/kernel/syscalls/finit_module/finit_module02.c b/testcases/kernel/syscalls/finit_module/finit_module02.c
index b3437b5d0..a7434de7d 100644
--- a/testcases/kernel/syscalls/finit_module/finit_module02.c
+++ b/testcases/kernel/syscalls/finit_module/finit_module02.c
@@ -81,8 +81,6 @@ static void setup(void)
{
unsigned long int i;
- finit_module_supported_by_kernel();
-
tst_module_exists(MODULE_NAME, &mod_path);
kernel_lockdown = tst_lockdown_enabled();
diff --git a/testcases/kernel/syscalls/ioctl/ioctl01.c b/testcases/kernel/syscalls/ioctl/ioctl01.c
index 26b603ebe..2989c0e9b 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl01.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl01.c
@@ -79,14 +79,6 @@ static void setup(void)
tst_brk(TBROK, "You must specify a tty device with -D option");
fd = SAFE_OPEN(device, O_RDWR, 0777);
-
- if (tst_kvercmp(3, 7, 0) < 0) {
- for (i = 0; i < ARRAY_SIZE(tcases); i++) {
- if (tcases[i].request == INVAL_IOCTL)
- tcases[i].error = EINVAL;
- }
- }
-
fd_file = SAFE_OPEN("x", O_CREAT, 0777);
}
diff --git a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv07.c b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv07.c
index f4bca5ec8..d2d1a882a 100644
--- a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv07.c
+++ b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv07.c
@@ -247,8 +247,7 @@ static void setup(void)
{
msgkey = GETIPCKEY();
- if (tst_kvercmp(3, 8, 0) >= 0)
- msg_copy_sup = 1;
+ msg_copy_sup = 1;
}
static void (*testfunc[])(void) = {test_msg_except, test_msg_noerror,
diff --git a/testcases/kernel/syscalls/madvise/madvise02.c b/testcases/kernel/syscalls/madvise/madvise02.c
index b158dc351..858d67ae2 100644
--- a/testcases/kernel/syscalls/madvise/madvise02.c
+++ b/testcases/kernel/syscalls/madvise/madvise02.c
@@ -107,8 +107,7 @@ static void tcases_filter(void)
/* In kernel commit 1998cc0, madvise(MADV_WILLNEED) to
* anon mem doesn't return -EBADF now, as now we support
* swap prefretch. */
- if ((tst_kvercmp(3, 9, 0)) > 0 &&
- tc->exp_errno == EBADF)
+ if (tc->exp_errno == EBADF)
tc->skip = 1;
break;
case MADV_FREE:
diff --git a/testcases/kernel/syscalls/mbind/mbind01.c b/testcases/kernel/syscalls/mbind/mbind01.c
index 5f3c5d7c0..4b8d168cd 100644
--- a/testcases/kernel/syscalls/mbind/mbind01.c
+++ b/testcases/kernel/syscalls/mbind/mbind01.c
@@ -197,12 +197,6 @@ static void do_test(unsigned int i)
tst_res(TINFO, "case %s", tc->desc);
if (tc->policy == MPOL_LOCAL) {
- if ((tst_kvercmp(3, 8, 0)) < 0) {
- tst_res(TCONF, "%s is not supported",
- tst_mempolicy_mode_name(tc->policy));
- return;
- }
-
if ((tst_kvercmp(5, 14, 0)) >= 0)
tc->check_policy = NULL;
}
diff --git a/testcases/kernel/syscalls/mlockall/mlockall02.c b/testcases/kernel/syscalls/mlockall/mlockall02.c
index e301bcb03..94d6e3270 100644
--- a/testcases/kernel/syscalls/mlockall/mlockall02.c
+++ b/testcases/kernel/syscalls/mlockall/mlockall02.c
@@ -230,8 +230,7 @@ void cleanup_test(int i)
switch (i) {
case 0:
- if (tst_kvercmp(2, 6, 9) >= 0)
- seteuid(0);
+ seteuid(0);
rl.rlim_max = -1;
rl.rlim_cur = -1;
diff --git a/testcases/kernel/syscalls/pipe2/pipe2_01.c b/testcases/kernel/syscalls/pipe2/pipe2_01.c
index 6597162e7..87e81a455 100644
--- a/testcases/kernel/syscalls/pipe2/pipe2_01.c
+++ b/testcases/kernel/syscalls/pipe2/pipe2_01.c
@@ -54,10 +54,6 @@ static void verify_pipe2(unsigned int n)
int get_flag = 0, i = 0;
tst_res(TINFO, "%s ", tc->message);
- if ((tc->flags == O_DIRECT) && (tst_kvercmp(3, 4, 0)) < 0) {
- tst_res(TCONF, "O_DIRECT needs Linux 3.4 or newer");
- return;
- }
SAFE_PIPE2(fds, tc->flags);
for (i = 0; i < 2; i++) {
diff --git a/testcases/kernel/syscalls/sockioctl/sockioctl01.c b/testcases/kernel/syscalls/sockioctl/sockioctl01.c
index 155f0cec5..51dac9c16 100644
--- a/testcases/kernel/syscalls/sockioctl/sockioctl01.c
+++ b/testcases/kernel/syscalls/sockioctl/sockioctl01.c
@@ -190,8 +190,7 @@ static void setup0(void)
* changed -EINVAL to -ENOIOCTLCMD, so vfs_ioctl now
* returns -ENOTTY.
*/
- if ((tst_kvercmp(3, 5, 0)) >= 0)
- tdat[testno].experrno = ENOTTY;
+ tdat[testno].experrno = ENOTTY;
}
}
diff --git a/testcases/network/netstress/netstress.c b/testcases/network/netstress/netstress.c
index 7c222531d..6a888f2ee 100644
--- a/testcases/network/netstress/netstress.c
+++ b/testcases/network/netstress/netstress.c
@@ -882,9 +882,6 @@ static void setup(void)
if (!clients_num)
clients_num = sysconf(_SC_NPROCESSORS_ONLN);
- if (tfo_value > 0 && tst_kvercmp(3, 7, 0) < 0)
- tst_brk(TCONF, "Test must be run with kernel 3.7 or newer");
-
if (busy_poll >= 0 && tst_kvercmp(3, 11, 0) < 0)
tst_brk(TCONF, "Test must be run with kernel 3.11 or newer");
--
2.31.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [LTP] [PATCH 3/3] Remove old kernel version check when using min_kver under 3.10
2022-12-27 9:20 [LTP] [PATCH 1/3] shell: Remove old kernel version check below 3.10 Yang Xu
2022-12-27 9:20 ` [LTP] [PATCH 2/3] Remove old kernel version check when using tst_kvercmp under 3.10 Yang Xu
@ 2022-12-27 9:20 ` Yang Xu
2023-01-02 12:04 ` Petr Vorel
2023-01-02 9:37 ` [LTP] [PATCH 1/3] shell: Remove old kernel version check below 3.10 Petr Vorel
2 siblings, 1 reply; 9+ messages in thread
From: Yang Xu @ 2022-12-27 9:20 UTC (permalink / raw)
To: ltp
We have raised the minimal kernel version from 3.0 to 3.10,
so remove these useless check.
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
doc/c-test-api.txt | 2 +-
testcases/kernel/logging/kmsg/kmsg01.c | 1 -
testcases/kernel/syscalls/getxattr/getxattr05.c | 1 -
testcases/kernel/syscalls/ipc/msgrcv/msgrcv03.c | 1 -
testcases/kernel/syscalls/kcmp/kcmp01.c | 1 -
testcases/kernel/syscalls/kcmp/kcmp02.c | 1 -
testcases/kernel/syscalls/kcmp/kcmp03.c | 1 -
testcases/kernel/syscalls/madvise/madvise05.c | 1 -
testcases/kernel/syscalls/madvise/madvise06.c | 1 -
testcases/kernel/syscalls/madvise/madvise08.c | 1 -
testcases/kernel/syscalls/setsockopt/setsockopt02.c | 1 -
11 files changed, 1 insertion(+), 11 deletions(-)
diff --git a/doc/c-test-api.txt b/doc/c-test-api.txt
index e6d121dce..b15321ca2 100644
--- a/doc/c-test-api.txt
+++ b/doc/c-test-api.txt
@@ -559,7 +559,7 @@ static struct tst_test test = {
Testcases for newly added kernel functionality require kernel newer than a
certain version to run. All you need to skip a test on older kernels is to
set the '.min_kver' string in the 'struct tst_test' to a minimal required
-kernel version, e.g. '.min_kver = "2.6.30"'.
+kernel version, e.g. '.min_kver = "4.10.0"'.
For more complicated operations such as skipping a test for a certain range
of kernel versions, following functions could be used:
diff --git a/testcases/kernel/logging/kmsg/kmsg01.c b/testcases/kernel/logging/kmsg/kmsg01.c
index bf2de5741..ba8179d5a 100644
--- a/testcases/kernel/logging/kmsg/kmsg01.c
+++ b/testcases/kernel/logging/kmsg/kmsg01.c
@@ -573,5 +573,4 @@ static struct tst_test test = {
.cleanup = cleanup,
.needs_root = 1,
.test_all = test_kmsg,
- .min_kver = "3.5.0"
};
diff --git a/testcases/kernel/syscalls/getxattr/getxattr05.c b/testcases/kernel/syscalls/getxattr/getxattr05.c
index 28eb4cbcf..8d1752fd0 100644
--- a/testcases/kernel/syscalls/getxattr/getxattr05.c
+++ b/testcases/kernel/syscalls/getxattr/getxattr05.c
@@ -175,7 +175,6 @@ static struct tst_test test = {
.cleanup = cleanup,
.tcnt = ARRAY_SIZE(tcases),
.test = do_getxattr,
- .min_kver = "3.8",
};
#else /* HAVE_SYS_XATTR_H && HAVE_LIBACL*/
diff --git a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv03.c b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv03.c
index ebc583b3e..3e461b307 100644
--- a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv03.c
+++ b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv03.c
@@ -83,7 +83,6 @@ static struct tst_test test = {
"CONFIG_CHECKPOINT_RESTORE",
NULL
},
- .min_kver = "3.8.0",
.tcnt = ARRAY_SIZE(tcases),
.test = verify_msgrcv,
.setup = setup,
diff --git a/testcases/kernel/syscalls/kcmp/kcmp01.c b/testcases/kernel/syscalls/kcmp/kcmp01.c
index 903525ff0..0e7cc7a22 100644
--- a/testcases/kernel/syscalls/kcmp/kcmp01.c
+++ b/testcases/kernel/syscalls/kcmp/kcmp01.c
@@ -103,6 +103,5 @@ static struct tst_test test = {
.cleanup = cleanup,
.forks_child = 1,
.test = verify_kcmp,
- .min_kver = "3.5.0",
.needs_tmpdir = 1,
};
diff --git a/testcases/kernel/syscalls/kcmp/kcmp02.c b/testcases/kernel/syscalls/kcmp/kcmp02.c
index ab07bb866..076b4a723 100644
--- a/testcases/kernel/syscalls/kcmp/kcmp02.c
+++ b/testcases/kernel/syscalls/kcmp/kcmp02.c
@@ -94,6 +94,5 @@ static struct tst_test test = {
.setup = setup,
.cleanup = cleanup,
.test = verify_kcmp,
- .min_kver = "3.5.0",
.needs_tmpdir = 1
};
diff --git a/testcases/kernel/syscalls/kcmp/kcmp03.c b/testcases/kernel/syscalls/kcmp/kcmp03.c
index 4b90e6d87..7af5cb150 100644
--- a/testcases/kernel/syscalls/kcmp/kcmp03.c
+++ b/testcases/kernel/syscalls/kcmp/kcmp03.c
@@ -87,5 +87,4 @@ static struct tst_test test = {
.cleanup = cleanup,
.forks_child = 1,
.test = verify_kcmp,
- .min_kver = "3.5.0"
};
diff --git a/testcases/kernel/syscalls/madvise/madvise05.c b/testcases/kernel/syscalls/madvise/madvise05.c
index 3ab4a8749..9b00a1ff0 100644
--- a/testcases/kernel/syscalls/madvise/madvise05.c
+++ b/testcases/kernel/syscalls/madvise/madvise05.c
@@ -46,7 +46,6 @@ static void verify_madvise(void)
}
static struct tst_test test = {
- .min_kver = "3.9.0",
.test_all = verify_madvise,
.tags = (const struct tst_tag[]) {
{"linux-git", "ee53664bda16"},
diff --git a/testcases/kernel/syscalls/madvise/madvise06.c b/testcases/kernel/syscalls/madvise/madvise06.c
index c1c55bbc2..c7967ae6f 100644
--- a/testcases/kernel/syscalls/madvise/madvise06.c
+++ b/testcases/kernel/syscalls/madvise/madvise06.c
@@ -235,7 +235,6 @@ static void test_advice_willneed(void)
static struct tst_test test = {
.test_all = test_advice_willneed,
.setup = setup,
- .min_kver = "3.10.0",
.needs_tmpdir = 1,
.needs_root = 1,
.save_restore = (const struct tst_path_val[]) {
diff --git a/testcases/kernel/syscalls/madvise/madvise08.c b/testcases/kernel/syscalls/madvise/madvise08.c
index 0996cf91b..96bcaf159 100644
--- a/testcases/kernel/syscalls/madvise/madvise08.c
+++ b/testcases/kernel/syscalls/madvise/madvise08.c
@@ -208,7 +208,6 @@ static struct tst_test test = {
.tcnt = 2,
.setup = setup,
.cleanup = cleanup,
- .min_kver = "3.4.0",
.needs_tmpdir = 1,
.needs_root = 1,
.forks_child = 1,
diff --git a/testcases/kernel/syscalls/setsockopt/setsockopt02.c b/testcases/kernel/syscalls/setsockopt/setsockopt02.c
index f0a2a5ecd..e7621538b 100644
--- a/testcases/kernel/syscalls/setsockopt/setsockopt02.c
+++ b/testcases/kernel/syscalls/setsockopt/setsockopt02.c
@@ -96,5 +96,4 @@ static struct tst_test test = {
.needs_root = 1,
.setup = setup,
.cleanup = cleanup,
- .min_kver = "3.2",
};
--
2.31.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [LTP] [PATCH 1/3] shell: Remove old kernel version check below 3.10
2022-12-27 9:20 [LTP] [PATCH 1/3] shell: Remove old kernel version check below 3.10 Yang Xu
2022-12-27 9:20 ` [LTP] [PATCH 2/3] Remove old kernel version check when using tst_kvercmp under 3.10 Yang Xu
2022-12-27 9:20 ` [LTP] [PATCH 3/3] Remove old kernel version check when using min_kver " Yang Xu
@ 2023-01-02 9:37 ` Petr Vorel
2023-01-03 5:39 ` xuyang2018.jy
2023-01-03 18:13 ` Petr Vorel
2 siblings, 2 replies; 9+ messages in thread
From: Petr Vorel @ 2023-01-02 9:37 UTC (permalink / raw)
To: Yang Xu; +Cc: ltp
Hi Xu,
...
> +++ b/testcases/kernel/tracing/dynamic_debug/dynamic_debug01.sh
> @@ -21,8 +21,7 @@ DEBUGFS_WAS_MOUNTED=0
> DEBUGFS_PATH=""
> DEBUGFS_CONTROL=""
> DYNDEBUG_STATEMENTS="./debug_statements"
> -EMPTY_FLAG="-"
> -NEW_INTERFACE=0
> +EMPTY_FLAG="=_"
> mount_debugfs()
> {
> @@ -55,11 +54,6 @@ setup()
> tst_brk TBROK "Unable to find $DEBUGFS_CONTROL"
> fi
> - if tst_kvcmp -ge 3.4 ; then
> - NEW_INTERFACE=1
> - EMPTY_FLAG="=_"
> - fi
> -
> grep -v "^#" "$DEBUGFS_CONTROL" > "$DYNDEBUG_STATEMENTS"
> }
> @@ -83,10 +77,8 @@ do_all_flags()
> for INPUT_LINE in $ALL_INPUTS; do
> do_flag "+p" "$OPTION" "$INPUT_LINE"
> - if tst_kvcmp -ge 3.2 || [ $NEW_INTERFACE -eq 1 ] ; then
> - do_flag "+flmt" "$OPTION" "$INPUT_LINE"
> - do_flag "-flmt" "$OPTION" "$INPUT_LINE"
> - fi
> + do_flag "+flmt" "$OPTION" "$INPUT_LINE"
> + do_flag "-flmt" "$OPTION" "$INPUT_LINE"
> do_flag "-p" "$OPTION" "$INPUT_LINE"
> done
> @@ -131,7 +123,7 @@ cleanup()
> FLAGS_SET=$(awk -v emp="$EMPTY_FLAG" '$3 != emp' $DYNDEBUG_STATEMENTS)
> fi
> if [ "$FLAGS_SET" ] ; then
> - FLAG_PREFIX=$([ $NEW_INTERFACE -eq 1 ] && echo "" || echo "+")
FYI Original code was ugly, it should have been
[ $NEW_INTERFACE -eq 1 ] || NEW_INTERFACE="+"
(Now ignoring that local variables should use local keyword and be lowercase.)
> + FLAG_PREFIX=$(echo "")
This evaluates to FLAG_PREFIX=
=> please remove the variable as it's always empty
> /bin/echo "$FLAGS_SET" | while read -r FLAG_LINE ; do
> /bin/echo -n "$FLAG_LINE" \
> | awk -v prf="$FLAG_PREFIX" -F " |:" \
change to:
| awk -v prf= -F " |:" \
NOTE: I'm going to cleanup the test after you merge (/bin/echo + variables).
With these changes:
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LTP] [PATCH 2/3] Remove old kernel version check when using tst_kvercmp under 3.10
2022-12-27 9:20 ` [LTP] [PATCH 2/3] Remove old kernel version check when using tst_kvercmp under 3.10 Yang Xu
@ 2023-01-02 12:01 ` Petr Vorel
0 siblings, 0 replies; 9+ messages in thread
From: Petr Vorel @ 2023-01-02 12:01 UTC (permalink / raw)
To: Yang Xu; +Cc: ltp
Hi Xu,
> We have raised the minimal kernel version from 3.0 to 3.10,
> so remove these useless check.
s/check/checks/
...
> diff --git a/testcases/kernel/syscalls/fallocate/fallocate04.c b/testcases/kernel/syscalls/fallocate/fallocate04.c
> index 0014241da..ff372a9bf 100644
> --- a/testcases/kernel/syscalls/fallocate/fallocate04.c
> +++ b/testcases/kernel/syscalls/fallocate/fallocate04.c
> @@ -121,13 +121,8 @@ static void test02(void)
> tst_brk(TFAIL | TERRNO,
> "fallocate() or lseek() failed");
> }
> - if (tst_kvercmp(3, 1, 0) < 0) {
> - tst_res(TINFO, "lseek() doesn't support SEEK_HOLE, "
> - "this is expected for < 3.1 kernels");
> - } else {
> - tst_brk(TBROK | TERRNO,
> - "lseek() doesn't support SEEK_HOLE");
> - }
> + tst_brk(TBROK | TERRNO,
> + "lseek() doesn't support SEEK_HOLE");
This can be on single line.
...
> diff --git a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv07.c b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv07.c
> index f4bca5ec8..d2d1a882a 100644
> --- a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv07.c
> +++ b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv07.c
> @@ -247,8 +247,7 @@ static void setup(void)
> {
> msgkey = GETIPCKEY();
> - if (tst_kvercmp(3, 8, 0) >= 0)
> - msg_copy_sup = 1;
> + msg_copy_sup = 1;
msg_copy_sup = 1 should be moved out of setup:
-static int queue_id = -1, msg_copy_sup;
+static int queue_id = -1, msg_copy_sup = 1;
The rest LGTM.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LTP] [PATCH 3/3] Remove old kernel version check when using min_kver under 3.10
2022-12-27 9:20 ` [LTP] [PATCH 3/3] Remove old kernel version check when using min_kver " Yang Xu
@ 2023-01-02 12:04 ` Petr Vorel
0 siblings, 0 replies; 9+ messages in thread
From: Petr Vorel @ 2023-01-02 12:04 UTC (permalink / raw)
To: Yang Xu; +Cc: ltp
Hi Xu,
> We have raised the minimal kernel version from 3.0 to 3.10,
> so remove these useless check.
s/check/checks/
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LTP] [PATCH 1/3] shell: Remove old kernel version check below 3.10
2023-01-02 9:37 ` [LTP] [PATCH 1/3] shell: Remove old kernel version check below 3.10 Petr Vorel
@ 2023-01-03 5:39 ` xuyang2018.jy
2023-01-03 18:13 ` Petr Vorel
1 sibling, 0 replies; 9+ messages in thread
From: xuyang2018.jy @ 2023-01-03 5:39 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp@lists.linux.it
Hi Petr
> Hi Xu,
>
> ...
>> +++ b/testcases/kernel/tracing/dynamic_debug/dynamic_debug01.sh
>> @@ -21,8 +21,7 @@ DEBUGFS_WAS_MOUNTED=0
>> DEBUGFS_PATH=""
>> DEBUGFS_CONTROL=""
>> DYNDEBUG_STATEMENTS="./debug_statements"
>> -EMPTY_FLAG="-"
>> -NEW_INTERFACE=0
>> +EMPTY_FLAG="=_"
>
>> mount_debugfs()
>> {
>> @@ -55,11 +54,6 @@ setup()
>> tst_brk TBROK "Unable to find $DEBUGFS_CONTROL"
>> fi
>
>> - if tst_kvcmp -ge 3.4 ; then
>> - NEW_INTERFACE=1
>> - EMPTY_FLAG="=_"
>> - fi
>> -
>> grep -v "^#" "$DEBUGFS_CONTROL" > "$DYNDEBUG_STATEMENTS"
>> }
>
>> @@ -83,10 +77,8 @@ do_all_flags()
>
>> for INPUT_LINE in $ALL_INPUTS; do
>> do_flag "+p" "$OPTION" "$INPUT_LINE"
>> - if tst_kvcmp -ge 3.2 || [ $NEW_INTERFACE -eq 1 ] ; then
>> - do_flag "+flmt" "$OPTION" "$INPUT_LINE"
>> - do_flag "-flmt" "$OPTION" "$INPUT_LINE"
>> - fi
>> + do_flag "+flmt" "$OPTION" "$INPUT_LINE"
>> + do_flag "-flmt" "$OPTION" "$INPUT_LINE"
>> do_flag "-p" "$OPTION" "$INPUT_LINE"
>> done
>
>> @@ -131,7 +123,7 @@ cleanup()
>> FLAGS_SET=$(awk -v emp="$EMPTY_FLAG" '$3 != emp' $DYNDEBUG_STATEMENTS)
>> fi
>> if [ "$FLAGS_SET" ] ; then
>> - FLAG_PREFIX=$([ $NEW_INTERFACE -eq 1 ] && echo "" || echo "+")
> FYI Original code was ugly, it should have been
> [ $NEW_INTERFACE -eq 1 ] || NEW_INTERFACE="+"
> (Now ignoring that local variables should use local keyword and be lowercase.)
>
>> + FLAG_PREFIX=$(echo "")
> This evaluates to FLAG_PREFIX=
> => please remove the variable as it's always empty
>
>> /bin/echo "$FLAGS_SET" | while read -r FLAG_LINE ; do
>> /bin/echo -n "$FLAG_LINE" \
>> | awk -v prf="$FLAG_PREFIX" -F " |:" \
> change to:
> | awk -v prf= -F " |:" \
>
> NOTE: I'm going to cleanup the test after you merge (/bin/echo + variables).
>
> With these changes:
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
Thanks for your review, I merged this patchset.
Best Regards
Yang Xu
>
> Kind regards,
> Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LTP] [PATCH 1/3] shell: Remove old kernel version check below 3.10
2023-01-02 9:37 ` [LTP] [PATCH 1/3] shell: Remove old kernel version check below 3.10 Petr Vorel
2023-01-03 5:39 ` xuyang2018.jy
@ 2023-01-03 18:13 ` Petr Vorel
2023-01-04 4:59 ` xuyang2018.jy
1 sibling, 1 reply; 9+ messages in thread
From: Petr Vorel @ 2023-01-03 18:13 UTC (permalink / raw)
To: Yang Xu, ltp
Hi Xu,
...
> This evaluates to FLAG_PREFIX=
> => please remove the variable as it's always empty
> > /bin/echo "$FLAGS_SET" | while read -r FLAG_LINE ; do
> > /bin/echo -n "$FLAG_LINE" \
> > | awk -v prf="$FLAG_PREFIX" -F " |:" \
> change to:
> | awk -v prf= -F " |:" \
FYI I suggested:
> | awk -v prf= -F " |:" \
But you added: prf=-F (no space between =), which broke cleanup.
Fixed in af98698067.
And yes, prf variable is not needed at all, I'll try to find time to cleanup
dynamic_debug01.sh.
Kind regards,
Petr
> NOTE: I'm going to cleanup the test after you merge (/bin/echo + variables).
> With these changes:
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
> Kind regards,
> Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LTP] [PATCH 1/3] shell: Remove old kernel version check below 3.10
2023-01-03 18:13 ` Petr Vorel
@ 2023-01-04 4:59 ` xuyang2018.jy
0 siblings, 0 replies; 9+ messages in thread
From: xuyang2018.jy @ 2023-01-04 4:59 UTC (permalink / raw)
To: Petr Vorel, ltp@lists.linux.it
Hi Petr
> Hi Xu,
>
> ...
>> This evaluates to FLAG_PREFIX=
>> => please remove the variable as it's always empty
>
>>> /bin/echo "$FLAGS_SET" | while read -r FLAG_LINE ; do
>>> /bin/echo -n "$FLAG_LINE" \
>>> | awk -v prf="$FLAG_PREFIX" -F " |:" \
>> change to:
>> | awk -v prf= -F " |:" \
>
> FYI I suggested:
>
>> | awk -v prf= -F " |:" \
>
> But you added: prf=-F (no space between =), which broke cleanup.
Yes, sorry for this.
>
> Fixed in af98698067.
>
> And yes, prf variable is not needed at all, I'll try to find time to cleanup
> dynamic_debug01.sh.
Thanks for your fix.
Best Regards
Yang Xu
>
> Kind regards,
> Petr
>
>> NOTE: I'm going to cleanup the test after you merge (/bin/echo + variables).
>
>> With these changes:
>> Reviewed-by: Petr Vorel <pvorel@suse.cz>
>
>> Kind regards,
>> Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2023-01-04 4:59 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-27 9:20 [LTP] [PATCH 1/3] shell: Remove old kernel version check below 3.10 Yang Xu
2022-12-27 9:20 ` [LTP] [PATCH 2/3] Remove old kernel version check when using tst_kvercmp under 3.10 Yang Xu
2023-01-02 12:01 ` Petr Vorel
2022-12-27 9:20 ` [LTP] [PATCH 3/3] Remove old kernel version check when using min_kver " Yang Xu
2023-01-02 12:04 ` Petr Vorel
2023-01-02 9:37 ` [LTP] [PATCH 1/3] shell: Remove old kernel version check below 3.10 Petr Vorel
2023-01-03 5:39 ` xuyang2018.jy
2023-01-03 18:13 ` Petr Vorel
2023-01-04 4:59 ` xuyang2018.jy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox