Commit d17f994f authored by dpranke@chromium.org's avatar dpranke@chromium.org

Make bitmaptools executable after downloading it from cloud storage.

R=dtu@chromium.org, satyanarayana@google.com
BUG=396317

Review URL: https://codereview.chromium.org/463353002

Cr-Commit-Position: refs/heads/master@{#289533}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289533 0039d316-1c4b-4281-b951-d872f2087c98
parent 937161ba
......@@ -3,6 +3,7 @@
# found in the LICENSE file.
import os
import stat
from telemetry import decorators
from telemetry.util import cloud_storage
......@@ -48,6 +49,11 @@ def FindPath(binary_name, platform_name):
cloud_storage.GetIfChanged(_GetBinPath(binary_name, platform_name))
command = _GetBinPath(binary_name, platform_name)
# Ensure the downloaded file is actually executable.
if command and os.path.exists(command):
os.chmod(command,
stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | stat.S_IRGRP)
# Return an absolute path consistently.
if command:
command = os.path.abspath(command)
......
......@@ -3,6 +3,7 @@
# found in the LICENSE file.
import os
import stat
import unittest
from telemetry import decorators
......@@ -15,3 +16,5 @@ class SupportBinariesTest(unittest.TestCase):
md5sum_path = support_binaries.FindPath('md5sum_bin_host', 'linux')
self.assertNotEquals(md5sum_path, None)
self.assertTrue(os.path.isabs(md5sum_path))
st = os.stat(md5sum_path)
self.assertTrue(st.st_mode & stat.S_IXUSR)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment