Index: tests/lab/runner_util.py |
=================================================================== |
--- tests/lab/runner_util.py (revision 29792) |
+++ tests/lab/runner_util.py (working copy) |
@@ -38,7 +38,6 @@ |
import subprocess |
import shutil |
import sys |
-import time |
import runner_constants as const |
import util |
@@ -86,15 +85,41 @@ |
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 |
- else: |
- installer_path = os.path.join(volumes_path, 'O3D.mpkg') |
+ (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: |
plugin_path = os.path.join(const.PRODUCT_DIR_PATH, 'libnpo3dautoplugin.so') |
plugin_dst_dir = os.path.expanduser('~/.mozilla/plugins') |
@@ -107,29 +132,6 @@ |
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(): |