diff options
author | Yifan J <yfjiang@novell.com> | 2012-02-06 17:39:22 +0800 |
---|---|---|
committer | Yifan J <yfjiang@novell.com> | 2012-02-06 17:39:46 +0800 |
commit | 79b6311d057d3362cb9ff8f5ac75f7eefd35364b (patch) | |
tree | 30e816e209fe32bcfbb983dced8276b3989c1c11 /smoketest | |
parent | 75378a82e1a9e921cebe221427baca24cad47baf (diff) |
bug fixing for test initializing
Diffstat (limited to 'smoketest')
-rwxr-xr-x | smoketest/losmoketest.py | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/smoketest/losmoketest.py b/smoketest/losmoketest.py index 4c8699763fb3..dfb86ec20eb6 100755 --- a/smoketest/losmoketest.py +++ b/smoketest/losmoketest.py @@ -74,7 +74,7 @@ SERVER_URL = "http://dev-builds.libreoffice.org" root_dir = os.getcwd() DOWNLOAD_DIR = os.path.join(root_dir, "_download") USR_DIR = os.path.join(root_dir, "_libo_smoke_user") -LOCAL_BUILD_INFO_FILE = "build.cfg" +LOCAL_BUILD_INFO_FILE = os.path.join(root_dir, "build.cfg") ROOT_DIR_LIB = os.path.join(root_dir, 'lib') ROOT_DIR_LIB32 = os.path.join(root_dir, 'lib32') @@ -324,7 +324,6 @@ def download(url_reg, build_type): return True - def fetch_build(url, filename): ''' Download a build from address url/filename ''' @@ -335,8 +334,11 @@ def fetch_build(url, filename): try: f = open(DOWNLOAD_DIR + '/' + filename, 'wb') f.write(u.read()) - finally: f.close() + except urllib2.HTTPError, e: + print "HTTP Error:",e.code , url + except urllib2.URLError, e: + print "URL Error:",e.reason , url return True @@ -404,6 +406,24 @@ def init_testing(): if not os.path.exists(USR_DIR): os.mkdir(USR_DIR) + + + if not os.path.exists(LOCAL_BUILD_INFO_FILE): + + init_build_cfg = '[daily_branch]' + os.linesep\ + + 'build_name =' + os.linesep\ + + 'build_time =' + os.linesep\ + + '[daily_master]' + os.linesep\ + + 'build_name =' + os.linesep\ + + 'build_time =' + os.linesep\ + + '[pre-releases]' + os.linesep\ + + 'build_name =' + os.linesep\ + + 'build_time =' + os.linesep + + with open(LOCAL_BUILD_INFO_FILE, 'w+') as f: + f.write(init_build_cfg) + f.close() + # create set up links try: if platform.system() == "Linux": @@ -588,6 +608,7 @@ def main(): uninstall() sys.exit() elif o in ("-d", "--download"): + init_testing() download(url_reg, build_type) sys.exit() elif o in ("-l", "--loop"): |