summaryrefslogtreecommitdiff
path: root/buildscripts
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2018-05-23 19:38:59 -0400
committerAndrew Morrow <acm@mongodb.com>2018-05-25 12:20:09 -0400
commitb322ee9200172276b8d4935c623728129d62c3ef (patch)
treee691ce375e63737ac36635326cddbaf14042525e /buildscripts
parent8c3738f1be3f42c0aee4d82f8deec547d8e74e8c (diff)
downloadmongo-b322ee9200172276b8d4935c623728129d62c3ef.tar.gz
SERVER-33889 Remove auditing command from embedded
Diffstat (limited to 'buildscripts')
-rwxr-xr-xbuildscripts/runandroidsim.sh40
-rwxr-xr-xbuildscripts/runiossim.sh15
2 files changed, 40 insertions, 15 deletions
diff --git a/buildscripts/runandroidsim.sh b/buildscripts/runandroidsim.sh
index 49038786b76..458cd93c2f8 100755
--- a/buildscripts/runandroidsim.sh
+++ b/buildscripts/runandroidsim.sh
@@ -20,28 +20,46 @@ shift
EMULATOR_PID=''
cleanup() {
- kill $EMULATOR_PID
- wait $EMULATOR_PID
- $ANDROID_SDK/tools/bin/avdmanager delete avd -n android_avd
-}
+ echo "Cleanup handler invoked"
+
+ if [ -z "$EMULATOR_PID" ]; then
+ echo "No EMULATOR_PID found; not killing"
+ else
+ echo "Killing emulator"
+ kill $EMULATOR_PID || true
-trap cleanup EXIT
+ echo "Waiting for emulator to shut down"
+ wait $EMULATOR_PID || true
+ fi
-# create a virtual device
+ echo "Deleting the virtual device"
+ $ANDROID_SDK/tools/bin/avdmanager delete avd -n android_avd || true
+
+ echo "Exiting with status $1"
+ exit $1
+}
+
+echo "Creating Android virtual device"
echo no | $ANDROID_SDK/tools/bin/avdmanager create avd --force -k "system-images;android-24;google_apis;$ANDROID_SYSTEM_IMAGE_ARCH" --name android_avd --abi google_apis/$ANDROID_SYSTEM_IMAGE_ARCH -p android_avd
-# start the device on the emulator
+trap 'cleanup $?' INT TERM EXIT
+
+echo "Starting the virtual device on the emulator"
$ANDROID_SDK/emulator/emulator @android_avd -no-window -no-audio &
EMULATOR_PID=$!
-#wait for the adb service to be ready for commands
+echo "Waiting for the adb service to be ready for commands"
$ANDROID_SDK/platform-tools/adb wait-for-device
-#have the adb service become root
+echo "Making the adb service become root"
$ANDROID_SDK/platform-tools/adb root
-#move the test to the device
+echo "Copying the test to the virtual device"
$ANDROID_SDK/platform-tools/adb push $DIRECTORY /data
-#run the device
+echo "Running the test on the virtual device"
$ANDROID_SDK/platform-tools/adb shell /data/$(basename $DIRECTORY)/$TEST_PATH_IN_DIRECTORY "$@"
+
+# Do not add additional statements after the above adb invocation without
+# forwarding its exit status or you will cause failing tests to appear
+# to succeed.
diff --git a/buildscripts/runiossim.sh b/buildscripts/runiossim.sh
index 73cfe8ffe28..77e0be6b75d 100755
--- a/buildscripts/runiossim.sh
+++ b/buildscripts/runiossim.sh
@@ -25,23 +25,30 @@ shift
cleanup() {
echo "Shutting down simulator"
- xcrun simctl shutdown $_SimId
+ xcrun simctl shutdown $_SimId || true
echo "Erasing simulator"
- xcrun simctl erase $_SimId
+ xcrun simctl erase $_SimId || true
echo "Deleting simulator"
- xcrun simctl delete $_SimId
+ xcrun simctl delete $_SimId || true
+
+ echo "Exiting with status $1"
+ exit $1
}
echo "Creating simulator"
_SimId=$(xcrun simctl create mongodb-simulator-$DEVICE.$RUNTIME "com.apple.CoreSimulator.SimDeviceType.$DEVICE" "com.apple.CoreSimulator.SimRuntime.$RUNTIME")
echo "Simulator created with ID $_SimId"
-trap cleanup EXIT
+trap 'cleanup $?' INT TERM EXIT
echo "Booting simulator"
xcrun simctl boot $_SimId
echo "Spawning test program in simulator"
xcrun simctl spawn $_SimId "$TEST" "$@"
+
+# Do not add additional statements after the above spawn without
+# forwarding its exit status or you will cause failing tests to appear
+# to succeed.