summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDon Bright <hugh.m.bright@gmail.com>2013-02-20 01:43:25 (GMT)
committerDon Bright <hugh.m.bright@gmail.com>2013-02-20 01:43:25 (GMT)
commitc304adabe26887dc35599a44384ab5ada24a88ca (patch)
tree51b1f65f58e6da5d30436209fd851dff2a16d896 /tests
parent85d3f3c7c9b165da519d9b4377a1fbd3281f6b14 (diff)
update documentation. tweak scripts
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_pretty_print.py5
-rwxr-xr-xtests/test_upload.py39
2 files changed, 27 insertions, 17 deletions
diff --git a/tests/test_pretty_print.py b/tests/test_pretty_print.py
index 8458fdb..a4b5e70 100755
--- a/tests/test_pretty_print.py
+++ b/tests/test_pretty_print.py
@@ -86,8 +86,8 @@ def read_sysinfo(filename):
if not data:
sinfo = platform.sys.platform
sinfo += '\nsystem cannot create offscreen GL framebuffer object'
- sinfo += '\nsystem cannot create images'
- sysid = platform.sys.platform+'_no_images'
+ sinfo += '\nsystem cannot create GL based images'
+ sysid = platform.sys.platform+'_no_GL_renderer'
return sinfo, sysid
machine = ezsearch('Machine:(.*?)\n',data)
@@ -118,6 +118,7 @@ def read_sysinfo(filename):
for c in hexhash: hash += chr(ord(c)+97-48)
sysid = osplain + '_' + machine + '_' + renderer + '_' + hash
+ sysid = sysid.replace('(','_').replace(')','_')
sysid = sysid.lower()
return data, sysid
diff --git a/tests/test_upload.py b/tests/test_upload.py
index 817d971..39cd237 100755
--- a/tests/test_upload.py
+++ b/tests/test_upload.py
@@ -21,8 +21,9 @@
#
# This license is based on zlib license by Jean-loup Gailly and Mark Adler
+
# This script takes html output by test_pretty_print.py and uploads
-# it to a web server.
+# it to a web server over ssh using sftp.
#
# Simple example: (see help() for more info)
#
@@ -30,7 +31,7 @@
#
#
-# design
+# Design
#
# On the remote web server there is a directory called 'openscad_tests'
# Inside of it is a file, 'index.html', that lists all the test reports
@@ -59,14 +60,17 @@
# This script returns '1' on failure, '0' on success (shell-style)
#
-import sys,os,platform,string
+# todo: support plain old ftp ??
+# todo: support new-fangled sites like dropbox ??
+
+import sys,os,platform,string,getpass
try:
import paramiko
except:
x='''
-please install the paramiko python library in your
-PYTHONPATH If that is not feasible, you can upload the main html report
+please install the paramiko python library in your PYTHONPATH
+If that is not feasible, you can upload the single html report
file by hand to any site that accepts html code.
'''
@@ -88,18 +92,17 @@ usage:
example1:
- $ ctest # result is linux_x86_nvidia_report.html
- $ test_upload.py --username=andreis --host=web.sourceforge.net \
- --remotepath=/home/project-web/projectxyz/htdocs/
+ $ ctest # result is Testing/Temporary/linux_x86_nvidia_report.html
+ $ test_upload.py --username=andreis --host=web.sourceforge.net --remotepath=/home/project-web/projectxyz/htdocs/
$ firefox http://projectxyz.sourceforge.net/openscad_tests/index.html
# should display the test results
example2:
- $ ctest # result in freebsd_ppc_gallium_report.html
- $ test_upload.py --username=agorenko --host=fontanka.org --remotepath=/tmp/
- $ ssh agorenko@fontanka.org "ls /tmp"
- # result is 'index.html' 'freebsd_ppc_gallium_report.html'
+ $ ctest # result is Testing/Temporary/freebsd_ppc_gallium_report.html
+ $ test_upload.py --username=annag --host=fontanka.org --remotepath=/tmp/
+ $ ssh annag@fontanka.org "ls /tmp"
+ # result is 'index.html' 'freebsd_ppc_gallium_report.html' in /tmp
'''
print text
@@ -157,15 +160,21 @@ def paramiko_upload( newrept_fname, username, host, remotepath ):
try:
client.connect(host,username=username)
except paramiko.PasswordRequiredException, e:
- passw = getpass.getpass('enter passphrase for private key: ')
+ passw = getpass.getpass('enter passphrase for private ssh key: ')
client.connect(host,username=username,password=passw)
#stdin,stdout,stderr=client.exec_command('ls -l')
- debug("find remote path " + basepath + " (or create) ")
+ debug("find remote path: " + remotepath)
ftp = client.open_sftp()
+ try:
+ ftp.chdir( remotepath )
+ except:
+ debug("failed to change dir to remote path: "+remotepath)
+ return 1
+ debug("find basepath ( or create ):" + basepath )
if not basepath in ftp.listdir():
ftp.mkdir( basepath )
ftp.chdir( basepath )
@@ -205,7 +214,7 @@ def paramiko_upload( newrept_fname, username, host, remotepath ):
if newrept_basefname in text:
debug( newrept_basefname + " already linked from index.html")
else:
- debug("add new reprt link to index.html")
+ debug("add new report link to index.html")
text = text.replace( blankchunk, blankchunk+'\n'+text2 )
f = ftp.file( 'index.html', 'w+' )
contact: Jan Huwald // Impressum