autotest: stage repair scripts to /usr/local/tmp

since /tmp is noexec.

BUG=chromium:1057424
TEST=Deployed to Jetstream lab, cleaned /usr/local on a DUT, ran a test,
  verified stateful_update was successful.

Change-Id: Id7e62b4e392c10a5d72994d26af6b1a758a34345
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2082031
Tested-by: Laurence Goodby <lgoodby@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2128456
Tested-by: Keith Haddow <haddowk@chromium.org>
Auto-Submit: Keith Haddow <haddowk@chromium.org>
Reviewed-by: Keith Haddow <haddowk@chromium.org>
Commit-Queue: Keith Haddow <haddowk@chromium.org>
diff --git a/server/cros/autoupdater.py b/server/cros/autoupdater.py
index b4d9cbe..271d2c2 100644
--- a/server/cros/autoupdater.py
+++ b/server/cros/autoupdater.py
@@ -636,7 +636,8 @@
         remote_script = '/usr/local/bin/%s' % script_name
         if self.host.path_exists(remote_script):
             return remote_script
-        remote_tmp_script = '/tmp/%s' % script_name
+        self.host.run('mkdir -p -m 1777 /usr/local/tmp')
+        remote_tmp_script = '/usr/local/tmp/%s' % script_name
         server_name = urlparse.urlparse(self.update_url)[1]
         script_url = 'http://%s/static/%s' % (server_name, script_name)
         fetch_script = (
diff --git a/server/cros/autoupdater_unittest.py b/server/cros/autoupdater_unittest.py
index cf82a29..b79a96e 100755
--- a/server/cros/autoupdater_unittest.py
+++ b/server/cros/autoupdater_unittest.py
@@ -278,12 +278,12 @@
 
         self.mox.ResetAll()
         fake_shell = '/bin/ash'
-        tmp_script = '/tmp/%s' % script_name
+        tmp_script = '/usr/local/tmp/%s' % script_name
         fake_result = self.mox.CreateMockAnything()
         fake_result.stdout = ' %s\n' % fake_shell
         host.path_exists(local_script).AndReturn(False)
-        host.run(mox.IgnoreArg(),
-                 ignore_status=True).AndReturn(fake_result)
+        host.run(mox.IgnoreArg())
+        host.run(mox.IgnoreArg()).AndReturn(fake_result)
 
         self.mox.ReplayAll()
         # Complicated case:  script not on DUT, so try to download it.