[autotest] grant chromeos-test the right access in setup script
After mounting /usr/local/autotest, we need to grant
chromeos-test (or the current user) access to that folder.
TEST=Run the script and check file permission.
BUG=None
Change-Id: I81ef169966bb1e0da8a9dcc8989adb8b8f4942c1
Reviewed-on: https://chromium-review.googlesource.com/230630
Tested-by: Fang Deng <fdeng@chromium.org>
Reviewed-by: Prashanth B <beeps@chromium.org>
Commit-Queue: Prashanth B <beeps@chromium.org>
diff --git a/site_utils/setup_dev_autotest.sh b/site_utils/setup_dev_autotest.sh
index 75a5f6a..bda4149 100755
--- a/site_utils/setup_dev_autotest.sh
+++ b/site_utils/setup_dev_autotest.sh
@@ -222,6 +222,8 @@
sudo mount --bind "${AUTOTEST_DIR}" "${AT_DIR}"
echo -e "Done!\n"
+sudo chown -R "$(whoami)" "${AT_DIR}"
+
EXISTING_MOUNT=$(egrep "/.+[[:space:]]${AT_DIR}" /etc/fstab || /bin/true)
if [ -n "${EXISTING_MOUNT}" ]; then
echo "${EXISTING_MOUNT}" | awk '{print $1 " already automounting at " $2}'