faft: Fix the wrong cros path when autotest not cros_workon'ed

Some tools of lab_test require the path of cros dir. We computed it
using the relative path of the current autotest dir. However, when
autotest is not cros_workon'ed, the run_remote_tests.sh script uses
the autotest code from /build/board/usr/local/autotest. The original
path-finding is wrong in this case. This CL is to change use the cros
dir from the environment variable CROS_WORKON_SRCROOT.

BUG=None
TEST=run the lab_test code without cros_workon'ed:
$ cros_workon-link stop autotest
$ run_remote_tests.sh --board link --remote dut RecoveryButton/control$

Change-Id: Ic1786c88bc295435a932b9a51711d9dc7ad7a293
Reviewed-on: https://gerrit.chromium.org/gerrit/37494
Reviewed-by: Mike Truty <truty@chromium.org>
Commit-Ready: Tom Wai-Hong Tam <waihong@chromium.org>
Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
diff --git a/server/cros/faftsequence.py b/server/cros/faftsequence.py
index 92f8040..37501ad 100644
--- a/server/cros/faftsequence.py
+++ b/server/cros/faftsequence.py
@@ -21,10 +21,6 @@
 from autotest_lib.site_utils import lab_test
 from autotest_lib.site_utils.chromeos_test.common_util import ChromeOSTestError
 
-dirname = os.path.dirname(sys.modules[__name__].__file__)
-autotest_dir = os.path.abspath(os.path.join(dirname, "..", ".."))
-cros_dir = os.path.join(autotest_dir, "..", "..", "..", "..")
-
 class FAFTSequence(ServoTest):
     """
     The base class of Fully Automated Firmware Test Sequence.
@@ -356,8 +352,9 @@
           error.TestError: if the image is not a test image.
         """
         try:
-            build_ver, build_hash = lab_test.VerifyImageAndGetId(cros_dir,
-                                                                 image_path)
+            build_ver, build_hash = lab_test.VerifyImageAndGetId(
+                    os.environ['CROS_WORKON_SRCROOT'],
+                    image_path)
             logging.info('Build of image: %s %s', build_ver, build_hash)
         except ChromeOSTestError:
             raise error.TestError(