[autotest] Use the python side chroot to execute dut-control
The latest dut-control gets its version number by querying the python
package resources. As the dut-control is installed inside chroot,
only the python inside chroot knows the package resources. Using
the python outside chroot causes the error of the 'servo' distribution
not found.
BUG=chromium:538392
TEST=(inside chroot) contrib/servo-stat ${LAB_DUT_IP}
TEST=(outside chroot) cd $REPO/chromeos-admin
(outside chroot) lab-tools/setup_lab_tools
(outside chroot) servo-stat ${LAB_DUT_IP}
Change-Id: I99c2dbbe267133ef2a5798a4e0d2a95d91e11567
Reviewed-on: https://chromium-review.googlesource.com/303751
Trybot-Ready: Wai-Hong Tam <waihong@chromium.org>
Tested-by: Wai-Hong Tam <waihong@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
diff --git a/contrib/servo-stat b/contrib/servo-stat
index 72e211a..b106283 100755
--- a/contrib/servo-stat
+++ b/contrib/servo-stat
@@ -16,6 +16,7 @@
# readlink -f $0, in case $0 is a symlink from somewhere else
REPO=$(dirname $(readlink -f $0))/../../../../..
REPO=$(readlink -f $REPO)
+PYTHON=$(readlink -f $REPO/chroot/usr/bin/python2.7)
HDCTOOLS=$(readlink -f $REPO/chroot/usr/lib/python2.7/site-packages/servo)
KEYFILE=$REPO
KEYFILE=$KEYFILE/src/third_party/chromiumos-overlay
@@ -36,7 +37,7 @@
cp $KEYFILE $TMPKEYS
dut_control() {
- timeout 90 python $HDCTOOLS/dut_control.py "$@"
+ timeout 90 $PYTHON $HDCTOOLS/dut_control.py "$@"
}
remote() {