• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From ea307c2e597a51f6cf60a786f2f2839413571e61 Mon Sep 17 00:00:00 2001
2From: Steve Muckle <smuckle@google.com>
3Date: Mon, 9 Oct 2017 14:35:11 -0700
4Subject: [PATCH] selftests/exec: build exec kselftest for Android
5
6The Makefile for the exec kselftest creates a script, symlink, copy of
7the binary, etc. Rather than have VTS copy all these items to the
8target, create a wrapper script to create these on the target. Note that
9the test also tries to access its Makefile.
10
11Bug: 67016227
12Test: run vts-kernel -m VtsKernelLinuxKselftestStaging
13Change-Id: Ifba2670b11e3ba80050eb0c89c269e4da14bdd27
14Signed-off-by: Steve Muckle <smuckle@google.com>
15---
16
17 [smuckle@google.com: drop changes to Android-specific files for
18  tracking of changes to upstream]
19
20  tools/testing/selftests/exec/execveat.sh | 33 ++++++++++++++++++++++++++++++++
21 create mode 100755 tools/testing/selftests/exec/execveat.sh
22
23diff --git a/tools/testing/selftests/exec/execveat.sh b/tools/testing/selftests/exec/execveat.sh
24new file mode 100755
25index 000000000000..dc049eaef690
26--- /dev/null
27+++ b/tools/testing/selftests/exec/execveat.sh
28@@ -0,0 +1,33 @@
29+#!/system/bin/sh
30+
31+#
32+# Copyright (C) 2017 The Android Open Source Project
33+#
34+# Licensed under the Apache License, Version 2.0 (the "License");
35+# you may not use this file except in compliance with the License.
36+# You may obtain a copy of the License at
37+#
38+#      http://www.apache.org/licenses/LICENSE-2.0
39+#
40+# Unless required by applicable law or agreed to in writing, software
41+# distributed under the License is distributed on an "AS IS" BASIS,
42+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
43+# See the License for the specific language governing permissions and
44+# limitations under the License.
45+#
46+
47+# These are normally created as part of the kselftest build but for VTS
48+# it is probably easier to use a wrapper script that creates them
49+# at runtime, on target, as part of the test.
50+
51+DIR=$(dirname "$0")
52+cd $DIR && \
53+mkdir -p subdir && \
54+echo '#!/system/bin/sh' > script && \
55+echo 'exit $*' >> script && \
56+chmod +x script && \
57+touch Makefile && \
58+ln -s -f execveat execveat.symlink && \
59+cp execveat execveat.denatured && \
60+chmod -x execveat.denatured && \
61+./execveat
62--
632.16.0.rc1.238.g530d649a79-goog
64
65