diff options
author | kkania@google.com <kkania@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-26 19:55:19 +0000 |
---|---|---|
committer | kkania@google.com <kkania@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-26 19:55:19 +0000 |
commit | 8dd8ea73b9fc2571777d841a85f0b27f82530455 (patch) | |
tree | 2856fe91134fd88f355fb398684740a1df182ab2 /o3d | |
parent | 7cc7e1ddcdd2bede9505ff07e541136b2e2cd9a3 (diff) | |
download | chromium_src-8dd8ea73b9fc2571777d841a85f0b27f82530455.zip chromium_src-8dd8ea73b9fc2571777d841a85f0b27f82530455.tar.gz chromium_src-8dd8ea73b9fc2571777d841a85f0b27f82530455.tar.bz2 |
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
Diffstat (limited to 'o3d')
-rw-r--r-- | o3d/tests/lab/runner_util.py | 58 | ||||
-rw-r--r-- | o3d/tests/lab/util.py | 34 | ||||
-rw-r--r-- | o3d/tests/selenium/javascript_unit_test_list.txt | 2 | ||||
-rw-r--r-- | o3d/tests/selenium/sample_list.txt | 14 |
4 files changed, 51 insertions, 57 deletions
diff --git a/o3d/tests/lab/runner_util.py b/o3d/tests/lab/runner_util.py index f6e62c1..46bd32e 100644 --- a/o3d/tests/lab/runner_util.py +++ b/o3d/tests/lab/runner_util.py @@ -38,7 +38,6 @@ import os import subprocess import shutil import sys -import time import runner_constants as const import util @@ -86,15 +85,41 @@ def AddPythonPath(path): def InstallO3DPlugin(): """Installs O3D plugin.""" + logging.info('Installing plugin...') if util.IsWindows(): 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(): dmg_path = os.path.join(const.PRODUCT_DIR_PATH, 'o3d.dmg') - volumes_path = util.MountDiskImage(dmg_path) - if volumes_path is None: + mnt = util.MountDiskImage(dmg_path) + 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 - else: - installer_path = os.path.join(volumes_path, 'O3D.mpkg') + else: plugin_path = os.path.join(const.PRODUCT_DIR_PATH, 'libnpo3dautoplugin.so') plugin_dst_dir = os.path.expanduser('~/.mozilla/plugins') @@ -107,29 +132,6 @@ def InstallO3DPlugin(): shutil.copyfile(plugin_path, plugin_dst) 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 def UninstallO3DPlugin(): diff --git a/o3d/tests/lab/util.py b/o3d/tests/lab/util.py index 03a989f..0a7bc8d 100644 --- a/o3d/tests/lab/util.py +++ b/o3d/tests/lab/util.py @@ -292,7 +292,6 @@ def Download(url, prefix_dir): parsed_url = urlparse.urlparse(url) path = parsed_url[2] - cut = path.count('/') - 1 name = path.rsplit('/', 1)[1] local_path = os.path.join(prefix_dir, name) @@ -326,7 +325,8 @@ def MountDiskImage(dmg_path): dmg_path: path to image that will be mounted. 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 logging.info('Mounting %s...' % dmg_path) @@ -337,9 +337,11 @@ def MountDiskImage(dmg_path): if return_code == 0 and output: # Attempt to grab the mounted path from the command 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. time.sleep(10) @@ -348,32 +350,22 @@ def MountDiskImage(dmg_path): else: mount_path = None - if mount_path is None: + if mount_path is None or device is None: 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. Args: - mount_path: path to unmount. + device: path to device to be detached Returns: True on success. """ - logging.info('Unmounting %s...' % mount_path) - - if not os.path.exists(mount_path): - logging.warn('Nothing is mounted at this path.') - return True - - Run(['umount', '"' + mount_path + '"']) + logging.info('Unmounting device %s...' % device) - time.sleep(10) - if os.path.exists(mount_path): - logging.error('Image is still mounted at path:"%s"', mount_path) - return False - else: - return True + return Run(['hdiutil detach', '"' + device + '"', '-force']) == 0 diff --git a/o3d/tests/selenium/javascript_unit_test_list.txt b/o3d/tests/selenium/javascript_unit_test_list.txt index ec11f4e..a133157 100644 --- a/o3d/tests/selenium/javascript_unit_test_list.txt +++ b/o3d/tests/selenium/javascript_unit_test_list.txt @@ -96,6 +96,6 @@ small effect-import-test # does not currently work with Chrome. # Don't run TestStressDrawShapes on ie because selenium/ie is too slow. medium TestStressDrawShapes except(*googlechrome,*iexplore) -medium TestStressMultiWindow except(*googlechrome) +medium TestStressMultiWindow except(*googlechrome) run_time(180000) large TestStressCullingZSort pdiff_threshold(450) screenshots(8) diff --git a/o3d/tests/selenium/sample_list.txt b/o3d/tests/selenium/sample_list.txt index ea7b05e..9073445 100644 --- a/o3d/tests/selenium/sample_list.txt +++ b/o3d/tests/selenium/sample_list.txt @@ -91,8 +91,8 @@ medium hellocube screenshot pdiff_threshold(200) medium hellocube-colors screenshot pdiff_threshold(200) medium helloworld screenshot pdiff_threshold(200) medium hud-2d-overlay screenshot pdiff_threshold(200) pdiff_threshold_win(200) -medium instance-override screenshot(2) pdiff_threshold(200) -medium instancing screenshot pdiff_threshold(200) +medium instance-override screenshot(2) pdiff_threshold(200) run_time(200000) +medium instancing screenshot pdiff_threshold(200) run_time(200000) medium juggler screenshot downsample(1) medium julia screenshot small multiple-views screenshot pdiff_threshold(200) @@ -127,12 +127,12 @@ large GoogleIO-2009/step14ex screenshot pdiff_threshold(200) timeou small TestSampleErrorTextureSmall pdiff_threshold(200) screenshots(5) small TestSampleHelloCube_TexturesSmall pdiff_threshold(450) screenshot small TestSampleRefreshPageLoad_Small -medium TestSampleCustomCamera pdiff_threshold(200) pdiff_threshold_win(200) screenshot -medium TestSamplePicking -medium TestSampleRenderMode -medium TestSampleRotateModel pdiff_threshold(200) screenshots(2) +medium TestSampleCustomCamera pdiff_threshold(200) pdiff_threshold_win(200) screenshot run_time(180000) +medium TestSamplePicking run_time(60000) +medium TestSampleRenderMode run_time(60000) +medium TestSampleRotateModel pdiff_threshold(200) screenshots(2) run_time(100000) medium TestSampleShader_Test pdiff_threshold(200) pdiff_threshold_win(200) screenshots(13) -large TestSampleMultipleClientsLarge +large TestSampleMultipleClientsLarge run_time(180000) large TestSamplePingPongLarge # This test currently fails on IE as it considers localhost: to be a trusted # domain. |