summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-11-03 11:19:54 -0500
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-11-03 17:21:20 +0100
commit4c29a00b1877479af42c17e17041189b8852426b (patch)
tree35cf41f64b74e5302ac1ebdc76c061b748f33af9
parent406588edb62589ef549f84e268b3268eb337c02a (diff)
fix errors in new version of the script
-rwxr-xr-xtest-bugzilla-files/execute.sh7
-rw-r--r--test-bugzilla-files/new-control.py14
-rw-r--r--test-bugzilla-files/test-bugzilla-files.py8
3 files changed, 17 insertions, 12 deletions
diff --git a/test-bugzilla-files/execute.sh b/test-bugzilla-files/execute.sh
index e2c6076..46c1bd9 100755
--- a/test-bugzilla-files/execute.sh
+++ b/test-bugzilla-files/execute.sh
@@ -1,4 +1,5 @@
-mkdir /srv/crashtestdata/control/$1
-cd /srv/crashtestdata/control/$1
-TMPDIR=/srv/crashtestdata/tmpdir /home/buildslave/build/instdir/program/python /home/buildslave/source/dev-tools/test-bugzilla-files/test-bugzilla-files.py --soffice=path:/home/buildslave/build/instdir/program/soffice --userdir=file:///home/buildslave/.config/libreoffice_$1/4 $1 2>&1 | tee /srv/crashtestdata/console_$i.log
+dir_name=$(basename $1)
+mkdir /srv/crashtestdata/control/$dir_name
+cd /srv/crashtestdata/control/$dir_name
+TMPDIR=/srv/crashtestdata/tmpdir /home/buildslave/build/instdir/program/python /home/buildslave/source/dev-tools/test-bugzilla-files/test-bugzilla-files.py --soffice=path:/home/buildslave/build/instdir/program/soffice --userdir=file:///home/buildslave/.config/libreoffice_$dir_name/4 $1 2>&1 | tee /srv/crashtestdata/console_$dir_name.log
rm core*
diff --git a/test-bugzilla-files/new-control.py b/test-bugzilla-files/new-control.py
index c27cb5f..c278a2a 100644
--- a/test-bugzilla-files/new-control.py
+++ b/test-bugzilla-files/new-control.py
@@ -39,12 +39,13 @@ def get_tasks(directory, files_per_task):
task_file = open(filename, "w")
for item in list_item:
task_file.write("%s\n" % item)
- task_files.append(filename)
+ task_files.append(os.path.join(os.getcwd(),filename))
i += 1
+ print("number of tasks: " + str(len(task_files)))
return task_files
def execute_task(task_file):
- # subprocess.call("./execute.sh " + task_file, shell=True)
+ subprocess.call("./execute.sh " + task_file, shell=True)
time.sleep(1)
def usage():
@@ -62,12 +63,15 @@ if __name__ == "__main__":
usage()
sys.exit()
- for opt, arg in opts:
- if opt in ("-d", "--directory"):
- directory = arg
+ if len(args) == 0:
+ usage()
+ sys.exit(1)
+
+ directory = args[0]
print(directory)
if not os.path.isdir(directory):
+ print("no valid directory")
sys.exit(1)
task_size = 100
diff --git a/test-bugzilla-files/test-bugzilla-files.py b/test-bugzilla-files/test-bugzilla-files.py
index e43e847..e4a5f36 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -72,7 +72,7 @@ def partition(list, pred):
def getFiles(file_list_name):
file_list = open(file_list_name, "r")
files = file_list.readlines()
- return files
+ return [file.rstrip() for file in files]
### UNO utilities ###
@@ -235,7 +235,7 @@ def mkPropertyValue(name, value):
name, 0, value, 0)
de
-def getComponent(xDoc)
+def getComponent(xDoc):
if not xDoc:
return "None"
@@ -393,7 +393,7 @@ def exportDoc(xDoc, filterName, validationCommand, filename, connection):
class ExportFileTest:
- def __init__(self, xDoc, component, filename):
+ def __init__(self, xDoc, filename):
self.xDoc = xDoc
self.filename = filename
def run(self, connection):
@@ -576,7 +576,7 @@ def runLoadFileTests(opts, file_list_name):
state = State()
# print("before map")
files = []
- files.extend(getFiles(file_list_name))
+ files.extend(getFiles(file_list_name[0]))
files.sort()
tests.extend( (LoadFileTest(file, state) for file in files) )
runConnectionTests(connection, simpleInvoke, tests)