mirror of
https://github.com/torvalds/linux.git
synced 2026-04-19 15:24:02 -04:00
Pull kselftest update from Shuah Khan: - livepatch restructuring to move the module out of lib to be built as a out-of-tree modules during kselftest build. This makes it easier change, debug and rebuild the tests by running make on the selftests/livepatch directory, which is not currently possible since the modules on lib/livepatch are build and installed using the main makefile modules target. - livepatch restructuring fixes for problems found by kernel test robot. The change skips the test if kernel-devel isn't installed (default value of KDIR), or if KDIR variable passed doesn't exists. - resctrl test restructuring and new non-contiguous CBMs CAT test - new ktap_helpers to print diagnostic messages, pass/fail tests based on exit code, abort test, and finish the test. - a new test verify power supply properties. - a new ftrace to exercise function tracer across cpu hotplug. - timeout increase for mqueue test to allow the test to run on i3.metal AWS instances. - minor spelling corrections in several tests. - missing gitignore files and changes to existing gitignore files. * tag 'linux_kselftest-next-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (57 commits) kselftest: Add basic test for probing the rust sample modules selftests: lib.mk: Do not process TEST_GEN_MODS_DIR selftests: livepatch: Avoid running the tests if kernel-devel is missing selftests: livepatch: Add initial .gitignore selftests/resctrl: Add non-contiguous CBMs CAT test selftests/resctrl: Add resource_info_file_exists() selftests/resctrl: Split validate_resctrl_feature_request() selftests/resctrl: Add a helper for the non-contiguous test selftests/resctrl: Add test groups and name L3 CAT test L3_CAT selftests: sched: Fix spelling mistake "hiearchy" -> "hierarchy" selftests/mqueue: Set timeout to 180 seconds selftests/ftrace: Add test to exercize function tracer across cpu hotplug selftest: ftrace: fix minor typo in log selftests: thermal: intel: workload_hint: add missing gitignore selftests: thermal: intel: power_floor: add missing gitignore selftests: uevent: add missing gitignore selftests: Add test to verify power supply properties selftests: ktap_helpers: Add a helper to finish the test selftests: ktap_helpers: Add a helper to abort the test selftests: ktap_helpers: Add helper to pass/fail test based on exit code ...
81 lines
1.9 KiB
Bash
Executable File
81 lines
1.9 KiB
Bash
Executable File
#!/bin/bash
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# Copyright (c) 2023 Collabora Ltd
|
|
#
|
|
# Based on Frank Rowand's dt_stat script.
|
|
#
|
|
# This script tests for devices that were declared on the Devicetree and are
|
|
# expected to bind to a driver, but didn't.
|
|
#
|
|
# To achieve this, two lists are used:
|
|
# * a list of the compatibles that can be matched by a Devicetree node
|
|
# * a list of compatibles that should be ignored
|
|
#
|
|
|
|
DIR="$(dirname $(readlink -f "$0"))"
|
|
|
|
source "${DIR}"/../kselftest/ktap_helpers.sh
|
|
|
|
PDT=/proc/device-tree/
|
|
COMPAT_LIST="${DIR}"/compatible_list
|
|
IGNORE_LIST="${DIR}"/compatible_ignore_list
|
|
|
|
ktap_print_header
|
|
|
|
if [[ ! -d "${PDT}" ]]; then
|
|
ktap_skip_all "${PDT} doesn't exist."
|
|
exit "${KSFT_SKIP}"
|
|
fi
|
|
|
|
nodes_compatible=$(
|
|
for node in $(find ${PDT} -type d); do
|
|
[ ! -f "${node}"/compatible ] && continue
|
|
# Check if node is available
|
|
if [[ -e "${node}"/status ]]; then
|
|
status=$(tr -d '\000' < "${node}"/status)
|
|
[[ "${status}" != "okay" && "${status}" != "ok" ]] && continue
|
|
fi
|
|
echo "${node}" | sed -e 's|\/proc\/device-tree||'
|
|
done | sort
|
|
)
|
|
|
|
nodes_dev_bound=$(
|
|
IFS=$'\n'
|
|
for dev_dir in $(find /sys/devices -type d); do
|
|
[ ! -f "${dev_dir}"/uevent ] && continue
|
|
[ ! -d "${dev_dir}"/driver ] && continue
|
|
|
|
grep '^OF_FULLNAME=' "${dev_dir}"/uevent | sed -e 's|OF_FULLNAME=||'
|
|
done
|
|
)
|
|
|
|
num_tests=$(echo ${nodes_compatible} | wc -w)
|
|
ktap_set_plan "${num_tests}"
|
|
|
|
retval="${KSFT_PASS}"
|
|
for node in ${nodes_compatible}; do
|
|
if ! echo "${nodes_dev_bound}" | grep -E -q "(^| )${node}( |\$)"; then
|
|
compatibles=$(tr '\000' '\n' < "${PDT}"/"${node}"/compatible)
|
|
|
|
for compatible in ${compatibles}; do
|
|
if grep -x -q "${compatible}" "${IGNORE_LIST}"; then
|
|
continue
|
|
fi
|
|
|
|
if grep -x -q "${compatible}" "${COMPAT_LIST}"; then
|
|
ktap_test_fail "${node}"
|
|
retval="${KSFT_FAIL}"
|
|
continue 2
|
|
fi
|
|
done
|
|
ktap_test_skip "${node}"
|
|
else
|
|
ktap_test_pass "${node}"
|
|
fi
|
|
|
|
done
|
|
|
|
ktap_print_totals
|
|
exit "${retval}"
|