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

Merge tag 'linux-kselftest-5.5-rc1-fixes' of...

Merge tag 'linux-kselftest-5.5-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull kselftest fixes from Shuah Khan:
 "This consists of several fixes to tests and framework.

  Masami Hiramatsu fixed several tests to build and run correctly on arm
  and other 32bit architectures"

* tag 'linux-kselftest-5.5-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  selftests: sync: Fix cast warnings on arm
  selftests: net: Fix printf format warnings on arm
  selftests: net: Use size_t and ssize_t for counting file size
  selftests: vm: Build/Run 64bit tests only on 64bit arch
  selftests: proc: Make va_max 1MB
  kselftest: Fix NULL INSTALL_PATH for TARGETS runlist
  selftests: Move kselftest_module.sh into kselftest/
  selftests: gen_kselftest_tar.sh: Do not clobber kselftest/
  selftests: breakpoints: Fix a typo of function name
  selftests: Fix O= and KBUILD_OUTPUT handling for relative paths
parents 1c1ff483 ed2d8fa7
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -86,10 +86,10 @@ override LDFLAGS =
endif

ifneq ($(O),)
	BUILD := $(O)
	BUILD := $(abs_objtree)
else
	ifneq ($(KBUILD_OUTPUT),)
		BUILD := $(KBUILD_OUTPUT)/kselftest
		BUILD := $(abs_objtree)/kselftest
	else
		BUILD := $(shell pwd)
		DEFAULT_INSTALL_HDR_PATH := 1
@@ -102,6 +102,7 @@ include $(top_srcdir)/scripts/subarch.include
ARCH           ?= $(SUBARCH)
export KSFT_KHDR_INSTALL_DONE := 1
export BUILD
#$(info abd_objtree = $(abs_objtree) BUILD = $(BUILD))

# build and run gpio when output directory is the src dir.
# gpio has dependency on tools/gpio and builds tools/gpio
@@ -190,6 +191,7 @@ install: all
ifdef INSTALL_PATH
	@# Ask all targets to install their files
	mkdir -p $(INSTALL_PATH)/kselftest
	install -m 744 kselftest/module.sh $(INSTALL_PATH)/kselftest/
	install -m 744 kselftest/runner.sh $(INSTALL_PATH)/kselftest/
	install -m 744 kselftest/prefix.pl $(INSTALL_PATH)/kselftest/
	@for TARGET in $(TARGETS); do \
@@ -213,7 +215,7 @@ ifdef INSTALL_PATH
	@# included in the generated runlist.
	for TARGET in $(TARGETS); do \
		BUILD_TARGET=$$BUILD/$$TARGET;	\
		[ ! -d $$INSTALL_PATH/$$TARGET ] && echo "Skipping non-existent dir: $$TARGET" && continue; \
		[ ! -d $(INSTALL_PATH)/$$TARGET ] && echo "Skipping non-existent dir: $$TARGET" && continue; \
		echo "[ -w /dev/kmsg ] && echo \"kselftest: Running tests in $$TARGET\" >> /dev/kmsg" >> $(ALL_SCRIPT); \
		echo "cd $$TARGET" >> $(ALL_SCRIPT); \
		echo -n "run_many" >> $(ALL_SCRIPT); \
+1 −1
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ static bool set_watchpoint(pid_t pid, int size, int wp)
	return false;
}

static bool arun_test(int wr_size, int wp_size, int wr, int wp)
static bool run_test(int wr_size, int wp_size, int wr, int wp)
{
	int status;
	siginfo_t siginfo;
+13 −8
Original line number Diff line number Diff line
@@ -38,16 +38,21 @@ main()
	esac
	fi

	install_dir=./kselftest
	# Create working directory.
	dest=`pwd`
	install_work="$dest"/kselftest_install
	install_name=kselftest
	install_dir="$install_work"/"$install_name"
	mkdir -p "$install_dir"

	# Run install using INSTALL_KSFT_PATH override to generate install
	# directory
./kselftest_install.sh
tar $copts kselftest${ext} $install_dir
	./kselftest_install.sh "$install_dir"
	(cd "$install_work"; tar $copts "$dest"/kselftest${ext} $install_name)
	echo "Kselftest archive kselftest${ext} created!"

# clean up install directory
rm -rf kselftest
	# clean up top-level install work directory
	rm -rf "$install_work"
}

main "$@"
+12 −12
Original line number Diff line number Diff line
@@ -6,30 +6,30 @@
# Author: Shuah Khan <shuahkh@osg.samsung.com>
# Copyright (C) 2015 Samsung Electronics Co., Ltd.

install_loc=`pwd`

main()
{
	if [ $(basename $install_loc) !=  "selftests" ]; then
	base_dir=`pwd`
	install_dir="$base_dir"/kselftest_install

	# Make sure we're in the selftests top-level directory.
	if [ $(basename "$base_dir") !=  "selftests" ]; then
		echo "$0: Please run it in selftests directory ..."
		exit 1;
	fi

	# Only allow installation into an existing location.
	if [ "$#" -eq 0 ]; then
		echo "$0: Installing in default location - $install_loc ..."
		echo "$0: Installing in default location - $install_dir ..."
	elif [ ! -d "$1" ]; then
		echo "$0: $1 doesn't exist!!"
		exit 1;
	else
		install_loc=$1
		echo "$0: Installing in specified location - $install_loc ..."
		install_dir="$1"
		echo "$0: Installing in specified location - $install_dir ..."
	fi

	install_dir=$install_loc/kselftest_install

# Create install directory
	mkdir -p $install_dir
	# Build tests
	KSFT_INSTALL_PATH=$install_dir make install
	KSFT_INSTALL_PATH="$install_dir" make install
}

main "$@"
Loading