summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Rohr <prohr@google.com>2024-04-15 14:32:26 -0700
committerPatrick Rohr <prohr@google.com>2024-04-15 15:20:38 -0700
commite5d5a0e522de601dd03d3a5eb32e6075cf5f4c22 (patch)
treea4ea971052bc95adef916b33ca4f718475a4914b
parent949ab1d679236b3dadd1afc0d8aeaa9adba28484 (diff)
downloadtests-e5d5a0e522de601dd03d3a5eb32e6075cf5f4c22.tar.gz
Add an error message to remind users to run from kernel directory
This change will hopefully remind my future self to run these tests from the right directory. Test: run script from Android dir Change-Id: I717baa05e6103d0601644e2b13e96dbed676d4c2
-rwxr-xr-xnet/test/run_net_test.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/test/run_net_test.sh b/net/test/run_net_test.sh
index a496241..8635eab 100755
--- a/net/test/run_net_test.sh
+++ b/net/test/run_net_test.sh
@@ -125,6 +125,11 @@ nowrite=1
nobuild=0
norun=0
+if [[ ! -f "${KERNEL_DIR}/Makefile" ]]; then
+ echo "No kernel Makefile found. Are you running this from a kernel directory?"
+ exit 1
+fi
+
KVER_MAJOR="$(sed -rn 's@^ *VERSION *= *([0-9]+)$@\1@p' < "${KERNEL_DIR}/Makefile")"
KVER_MINOR="$(sed -rn 's@^ *PATCHLEVEL *= *([0-9]+)$@\1@p' < "${KERNEL_DIR}/Makefile")"
KVER_LEVEL="$(sed -rn 's@^ *SUBLEVEL *= *([0-9]+)$@\1@p' < "${KERNEL_DIR}/Makefile")"