diff options
Diffstat (limited to 'poky/meta/recipes-extended/ltp')
4 files changed, 292 insertions, 1 deletions
diff --git a/poky/meta/recipes-extended/ltp/ltp/0001-cve-meltdown.c-Fix-kernel-symbol-finding.patch b/poky/meta/recipes-extended/ltp/ltp/0001-cve-meltdown.c-Fix-kernel-symbol-finding.patch new file mode 100644 index 000000000..94f6f5a15 --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp/0001-cve-meltdown.c-Fix-kernel-symbol-finding.patch @@ -0,0 +1,81 @@ +From fbeda82f440a0098be42dd668cbc47212a86ab48 Mon Sep 17 00:00:00 2001 +From: He Zhe <zhe.he@windriver.com> +Date: Wed, 21 Aug 2019 16:27:24 +0800 +Subject: [PATCH] cve/meltdown.c: Fix kernel symbol finding + +meltdown case fails as below. +safe_file_ops.c:219: BROK: Expected 3 conversions got 2 at meltdown.c:272 + +find_kernel_symbol is defined to try twice with each of /proc/kallsyms and +/boot/System.map-%s. Currently if the symbol is not found in /proc/kallsyms, +when kernel option CONFIG_KALLSYMS_ALL is disabled, it would stop the case +immediately due to SAFE_FILE_LINES_SCANF. + +This patch turns to use FILE_LINES_SCANF to give find_kernel_symbol second +chance. + +[jstancek] Fix also condition introduced in 7709d2ae92ea, even if + /proc/kallsyms is disabled, we still want to try System.map. + +Signed-off-by: He Zhe <zhe.he@windriver.com> +Signed-off-by: Jan Stancek <jstancek@redhat.com> + +Upstream-Status: Backport +[https://github.com/linux-test-project/ltp/commit/c2049b5c874bc071f8185bffb5fd7dcb042d9ec8] + +Remove the hunk for upstream 7709d2ae92ea ("cve/meltdown.c: abort the test if kallsyms was not enabled") +that has been covered by this patch. + +Signed-off-by: He Zhe <zhe.he@windriver.com> +--- + testcases/cve/meltdown.c | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/testcases/cve/meltdown.c b/testcases/cve/meltdown.c +index a53ea9b..22651a6 100644 +--- a/testcases/cve/meltdown.c ++++ b/testcases/cve/meltdown.c +@@ -267,9 +267,15 @@ find_symbol_in_file(const char *filename, const char *symname) + int ret, read; + char fmt[strlen(symname) + 64]; + ++ tst_res(TINFO, "Looking for %s in %s", symname, filename); ++ if (access(filename, F_OK) == -1) { ++ tst_res(TINFO, "%s not available", filename); ++ return 0; ++ } ++ + sprintf(fmt, "%%lx %%c %s%%c", symname); + +- ret = SAFE_FILE_LINES_SCANF(filename, fmt, &addr, &type, &read); ++ ret = FILE_LINES_SCANF(filename, fmt, &addr, &type, &read); + if (ret) + return 0; + +@@ -287,13 +293,11 @@ find_kernel_symbol(const char *name) + if (addr) + return addr; + +- tst_res(TINFO, "not found '%s' in /proc/kallsyms", name); + if (uname(&utsname) < 0) + tst_brk(TBROK | TERRNO, "uname"); + + sprintf(systemmap, "/boot/System.map-%s", utsname.release); + +- tst_res(TINFO, "looking in '%s'\n", systemmap); + addr = find_symbol_in_file(systemmap, name); + return addr; + } +@@ -308,6 +312,9 @@ static void setup(void) + saved_cmdline_addr = find_kernel_symbol("saved_command_line"); + tst_res(TINFO, "&saved_command_line == 0x%lx", saved_cmdline_addr); + ++ if (!saved_cmdline_addr) ++ tst_brk(TCONF, "saved_command_line not found"); ++ + spec_fd = SAFE_OPEN("/proc/cmdline", O_RDONLY); + + memset(target_array, 1, sizeof(target_array)); +-- +2.7.4 + diff --git a/poky/meta/recipes-extended/ltp/ltp/0001-syscall-rt_sigtimedwait01-Fix-wrong-sigset-length-fo.patch b/poky/meta/recipes-extended/ltp/ltp/0001-syscall-rt_sigtimedwait01-Fix-wrong-sigset-length-fo.patch new file mode 100644 index 000000000..0e56c0825 --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp/0001-syscall-rt_sigtimedwait01-Fix-wrong-sigset-length-fo.patch @@ -0,0 +1,46 @@ +From a5046625eaeed2d3fba456c3ba84c6c141c2ad7c Mon Sep 17 00:00:00 2001 +From: He Zhe <zhe.he@windriver.com> +Date: Thu, 29 Aug 2019 21:09:46 +0800 +Subject: [PATCH] syscall/rt_sigtimedwait01: Fix wrong sigset length for MIPS + +rt_sigtimedwait01 fails as follow on MIPS arches +rt_sigtimedwait01 1 TFAIL : .../sigwaitinfo01.c:58: test_empty_set +(.../sigwaitinfo01.c: 148): Unexpected failure: +TEST_ERRNO=EINVAL(22): Invalid argument + +As this case purposely bypasses glibc, it should align with the size of kernel +definition of sigset_t which is different from other arches. +https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/mips/include/uapi/asm/signal.h#n15 + +This patch turns to use _NSIG which is always right for all arches. + +Upstream-Status: Backport [a5046625eaeed2d3fba456c3ba84c6c141c2ad7c] + +Suggested-by: Jan Stancek <jstancek@redhat.com> +Acked-by: Jan Stancek <jstancek@redhat.com> +Acked-by: Cyril Hrubis <chrubis@suse.cz> +Signed-off-by: He Zhe <zhe.he@windriver.com> +Signed-off-by: Petr Vorel <pvorel@suse.cz> +--- + testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c b/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c +index 5a32ce1..6a30c27 100644 +--- a/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c ++++ b/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c +@@ -128,9 +128,8 @@ static int my_sigtimedwait(const sigset_t * set, siginfo_t * info, + static int my_rt_sigtimedwait(const sigset_t * set, siginfo_t * info, + struct timespec *timeout) + { +- +- /* The last argument is (number_of_signals)/(bits_per_byte), which are 64 and 8, resp. */ +- return ltp_syscall(__NR_rt_sigtimedwait, set, info, timeout, 8); ++ /* _NSIG is always the right number of bits of signal map for all arches */ ++ return ltp_syscall(__NR_rt_sigtimedwait, set, info, timeout, _NSIG/8); + } + #endif + +-- +2.7.4 + diff --git a/poky/meta/recipes-extended/ltp/ltp/0001-testcases-use-python3-everywhere-to-run-python-scrip.patch b/poky/meta/recipes-extended/ltp/ltp/0001-testcases-use-python3-everywhere-to-run-python-scrip.patch new file mode 100644 index 000000000..f4f87f38a --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp/0001-testcases-use-python3-everywhere-to-run-python-scrip.patch @@ -0,0 +1,161 @@ +From 0463d793566772a606255957915f99d166d5740c Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Wed, 28 Aug 2019 18:30:23 +0200 +Subject: [PATCH] testcases: use python3 everywhere to run python scripts + +The scripts themselves have #!/usr/bin/python3 in them, +so I trust they are already py3-compatible. + +Upstream-Status: Pending +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + testcases/kernel/power_management/runpwtests05.sh | 2 +- + .../power_management/runpwtests_exclusive01.sh | 2 +- + .../power_management/runpwtests_exclusive02.sh | 2 +- + .../power_management/runpwtests_exclusive03.sh | 2 +- + .../power_management/runpwtests_exclusive04.sh | 2 +- + .../power_management/runpwtests_exclusive05.sh | 2 +- + testcases/network/nfsv4/acl/runtest | 14 +++++++------- + testcases/realtime/func/pi-tests/run_auto.sh | 6 +++--- + 8 files changed, 16 insertions(+), 16 deletions(-) + +diff --git a/testcases/kernel/power_management/runpwtests05.sh b/testcases/kernel/power_management/runpwtests05.sh +index 8a7d0f6e0..43e234d01 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 python ++tst_test_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 ec78319e2..9fefcbf6e 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 python ++tst_test_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 e107fce35..2cd0ecb05 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 python ++tst_test_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 490344bb3..ab3a5d11d 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 python ++tst_test_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 978ca02ae..438ef603f 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 python ++tst_test_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 a0dad5834..3a9afdbf2 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 python ++tst_test_cmds python3 + + hyper_threaded=$(is_hyper_threaded) + multi_socket=$(is_multi_socket) +diff --git a/testcases/network/nfsv4/acl/runtest b/testcases/network/nfsv4/acl/runtest +index d2e1b4c49..a859e85bc 100755 +--- a/testcases/network/nfsv4/acl/runtest ++++ b/testcases/network/nfsv4/acl/runtest +@@ -22,7 +22,7 @@ do + done + + # creation of users on the remote machine (removed only at the end of the tests) +-rsh -n $REMOTEHOST python $PWD/create_users.py -u 50 -g 50 ++rsh -n $REMOTEHOST python3 $PWD/create_users.py -u 50 -g 50 + + echo "Starting ACL testing" + +@@ -51,19 +51,19 @@ echo "Basic tests finished" + + echo "LONG ACL TEST" + echo "creating necessary users and groups" +-python create_users.py -u 50 -g 50 ++python3 create_users.py -u 50 -g 50 + echo "creating necessary users and groups on the remote host" + mkdir $NFSMNTDIR/lacl-testdir +-python test_long_acl.py -l $MAXLENGTH -p $NFSMNTDIR/lacl-testdir ++python3 test_long_acl.py -l $MAXLENGTH -p $NFSMNTDIR/lacl-testdir + rm -rf $NFSMNTDIR/lacl-testdir + echo "Long ACL test OK with $MAXLENGTH entries" + echo "ACL STRESSING TEST" +-python setacl_stress.py -n 100 -u $USER_NB -g $GRP_NB -f $FILE_NB -p $NFSMNTDIR ++python3 setacl_stress.py -n 100 -u $USER_NB -g $GRP_NB -f $FILE_NB -p $NFSMNTDIR + + # remove local an remote users +-python cleanusers.py +-python cleangroups.py +-rsh -n $REMOTEHOST python $PWD/cleanusers.py ++python3 cleanusers.py ++python3 cleangroups.py ++rsh -n $REMOTEHOST python3 $PWD/cleanusers.py + + echo "Test OK" + +diff --git a/testcases/realtime/func/pi-tests/run_auto.sh b/testcases/realtime/func/pi-tests/run_auto.sh +index d13026049..277988568 100755 +--- a/testcases/realtime/func/pi-tests/run_auto.sh ++++ b/testcases/realtime/func/pi-tests/run_auto.sh +@@ -15,15 +15,15 @@ $SCRIPTS_DIR/run_c_files.sh $profile testpi-0 + + export LOG_FILE="$LOG_DIR/$LOG_FORMAT-testpi-1.log" + $SCRIPTS_DIR/run_c_files.sh $profile testpi-1 +-PYTHONPATH=../../ python parse-testpi1.py $LOG_FILE 2>&1 | tee -a $LOG_FILE ++PYTHONPATH=../../ python3 parse-testpi1.py $LOG_FILE 2>&1 | tee -a $LOG_FILE + + export LOG_FILE="$LOG_DIR/$LOG_FORMAT-testpi-2.log" + $SCRIPTS_DIR/run_c_files.sh $profile testpi-2 +-PYTHONPATH=../../ python parse-testpi2.py $LOG_FILE 2>&1 | tee -a $LOG_FILE ++PYTHONPATH=../../ python3 parse-testpi2.py $LOG_FILE 2>&1 | tee -a $LOG_FILE + + export LOG_FILE="$LOG_DIR/$LOG_FORMAT-testpi-4.log" + $SCRIPTS_DIR/run_c_files.sh $profile testpi-4 +-PYTHONPATH=../../ python parse-testpi1.py $LOG_FILE 2>&1 | tee -a $LOG_FILE ++PYTHONPATH=../../ python3 parse-testpi1.py $LOG_FILE 2>&1 | tee -a $LOG_FILE + + + export LOG_FILE="" diff --git a/poky/meta/recipes-extended/ltp/ltp_20190517.bb b/poky/meta/recipes-extended/ltp/ltp_20190517.bb index b0e2f969c..e9a588f49 100644 --- a/poky/meta/recipes-extended/ltp/ltp_20190517.bb +++ b/poky/meta/recipes-extended/ltp/ltp_20190517.bb @@ -45,6 +45,9 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \ file://0002-check-for-RES_USE_INET6-during-configure.patch \ file://0001-syscalls-tgkill03-wait-for-defunct-tid-to-get-detach.patch \ file://0001-ustat02-Fix-EFAULT-in-32bit-compatibility-mode.patch \ + file://0001-cve-meltdown.c-Fix-kernel-symbol-finding.patch \ + file://0001-testcases-use-python3-everywhere-to-run-python-scrip.patch \ + file://0001-syscall-rt_sigtimedwait01-Fix-wrong-sigset-length-fo.patch \ " S = "${WORKDIR}/git" @@ -96,7 +99,7 @@ RDEPENDS_${PN} = "\ libaio \ logrotate \ perl \ - python-core \ + python3-core \ procps \ quota \ unzip \ |