veyron/services/mgmt/build/buildd: Bug fix for shell test.

The shell test would leave spawned processes lying around
(mounttabled and buildd would not be kill when the test exits).
For example, on the continuous build server there are about 40
mounttabled and buildd daemon processes spawned by previous
executions of these tests sitting idle.

The problem was the order in which the trap handlers are setup.
This current change will prevent buildd/test.sh from leaving
these useless processes around on our continuous build machine,
but the right fix (executing all registered trap handlers)
is still to be figured out.

Change-Id: I9126a1e30451bec18edfe8b1b128a89855c6b577
diff --git a/services/mgmt/build/buildd/test.sh b/services/mgmt/build/buildd/test.sh
index cb67c4c..0cfce9b 100755
--- a/services/mgmt/build/buildd/test.sh
+++ b/services/mgmt/build/buildd/test.sh
@@ -5,8 +5,16 @@
 # This test starts a build server daemon and uses the build client to
 # verify that <build>.Build() works as expected.
 
-source "${VEYRON_ROOT}/environment/scripts/lib/shell_test.sh"
+# shell_test.sh must be sourced *last* Because it has a "trap" statement that
+# cleans up processes on exit and we want to avoid this trap statement being
+# overridden by other scripts.  For example, go.sh sources a script which sets
+# up a different trap handler and thus, if go.sh is sourced second, then it
+# overrides the trap handler setup in shell_test.sh.
+# TODO(jsimsa,ashankar): Figure out a way to execute all trap handlers instead
+# of having to worry about ordering the imports and/or skipping some trap
+# handlers.
 source "${VEYRON_ROOT}/environment/scripts/lib/go.sh"
+source "${VEYRON_ROOT}/environment/scripts/lib/shell_test.sh"
 
 build() {
   local -r GO="${REPO_ROOT}/scripts/build/go"