bustage - fail when missing shared memory; r=aki
authorHal Wine <hwine@mozilla.com>
Tue, 14 Jan 2014 12:50:14 -0800
changeset 9686 c0151ac9e04bf6ce3570b49dc23b4d44afb25e51
parent 9685 60c3a0fe663d9700c50859b9e14e93db149a843a
child 9687 a51cd0264dc3536a95783c01e7c188cdeb61245f
push id1
push userroot
push dateWed, 17 Dec 2014 00:18:48 +0000
reviewersaki
bustage - fail when missing shared memory; r=aki
test-masters.sh
--- a/test-masters.sh
+++ b/test-masters.sh
@@ -1,13 +1,31 @@
 #!/bin/bash
 # This script has been rewritten in setup_master.py using
 # the -t option.  We use that now
 exit=0
 
+# even though it isn't fully used, the config check does require a valid
+# shared memory setup AT THE DEFAULT LOCATION. If you're running on a
+# laptop, that may not exist. Fail early.
+#
+# OSX note: it "works" (for test-masters purposes) to just create the
+#           directory, even though that isn't how shared memory is
+#           handled on OSX. The directories must be owned by the id
+#           running the tests.
+shm=(/dev/shm/queue)
+good_shm=true
+for needed_dir in ${shm[@]}; do
+    if ! test -w $needed_dir; then
+        echo 1>&2 "No shm setup, please create writable directory '$needed_dir'"
+        good_shm=false
+    fi
+done
+$good_shm || exit 1
+
 WORK=test-output
 mkdir $WORK 2>/dev/null
 
 actioning="Checking"
 MASTERS_JSON_URL="${MASTERS_JSON_URL:-http://hg.mozilla.org/build/tools/raw-file/tip/buildfarm/maintenance/production-masters.json}"
 
 atexit=()
 trap 'for cmd in "${atexit[@]}"; do eval $cmd; done' EXIT