Reland "Copy crash_dump from device to chroot."
This reverts commit ef4b8a5246278c51a74a312586a4fd3b8c0a4b10.
Reason for revert: Don't fail if the file doesn't exist, and try
/system/bin instead.
Change-Id: Ib5f47800622ac3342f7330419d089b3f7cfa8c82
diff --git a/tools/buildbot-sync.sh b/tools/buildbot-sync.sh
index 28dab0c..5970cc7 100755
--- a/tools/buildbot-sync.sh
+++ b/tools/buildbot-sync.sh
@@ -111,6 +111,26 @@
activate_apex com.android.conscrypt
activate_apex com.android.os.statsd
+# Replace the crash dump binary with the one on the device. This is because
+# the tombstoned server running is the one on the device.
+crash_dump_locations=(
+ # Location for Q+ devices.
+ "/apex/com.android.runtime/bin"
+ # Location on devices prior to Q.
+ "/system/bin/"
+)
+
+for b in 32 64; do
+ for crash_dump_location in ${crash_dump_locations[@]}; do
+ crash_dump_path="$crash_dump_location/crash_dump$b"
+ if adb shell test -x "$crash_dump_path"; then
+ msginfo "Copying $crash_dump_path from device to chroot"
+ adb shell cp "$crash_dump_path" "$ART_TEST_CHROOT/$crash_dump_path"
+ break
+ fi
+ done
+done
+
# Generate primary boot images on device for testing.
for b in {32,64}; do
basename="generate-boot-image$b"