Home | History | Annotate | Download | only in patches
      1 From ea307c2e597a51f6cf60a786f2f2839413571e61 Mon Sep 17 00:00:00 2001
      2 From: Steve Muckle <smuckle (a] google.com>
      3 Date: Mon, 9 Oct 2017 14:35:11 -0700
      4 Subject: [PATCH] selftests/exec: build exec kselftest for Android
      5 
      6 The Makefile for the exec kselftest creates a script, symlink, copy of
      7 the binary, etc. Rather than have VTS copy all these items to the
      8 target, create a wrapper script to create these on the target. Note that
      9 the test also tries to access its Makefile.
     10 
     11 Bug: 67016227
     12 Test: run vts-kernel -m VtsKernelLinuxKselftestStaging
     13 Change-Id: Ifba2670b11e3ba80050eb0c89c269e4da14bdd27
     14 Signed-off-by: Steve Muckle <smuckle (a] google.com>
     15 ---
     16 
     17  [smuckle (a] 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 
     23 diff --git a/tools/testing/selftests/exec/execveat.sh b/tools/testing/selftests/exec/execveat.sh
     24 new file mode 100755
     25 index 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 -- 
     63 2.16.0.rc1.238.g530d649a79-goog
     64 
     65