Commit e997ac58 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'linux_kselftest-next-7.1-rc1' of...

Merge tag 'linux_kselftest-next-7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull kselftest updates from Shuah Khan:

 - cpu-hotplug: fix to check if cpu hotplug is supported to avoid
   test failures when cpu hotplug isn't supported.

 - frace: fix to relevant comparisons and path checks in the helper so
   it  handles those patterns without spurious shell warnings.

 - runner.sh: add ktrap support

 - tracing: fix to make --logdir option work again

 - tracing: fix to check awk supports non POSIX strtonum()

 - mqueue: fix incorrectly named settings file to make sure the test
   used the correct timeout value

 - kselftest:
    - fix to treat xpass as successful result
    - add ksft_reset_state()

 - kselftest_harness:
    - validate kselftest exit codes are handled explicitly
    - add detection of invalid mixing of kselftest and harness
      functionality
    - add validation of intermixing of kselftest and harness
      functionality

 - run_kselftest.sh:
    - remove unused $ROOT
    - resolve BASE_DIR with pwd -P to avoid dependency on realpath
      or readlink commands to generate a physical absolute path for
      BASE_DIR
    - allow choosing per-test log directory
    - preserve subtarget failures in all/install

* tag 'linux_kselftest-next-7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  selftests/ftrace: Quote check_requires comparisons
  selftests: Preserve subtarget failures in all/install
  selftests/run_kselftest.sh: Allow choosing per-test log directory
  selftests/run_kselftest.sh: Resolve BASE_DIR with pwd -P
  selftests/run_kselftest.sh: Remove unused $ROOT
  selftests/cpu-hotplug: Fix check for cpu hotplug not supported
  selftests/mqueue: Fix incorrectly named file
  selftests: Use ktap helpers for runner.sh
  selftests: harness: Validate intermixing of kselftest and harness functionality
  selftests: harness: Detect illegal mixing of kselftest and harness functionality
  selftests: kselftest: Add ksft_reset_state()
  selftests: harness: Validate that explicit kselftest exitcodes are handled
  selftests: kselftest: Treat xpass as successful result
  selftests/tracing: Fix to check awk supports non POSIX strtonum()
  selftests/tracing: Fix to make --logdir option work again
parents 6198c86a f8e0a5a1
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -209,14 +209,14 @@ export KHDR_INCLUDES
.DEFAULT_GOAL := all

all:
	@ret=1;							\
	@ret=0;							\
	for TARGET in $(TARGETS) $(INSTALL_DEP_TARGETS); do	\
		BUILD_TARGET=$$BUILD/$$TARGET;			\
		mkdir $$BUILD_TARGET  -p;			\
		$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET	\
				O=$(abs_objtree)		\
				$(if $(FORCE_TARGETS),|| exit);	\
		ret=$$((ret * $$?));				\
		[ $$? -eq 0 ] || ret=1;			\
	done; exit $$ret;

run_tests: all
@@ -274,7 +274,7 @@ ifdef INSTALL_PATH
	install -m 744 kselftest/ksft.py $(INSTALL_PATH)/kselftest/
	install -m 744 run_kselftest.sh $(INSTALL_PATH)/
	rm -f $(TEST_LIST)
	@ret=1;	\
	@ret=0;	\
	for TARGET in $(TARGETS) $(INSTALL_DEP_TARGETS); do \
		BUILD_TARGET=$$BUILD/$$TARGET;	\
		$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET install \
@@ -283,7 +283,7 @@ ifdef INSTALL_PATH
				OBJ_PATH=$(INSTALL_PATH) \
				O=$(abs_objtree)		\
				$(if $(FORCE_TARGETS),|| exit);	\
		ret=$$((ret * $$?));		\
		[ $$? -eq 0 ] || ret=1;		\
	done; exit $$ret;


+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ prerequisite()
		exit $ksft_skip
	fi

	if ! ls $SYSFS/devices/system/cpu/cpu* > /dev/null 2>&1; then
	if ! ls $SYSFS/devices/system/cpu/cpu*/online > /dev/null 2>&1; then
		echo $msg cpu hotplug is not supported >&2
		exit $ksft_skip
	fi
+12 −6
Original line number Diff line number Diff line
@@ -130,8 +130,7 @@ parse_opts() { # opts
      shift 1
    ;;
    --logdir|-l)
      LOG_DIR=$2
      LINK_PTR=
      USER_LOG_DIR=$2
      shift 2
    ;;
    --rv)
@@ -199,6 +198,7 @@ fi
TOP_DIR=`absdir $0`
TEST_DIR=$TOP_DIR/test.d
TEST_CASES=`find_testcases $TEST_DIR`
USER_LOG_DIR=
KEEP_LOG=0
KTAP=0
DEBUG=0
@@ -210,12 +210,18 @@ RV_TEST=0
# Parse command-line options
parse_opts $*

[ $DEBUG -ne 0 ] && set -x

# TOP_DIR can be changed for rv. Setting log directory.
LOG_TOP_DIR=$TOP_DIR/logs
LOG_DATE=`date +%Y%m%d-%H%M%S`
if [ -n "$USER_LOG_DIR" ]; then
  LOG_DIR=$USER_LOG_DIR
  LINK_PTR=
else
  LOG_DIR=$LOG_TOP_DIR/$LOG_DATE/
  LINK_PTR=$LOG_TOP_DIR/latest

[ $DEBUG -ne 0 ] && set -x
fi

if [ $RV_TEST -ne 0 ]; then
	TRACING_DIR=$TRACING_DIR/rv
+2 −0
Original line number Diff line number Diff line
@@ -4,6 +4,8 @@
# requires: trace_marker_raw
# flags: instance

check_awk_strtonum || exit_unresolved

is_little_endian() {
	if lscpu | grep -q 'Little Endian'; then
		echo 1;
+11 −7
Original line number Diff line number Diff line
@@ -145,13 +145,13 @@ check_requires() { # Check required files and tracers
	p=${i%:program}
        r=${i%:README}
        t=${i%:tracer}
	if [ $p != $i ]; then
	    if ! which $p ; then
	if [ "$p" != "$i" ]; then
	    if ! which "$p" ; then
                echo "Required program $p is not found."
                exit_unresolved
	    fi
        elif [ $t != $i ]; then
            if ! grep -wq $t available_tracers ; then
        elif [ "$t" != "$i" ]; then
            if ! grep -wq "$t" available_tracers ; then
                echo "Required tracer $t is not configured."
                exit_unsupported
            fi
@@ -162,17 +162,21 @@ check_requires() { # Check required files and tracers
	    else
		test=$TRACING_DIR
	    fi
            if ! grep -Fq "$r" $test/README ; then
            if ! grep -Fq "$r" "$test"/README ; then
                echo "Required feature pattern \"$r\" is not in README."
                exit_unsupported
            fi
        elif [ ! -e $i ]; then
        elif [ ! -e "$i" ]; then
            echo "Required feature interface $i doesn't exist."
            exit_unsupported
        fi
    done
}

check_awk_strtonum() { # strtonum is GNU awk extension
    awk 'BEGIN{strtonum("0x1")}'
}

LOCALHOST=127.0.0.1

yield() {
Loading