Commit 8dd8ea73 authored by kkania@google.com's avatar kkania@google.com

Adjusted timeouts for a couple failing tests; switched from umount to hdiutil...

Adjusted timeouts for a couple failing tests; switched from umount to hdiutil detach to solve some unmounting problems seen on Tiger.
Review URL: http://codereview.chromium.org/332030

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30077 0039d316-1c4b-4281-b951-d872f2087c98
parent 7cc7e1dd
...@@ -38,7 +38,6 @@ import os ...@@ -38,7 +38,6 @@ import os
import subprocess import subprocess
import shutil import shutil
import sys import sys
import time
import runner_constants as const import runner_constants as const
import util import util
...@@ -86,15 +85,41 @@ def AddPythonPath(path): ...@@ -86,15 +85,41 @@ def AddPythonPath(path):
def InstallO3DPlugin(): def InstallO3DPlugin():
"""Installs O3D plugin.""" """Installs O3D plugin."""
logging.info('Installing plugin...')
if util.IsWindows(): if util.IsWindows():
installer_path = os.path.join(const.PRODUCT_DIR_PATH, 'o3d.msi') installer_path = os.path.join(const.PRODUCT_DIR_PATH, 'o3d.msi')
if not os.path.exists(installer_path):
logging.error('Installer path not found, %s' % installer_path)
return False
install_command = 'msiexec.exe /i "%s"' % installer_path
if util.RunStr(install_command) != 0:
return False
elif util.IsMac(): elif util.IsMac():
dmg_path = os.path.join(const.PRODUCT_DIR_PATH, 'o3d.dmg') dmg_path = os.path.join(const.PRODUCT_DIR_PATH, 'o3d.dmg')
volumes_path = util.MountDiskImage(dmg_path) mnt = util.MountDiskImage(dmg_path)
if volumes_path is None: if mnt is None:
return False
(device, volumes_path) = mnt
installer_path = os.path.join(volumes_path, 'O3D.mpkg')
if not os.path.exists(installer_path):
logging.error('Installer path not found, %s' % installer_path)
util.UnmountDiskImage(device)
return False
admin_password = 'g00gl3'
install_command = ('echo %s | sudo -S /usr/sbin/installer -pkg '
'"%s" -target /' % (admin_password, installer_path))
ret_code = util.RunStr(install_command)
util.UnmountDiskImage(device)
if ret_code != 0:
return False return False
else:
installer_path = os.path.join(volumes_path, 'O3D.mpkg')
else: else:
plugin_path = os.path.join(const.PRODUCT_DIR_PATH, 'libnpo3dautoplugin.so') plugin_path = os.path.join(const.PRODUCT_DIR_PATH, 'libnpo3dautoplugin.so')
plugin_dst_dir = os.path.expanduser('~/.mozilla/plugins') plugin_dst_dir = os.path.expanduser('~/.mozilla/plugins')
...@@ -107,29 +132,6 @@ def InstallO3DPlugin(): ...@@ -107,29 +132,6 @@ def InstallO3DPlugin():
shutil.copyfile(plugin_path, plugin_dst) shutil.copyfile(plugin_path, plugin_dst)
return True return True
logging.info('Installing plugin:"%s"', installer_path)
if not os.path.exists(installer_path):
logging.error('Installer path not found, %s' % installer_path)
return False
if util.IsWindows():
install_command = 'msiexec.exe /i "%s"' % installer_path
elif util.IsMac():
admin_password = 'g00gl3'
install_command = ('echo %s | sudo -S /usr/sbin/installer -pkg '
'"%s" -target /' % (admin_password, installer_path))
logging.info('Installing...')
result = os.system(install_command)
if result:
logging.error('Install failed.')
return False
logging.info('Installed.')
if util.IsMac():
util.UnmountDiskImage(volumes_path)
return True return True
def UninstallO3DPlugin(): def UninstallO3DPlugin():
......
...@@ -292,7 +292,6 @@ def Download(url, prefix_dir): ...@@ -292,7 +292,6 @@ def Download(url, prefix_dir):
parsed_url = urlparse.urlparse(url) parsed_url = urlparse.urlparse(url)
path = parsed_url[2] path = parsed_url[2]
cut = path.count('/') - 1
name = path.rsplit('/', 1)[1] name = path.rsplit('/', 1)[1]
local_path = os.path.join(prefix_dir, name) local_path = os.path.join(prefix_dir, name)
...@@ -326,7 +325,8 @@ def MountDiskImage(dmg_path): ...@@ -326,7 +325,8 @@ def MountDiskImage(dmg_path):
dmg_path: path to image that will be mounted. dmg_path: path to image that will be mounted.
Returns: Returns:
Path to mounted disk on success or None on failure. Tuple contaiing device path and mounted path on success,
or None on failure.
""" """
mount_path = None mount_path = None
logging.info('Mounting %s...' % dmg_path) logging.info('Mounting %s...' % dmg_path)
...@@ -337,9 +337,11 @@ def MountDiskImage(dmg_path): ...@@ -337,9 +337,11 @@ def MountDiskImage(dmg_path):
if return_code == 0 and output: if return_code == 0 and output:
# Attempt to grab the mounted path from the command output. # Attempt to grab the mounted path from the command output.
# This should be safe regardless of actual output. # This should be safe regardless of actual output.
mount_path = output.strip().split('\n')[-1].split('\t')[-1] new_device = output.strip().split('\n')[-1].split('\t')
device = new_device[0].strip()
mount_path = new_device[-1]
logging.info('Disk image mounted at %s' % mount_path) logging.info('Device %s mounted at %s' % (device,mount_path))
# Wait for mounting operation to complete. # Wait for mounting operation to complete.
time.sleep(10) time.sleep(10)
...@@ -348,32 +350,22 @@ def MountDiskImage(dmg_path): ...@@ -348,32 +350,22 @@ def MountDiskImage(dmg_path):
else: else:
mount_path = None mount_path = None
if mount_path is None: if mount_path is None or device is None:
logging.error('Could not mount properly.') logging.error('Could not mount properly.')
return None
return mount_path return (device, mount_path)
def UnmountDiskImage(mount_path): def UnmountDiskImage(device):
"""Unmounts disk image. """Unmounts disk image.
Args: Args:
mount_path: path to unmount. device: path to device to be detached
Returns: Returns:
True on success. True on success.
""" """
logging.info('Unmounting %s...' % mount_path) logging.info('Unmounting device %s...' % device)
if not os.path.exists(mount_path):
logging.warn('Nothing is mounted at this path.')
return True
Run(['umount', '"' + mount_path + '"'])
time.sleep(10) return Run(['hdiutil detach', '"' + device + '"', '-force']) == 0
if os.path.exists(mount_path):
logging.error('Image is still mounted at path:"%s"', mount_path)
return False
else:
return True
...@@ -96,6 +96,6 @@ small effect-import-test ...@@ -96,6 +96,6 @@ small effect-import-test
# does not currently work with Chrome. # does not currently work with Chrome.
# Don't run TestStressDrawShapes on ie because selenium/ie is too slow. # Don't run TestStressDrawShapes on ie because selenium/ie is too slow.
medium TestStressDrawShapes except(*googlechrome,*iexplore) medium TestStressDrawShapes except(*googlechrome,*iexplore)
medium TestStressMultiWindow except(*googlechrome) medium TestStressMultiWindow except(*googlechrome) run_time(180000)
large TestStressCullingZSort pdiff_threshold(450) screenshots(8) large TestStressCullingZSort pdiff_threshold(450) screenshots(8)
...@@ -91,8 +91,8 @@ medium hellocube screenshot pdiff_threshold(200) ...@@ -91,8 +91,8 @@ medium hellocube screenshot pdiff_threshold(200)
medium hellocube-colors screenshot pdiff_threshold(200) medium hellocube-colors screenshot pdiff_threshold(200)
medium helloworld screenshot pdiff_threshold(200) medium helloworld screenshot pdiff_threshold(200)
medium hud-2d-overlay screenshot pdiff_threshold(200) pdiff_threshold_win(200) medium hud-2d-overlay screenshot pdiff_threshold(200) pdiff_threshold_win(200)
medium instance-override screenshot(2) pdiff_threshold(200) medium instance-override screenshot(2) pdiff_threshold(200) run_time(200000)
medium instancing screenshot pdiff_threshold(200) medium instancing screenshot pdiff_threshold(200) run_time(200000)
medium juggler screenshot downsample(1) medium juggler screenshot downsample(1)
medium julia screenshot medium julia screenshot
small multiple-views screenshot pdiff_threshold(200) small multiple-views screenshot pdiff_threshold(200)
...@@ -127,12 +127,12 @@ large GoogleIO-2009/step14ex screenshot pdiff_threshold(200) timeou ...@@ -127,12 +127,12 @@ large GoogleIO-2009/step14ex screenshot pdiff_threshold(200) timeou
small TestSampleErrorTextureSmall pdiff_threshold(200) screenshots(5) small TestSampleErrorTextureSmall pdiff_threshold(200) screenshots(5)
small TestSampleHelloCube_TexturesSmall pdiff_threshold(450) screenshot small TestSampleHelloCube_TexturesSmall pdiff_threshold(450) screenshot
small TestSampleRefreshPageLoad_Small small TestSampleRefreshPageLoad_Small
medium TestSampleCustomCamera pdiff_threshold(200) pdiff_threshold_win(200) screenshot medium TestSampleCustomCamera pdiff_threshold(200) pdiff_threshold_win(200) screenshot run_time(180000)
medium TestSamplePicking medium TestSamplePicking run_time(60000)
medium TestSampleRenderMode medium TestSampleRenderMode run_time(60000)
medium TestSampleRotateModel pdiff_threshold(200) screenshots(2) medium TestSampleRotateModel pdiff_threshold(200) screenshots(2) run_time(100000)
medium TestSampleShader_Test pdiff_threshold(200) pdiff_threshold_win(200) screenshots(13) medium TestSampleShader_Test pdiff_threshold(200) pdiff_threshold_win(200) screenshots(13)
large TestSampleMultipleClientsLarge large TestSampleMultipleClientsLarge run_time(180000)
large TestSamplePingPongLarge large TestSamplePingPongLarge
# This test currently fails on IE as it considers localhost: to be a trusted # This test currently fails on IE as it considers localhost: to be a trusted
# domain. # domain.
......
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