Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755263AbbHNNrq (ORCPT ); Fri, 14 Aug 2015 09:47:46 -0400 Received: from mail-oi0-f50.google.com ([209.85.218.50]:33502 "EHLO mail-oi0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755227AbbHNNro (ORCPT ); Fri, 14 Aug 2015 09:47:44 -0400 From: Bamvor Jian Zhang To: linux-kernel@vger.kernel.org Cc: broonie@linaro.org, khilman@linaro.org, tyler.baker@linaro.org, bamvor.zhangjian@linaro.org, shuahkh@osg.samsung.com Subject: [PATCH 3/7] selftests: exec: fix for running and installing Date: Fri, 14 Aug 2015 21:43:34 +0800 Message-Id: <1439559818-21666-4-git-send-email-bamvor.zhangjian@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1439559818-21666-1-git-send-email-bamvor.zhangjian@linaro.org> References: <1439559818-21666-1-git-send-email-bamvor.zhangjian@linaro.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2043 Lines: 56 Fix three issues in exec testcase: Add RUN_TESTS rules in order to running the testcases in the build directory through "make TARGETS=exec kselftest" Copy symbol link and non-executable file instead of install it, otherwise this test will fail after installation. Exec testcases need a "Makefile" in line 346, otherwise it will be ENOENT instead of EACCES. Signed-off-by: Bamvor Jian Zhang --- tools/testing/selftests/exec/Makefile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/exec/Makefile b/tools/testing/selftests/exec/Makefile index 6b76bfd..34966a0 100644 --- a/tools/testing/selftests/exec/Makefile +++ b/tools/testing/selftests/exec/Makefile @@ -1,4 +1,4 @@ -CFLAGS = -Wall +CFLAGS = -Wall -g BINARIES = execveat DEPS = execveat.symlink execveat.denatured script all: $(BINARIES) $(DEPS) @@ -18,11 +18,19 @@ execveat.denatured: execveat $(CC) $(CFLAGS) -o $@ $^ TEST_PROGS := execveat -TEST_FILES := $(DEPS) +TEST_FILES := script include ../lib.mk -override EMIT_TESTS := echo "mkdir -p subdir; (./execveat && echo \"selftests: execveat [PASS]\") || echo \"selftests: execveat [FAIL]\"" +override RUN_TESTS := mkdir -p subdir; (./execveat && echo "selftests: execveat [PASS]") || echo "selftests: execveat [FAIL]" + +override EMIT_TESTS := echo "mkdir -p subdir; touch Makefile; (./execveat && echo \"selftests: execveat [PASS]\") || echo \"selftests: execveat [FAIL]\"" + +override define INSTALL_RULE + mkdir -p $(INSTALL_PATH) + install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) + cp -a execveat.symlink execveat.denatured $(INSTALL_PATH) +endef clean: rm -rf $(BINARIES) $(DEPS) subdir.moved execveat.moved xxxxx* -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/