Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752591AbbH0KzV (ORCPT ); Thu, 27 Aug 2015 06:55:21 -0400 Received: from ozlabs.org ([103.22.144.67]:59881 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751694AbbH0KzU (ORCPT ); Thu, 27 Aug 2015 06:55:20 -0400 Message-ID: <1440672918.18333.3.camel@ellerman.id.au> Subject: Re: [PATCH 3/7] selftests: exec: fix for running and installing From: Michael Ellerman To: Bamvor Jian Zhang Cc: linux-kernel@vger.kernel.org, broonie@linaro.org, khilman@linaro.org, tyler.baker@linaro.org, shuahkh@osg.samsung.com Date: Thu, 27 Aug 2015 20:55:18 +1000 In-Reply-To: <1439559818-21666-4-git-send-email-bamvor.zhangjian@linaro.org> References: <1439559818-21666-1-git-send-email-bamvor.zhangjian@linaro.org> <1439559818-21666-4-git-send-email-bamvor.zhangjian@linaro.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2636 Lines: 77 On Fri, 2015-08-14 at 21:43 +0800, Bamvor Jian Zhang wrote: > Fix three issues in exec testcase: In future please describe the issues you're trying to fix. Below you describe only the *fixes*, which means I have to work backward to work out what the issues were. > Add RUN_TESTS rules in order to running the testcases in the build > directory through "make TARGETS=exec kselftest" OK so the problem here is that subdir isn't created when we're *not* installing. It looks like we actually broke that in commit 84cbd9e4c457 ("selftests/exec: do not install subdir as it is already created"). If so I think the fix is just to add subdir as a dependency of all isn't it? > Copy symbol link and non-executable file instead of install it, > otherwise this test will fail after installation. And the problem here is that install wrecks the permissions, right? > Exec testcases need a "Makefile" in line 346, otherwise it will > be ENOENT instead of EACCES. OK. It seems it would be cleaner to have the test create a specific test file, rather than relying on the presence of the Makefile. I've been wondering if we should just be using rsync to install the files, rather than the current method. That way if the Makefile creates the correct files, they should then appear exactly the same in the installed directory. I had a quick look at it a while back, but didn't have time to test it 100%. Does the patch below fix it for you? cheers diff --git a/tools/testing/selftests/ftrace/Makefile b/tools/testing/selftests/ftrace/Makefile index 0acbeca47225..4e6ed13e7f66 100644 --- a/tools/testing/selftests/ftrace/Makefile +++ b/tools/testing/selftests/ftrace/Makefile @@ -1,7 +1,7 @@ all: TEST_PROGS := ftracetest -TEST_DIRS := test.d/ +TEST_DIRS := test.d include ../lib.mk diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index ee412bab7ed4..7082b7e8a2ee 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -13,10 +13,7 @@ run_tests: all define INSTALL_RULE mkdir -p $(INSTALL_PATH) - @for TEST_DIR in $(TEST_DIRS); do\ - cp -r $$TEST_DIR $(INSTALL_PATH); \ - done; - install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) + rsync -a $(TEST_DIRS) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(INSTALL_PATH)/ endef install: all -- 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/