This is a small collection of tweaks for the shellscript side of the
livepatch tests. If anyone else has a small cleanup (or even just a
suggestion for a low-hanging change) and would like to tack it onto the
set, let me know.
based-on: livepatching.git, for-5.9/selftests-cleanup
merge-thru: livepatching.git
v2:
- use consistent start_test messages from the original echoes [mbenes]
- move start_test invocations to just after their descriptions [mbenes]
- clean up $SAVED_DMSG on trap EXIT [pmladek]
- grep longer kernel taint line, avoid word-matching [mbenes, pmladek]
- add "===== TEST: $test =====" delimiter patch [pmladek]
Joe Lawrence (4):
selftests/livepatch: Don't clear dmesg when running tests
selftests/livepatch: use $(dmesg --notime) instead of manually
filtering
selftests/livepatch: refine dmesg 'taints' in dmesg comparison
selftests/livepatch: add test delimiter to dmesg
tools/testing/selftests/livepatch/README | 16 +++---
.../testing/selftests/livepatch/functions.sh | 32 ++++++++++-
.../selftests/livepatch/test-callbacks.sh | 55 ++++---------------
.../selftests/livepatch/test-ftrace.sh | 4 +-
.../selftests/livepatch/test-livepatch.sh | 12 +---
.../selftests/livepatch/test-shadow-vars.sh | 4 +-
.../testing/selftests/livepatch/test-state.sh | 21 +++----
7 files changed, 63 insertions(+), 81 deletions(-)
--
2.21.3
Hi, I tried to run kselftest but it stops with logs below.
----------------------------
# ./run_kselftest.sh
[ 126.214906] kselftest: Running tests in android
TAP version 13
# selftests: android: run.sh
1..1
# ./run.sh: line 3: ./ion_test.sh: not found
not ok 1 selftests: android: run.sh # exit=127
[ 126.351342] kselftest: Running tests in breakpoints
TAP version 13
# selftests: breakpoints: step_after_suspend_test
1..2
[ 126.464495] PM: suspend entry (s2idle)
[ 126.496441] Filesystems sync: 0.031 seconds
[ 126.499299] Freezing user space processes ... (elapsed 0.001 seconds) done.
[ 126.501161] OOM killer disabled.
[ 126.501293] Freezing remaining freezable tasks ... (elapsed 0.001
seconds) done.
[ 126.503018] printk: Suspending console(s) (use no_console_suspend to debug)
----------------------------
I used kernel 5.6.15 stable on qemu(x86_64) and used kselftest from same source.
I built kernel adding configurations below to be able to mount
kselftest directory on host.
----------------------------
CONFIG_NET_9P=y
CONFIG_BLK_MQ_VIRTIO=y
CONFIG_NET_9P_VIRTIO=y
CONFIG_VIRTIO=y
CONFIG_NET_9P_DEBUG=y
CONFIG_VIRTIO_PCI=y
CONFIG_FUSE_FS=y
CONFIG_VIRTIO_PCI_LEGACY=y
CONFIG_9P_FS=y
CONFIG_VIRTIO_FS=y
CONFIG_9P_FS_POSIX_ACL=y
CONFIG_CRYPTO_ENGINE=m
CONFIG_9P_FS_SECURITY=y
CONFIG_CRYPTO_DEV_VIRTIO=m
CONFIG_GDB_SCRIPTS=y
CONFIG_DEBUG_INFO=y
----------------------------
Then, I boot kernel with rootfs geterated by buildroot like this.
----------------------------
qemu-system-x86_64 -kernel arch/x86/boot/bzImage -boot c -m 2049M -hda
../buildroot/output/images/rootfs.ext4 -append \
"root=/dev/sda rw console=ttyS0,115200 acpi=off nokaslr" -serial
mon:stdio -display none \
-virtfs local,path=/home/arabishi/work/kselftest/kselftest,mount_tag=host0,security_model=passthrough,id=host0
----------------------------
What should I do ?
We need to pass the arguments provided to --kmake-arg to all make
invocations. In particular, the make invocations generating the configs
need to see the final make arguments, e.g. if config variables depend on
particular variables that are passed to make.
For example, when using '--kcsan --kmake-arg CC=clang-11', we would lose
CONFIG_KCSAN=y due to 'make oldconfig' not seeing that we want to use a
compiler that supports KCSAN.
Signed-off-by: Marco Elver <elver(a)google.com>
---
tools/testing/selftests/rcutorture/bin/configinit.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/rcutorture/bin/configinit.sh b/tools/testing/selftests/rcutorture/bin/configinit.sh
index 93e80a42249a..d6e5ce084b1c 100755
--- a/tools/testing/selftests/rcutorture/bin/configinit.sh
+++ b/tools/testing/selftests/rcutorture/bin/configinit.sh
@@ -32,11 +32,11 @@ if test -z "$TORTURE_TRUST_MAKE"
then
make clean > $resdir/Make.clean 2>&1
fi
-make $TORTURE_DEFCONFIG > $resdir/Make.defconfig.out 2>&1
+make $TORTURE_KMAKE_ARG $TORTURE_DEFCONFIG > $resdir/Make.defconfig.out 2>&1
mv .config .config.sav
sh $T/upd.sh < .config.sav > .config
cp .config .config.new
-yes '' | make oldconfig > $resdir/Make.oldconfig.out 2> $resdir/Make.oldconfig.err
+yes '' | make $TORTURE_KMAKE_ARG oldconfig > $resdir/Make.oldconfig.out 2> $resdir/Make.oldconfig.err
# verify new config matches specification.
configcheck.sh .config $c
--
2.27.0.290.gba653c62da-goog
This patch series adds partial read support via a new call
request_partial_firmware_into_buf.
Such support is needed when the whole file is not needed and/or
only a smaller portion of the file will fit into allocated memory
at any one time.
In order to accept the enhanced API it has been requested that kernel
selftests and upstreamed driver utilize the API enhancement and so
are included in this patch series.
Also in this patch series is the addition of a new Broadcom VK driver
utilizing the new request_firmware_into_buf enhanced API.
Further comment followed to add IMA support of the partial reads
originating from request_firmware_into_buf calls.
Changes from v8:
- correct compilation error when CONFIG_FW_LOADER not defined
Changes from v7:
- removed swiss army knife kernel_pread_* style approach
and simply add offset parameter in addition to those needed
in kernel_read_* functions thus removing need for kernel_pread enum
Changes from v6:
- update ima_post_read_file check on IMA_FIRMWARE_PARTIAL_READ
- adjust new driver i2c-slave-eeprom.c use of request_firmware_into_buf
- remove an extern
Changes from v5:
- add IMA FIRMWARE_PARTIAL_READ support
- change kernel pread flags to enum
- removed legacy support from driver
- driver fixes
Changes from v4:
- handle reset issues if card crashes
- allow driver to have min required msix
- add card utilization information
Changes from v3:
- fix sparse warnings
- fix printf format specifiers for size_t
- fix 32-bit cross-compiling reports 32-bit shifts
- use readl/writel,_relaxed to access pci ioremap memory,
removed memory barriers and volatile keyword with such change
- driver optimizations for interrupt/poll functionalities
Changes from v2:
- remove unnecessary code and mutex locks in lib/test_firmware.c
- remove VK_IOCTL_ACCESS_BAR support from driver and use pci sysfs instead
- remove bitfields
- remove Kconfig default m
- adjust formatting and some naming based on feedback
- fix error handling conditions
- use appropriate return codes
- use memcpy_toio instead of direct access to PCIE bar
Scott Branden (8):
fs: introduce kernel_pread_file* support
firmware: add request_partial_firmware_into_buf
test_firmware: add partial read support for request_firmware_into_buf
firmware: test partial file reads of request_partial_firmware_into_buf
bcm-vk: add bcm_vk UAPI
misc: bcm-vk: add Broadcom VK driver
MAINTAINERS: bcm-vk: add maintainer for Broadcom VK Driver
ima: add FIRMWARE_PARTIAL_READ support
MAINTAINERS | 7 +
drivers/base/firmware_loader/firmware.h | 5 +
drivers/base/firmware_loader/main.c | 79 +-
drivers/misc/Kconfig | 1 +
drivers/misc/Makefile | 1 +
drivers/misc/bcm-vk/Kconfig | 29 +
drivers/misc/bcm-vk/Makefile | 11 +
drivers/misc/bcm-vk/bcm_vk.h | 407 +++++
drivers/misc/bcm-vk/bcm_vk_dev.c | 1310 +++++++++++++++
drivers/misc/bcm-vk/bcm_vk_msg.c | 1440 +++++++++++++++++
drivers/misc/bcm-vk/bcm_vk_msg.h | 202 +++
drivers/misc/bcm-vk/bcm_vk_sg.c | 271 ++++
drivers/misc/bcm-vk/bcm_vk_sg.h | 60 +
drivers/misc/bcm-vk/bcm_vk_tty.c | 352 ++++
fs/exec.c | 93 +-
include/linux/firmware.h | 12 +
include/linux/fs.h | 15 +
include/uapi/linux/misc/bcm_vk.h | 99 ++
lib/test_firmware.c | 154 +-
security/integrity/ima/ima_main.c | 24 +-
.../selftests/firmware/fw_filesystem.sh | 80 +
21 files changed, 4599 insertions(+), 53 deletions(-)
create mode 100644 drivers/misc/bcm-vk/Kconfig
create mode 100644 drivers/misc/bcm-vk/Makefile
create mode 100644 drivers/misc/bcm-vk/bcm_vk.h
create mode 100644 drivers/misc/bcm-vk/bcm_vk_dev.c
create mode 100644 drivers/misc/bcm-vk/bcm_vk_msg.c
create mode 100644 drivers/misc/bcm-vk/bcm_vk_msg.h
create mode 100644 drivers/misc/bcm-vk/bcm_vk_sg.c
create mode 100644 drivers/misc/bcm-vk/bcm_vk_sg.h
create mode 100644 drivers/misc/bcm-vk/bcm_vk_tty.c
create mode 100644 include/uapi/linux/misc/bcm_vk.h
--
2.17.1
According to the TAP specification, a skipped test must be marked as "ok"
and annotated with the SKIP directive, for example
ok 23 # skip Insufficient flogiston pressure.
(https://testanything.org/tap-specification.html)
Fix the runner script to match this.
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
---
tools/testing/selftests/kselftest/runner.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kselftest/runner.sh b/tools/testing/selftests/kselftest/runner.sh
index 676b3a8b114d..f4815cbcd60f 100644
--- a/tools/testing/selftests/kselftest/runner.sh
+++ b/tools/testing/selftests/kselftest/runner.sh
@@ -77,7 +77,7 @@ run_one()
echo "ok $test_num $TEST_HDR_MSG") ||
(rc=$?; \
if [ $rc -eq $skip_rc ]; then \
- echo "not ok $test_num $TEST_HDR_MSG # SKIP"
+ echo "ok $test_num $TEST_HDR_MSG # SKIP"
elif [ $rc -eq $timeout_rc ]; then \
echo "#"
echo "not ok $test_num $TEST_HDR_MSG # TIMEOUT"
--
2.26.2