Fix au_fsi tests for moblab

The au_fsi tests fail on moblab due to a permissions issue in the
directory created by omaha devserver. The directory is mounted as
noexec, so the gsutil installed by the devserver is not able to run
properly to stage the payload for the tests.

BUG=b:150283761
TEST=None

Change-Id: I745fa20bac5640454e1d11675a159e5aad51a26c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2111640
Tested-by: Kyle Shimabukuro <kyleshima@chromium.org>
Reviewed-by: Keith Haddow <haddowk@chromium.org>
Commit-Queue: Kyle Shimabukuro <kyleshima@chromium.org>
(cherry picked from commit 4a5ca762d51f0b8093cb5b258d40b91e1bd547d1)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2122968
diff --git a/server/cros/update_engine/omaha_devserver.py b/server/cros/update_engine/omaha_devserver.py
index 48c3e41..cd9b9a3 100644
--- a/server/cros/update_engine/omaha_devserver.py
+++ b/server/cros/update_engine/omaha_devserver.py
@@ -66,6 +66,7 @@
         self._devserver_pid = 0
         self._devserver_port = 0  # Determined later from devserver portfile.
         self._payload_location = payload_location
+        self._moblab = moblab
 
         # Temporary files for various devserver outputs.
         self._devserver_logfile = None
@@ -78,7 +79,6 @@
             self._devserver_dir = global_config.global_config.get_config_value(
                 'CROS', 'devserver_dir')
             ssh_user = 'moblab'
-            os.environ['CROS_CACHEDIR'] = '/mnt/moblab/cros_cache'
         else:
             self._devserver_dir = \
                 '/home/chromeos-test/chromiumos/src/platform/dev'
@@ -216,7 +216,16 @@
         # Invoke the Omaha/devserver on the remote server. Will attempt to kill
         # it with a SIGTERM after a predetermined timeout has elapsed, followed
         # by SIGKILL if not dead within 30 seconds from the former signal.
-        cmdlist = [
+        cmdlist = []
+
+        if self._moblab:
+            cmdlist.extend([
+                'export CROS_CACHEDIR=/usr/local/tmp/gsutil; ',
+                'mkdir -p "${CROS_CACHEDIR}/common"; ',
+                'sudo chmod uog+rwx -R "${CROS_CACHEDIR}"; ',
+            ])
+
+        cmdlist.extend([
                 'timeout', '-s', 'TERM', '-k', '30',
                 str(self._DEVSERVER_TIMELIMIT_SECONDS),
                 '%s/devserver.py' % self._devserver_dir,
@@ -229,7 +238,7 @@
                 '--static_dir=%s' % self._devserver_static_dir,
                 '--payload=%s' % os.path.join(self._devserver_static_dir,
                                               self._payload_location),
-        ]
+        ])
 
         if self._critical_update:
             cmdlist.append('--critical_update')
diff --git a/server/site_tests/autoupdate_ForcedOOBEUpdate/autoupdate_ForcedOOBEUpdate.py b/server/site_tests/autoupdate_ForcedOOBEUpdate/autoupdate_ForcedOOBEUpdate.py
index 561a2d1..7b435a9 100644
--- a/server/site_tests/autoupdate_ForcedOOBEUpdate/autoupdate_ForcedOOBEUpdate.py
+++ b/server/site_tests/autoupdate_ForcedOOBEUpdate/autoupdate_ForcedOOBEUpdate.py
@@ -109,7 +109,7 @@
 
         if interrupt is not None:
             # Choose a random downloaded progress to interrupt the update.
-            progress = random.uniform(0.1, 0.6)
+            progress = random.uniform(0.1, 0.15)
             logging.info('Progress when we will interrupt: %f', progress)
             self._wait_for_progress(progress)
             logging.info('We will now start interrupting the update.')