Add Vogar expectations file for tests failing because of missing getrandom().
Add Libcore tests using the `getrandom()` syscall (introduced in Linux
3.17) to a new expectations
file (`art/tools/libcore_no_getrandom_failures.txt`) and add new
option `--no-getrandom` to script `art/tools/run-libcore-tests.sh` to
honor this expectations file.
This option is meant for ART Buildbot devices that have a kernel older
than Linux 3.17, like fugu (Nexus Player) devices, which runs
Linux 3.10.
Test: Rely on the ART Buildbot, once crrev.com/c/1811251 is in.
Bug: 141230711
Change-Id: I8c513da63012c86e81038fd1d3cbb57e8ac3c17c
diff --git a/tools/run-libcore-tests.sh b/tools/run-libcore-tests.sh
index 22f2549..5f49bbe 100755
--- a/tools/run-libcore-tests.sh
+++ b/tools/run-libcore-tests.sh
@@ -131,6 +131,9 @@
gcstress=false
debug=false
+# Run tests that use the getrandom() syscall? (Requires Linux 3.17+).
+getrandom=true
+
# Don't use device mode by default.
device_mode=false
@@ -164,6 +167,9 @@
elif [[ "$1" == "-Xgc:gcstress" ]]; then
gcstress=true
shift
+ elif [[ "$1" == "--no-getrandom" ]]; then
+ getrandom=false
+ shift
elif [[ "$1" == "" ]]; then
break
else
@@ -214,6 +220,13 @@
working_packages+=("libcore.libcore.icu")
fi
+if $getrandom; then :; else
+ # Ignore failures in tests that use the getrandom() syscall (which requires
+ # Linux 3.17+). This is needed on fugu (Nexus Player) devices, where the
+ # kernel is Linux 3.10.
+ expectations="$expectations --expectations art/tools/libcore_no_getrandom_failures.txt"
+fi
+
# Run the tests using vogar.
echo "Running tests for the following test packages:"
echo ${working_packages[@]} | tr " " "\n"