annotate GenerateConfigurationForTests.py @ 487:18f2d55182fd

more dicom-web tests
author Alain Mazy <am@osimis.io>
date Wed, 29 Jun 2022 11:23:33 +0200
parents 5ac463ebf463
children 933fe1bbce4f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 #!/usr/bin/python
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 # Orthanc - A Lightweight, RESTful DICOM Store
73
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 35
diff changeset
4 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
3
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 # Department, University Hospital of Liege, Belgium
449
06eea14c5906 upgrade year to 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
6 # Copyright (C) 2017-2022 Osimis S.A., Belgium
06eea14c5906 upgrade year to 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 437
diff changeset
7 # Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
3
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 #
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 # This program is free software: you can redistribute it and/or
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 # modify it under the terms of the GNU General Public License as
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 # published by the Free Software Foundation, either version 3 of the
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 # License, or (at your option) any later version.
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 #
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 # This program is distributed in the hope that it will be useful, but
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 # General Public License for more details.
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 #
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 # You should have received a copy of the GNU General Public License
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 import argparse
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 import os
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 import re
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 import socket
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 import subprocess
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 import sys
87
4b24faec842b test_reconstruct_json2 + test_private_tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 82
diff changeset
29 import json
101
71bca28a4645 remove the dependency upon installing Orthanc to generate the default configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 100
diff changeset
30 import urllib
71bca28a4645 remove the dependency upon installing Orthanc to generate the default configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 100
diff changeset
31
3
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 ##
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 ## Parse the command-line arguments
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 ##
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 parser = argparse.ArgumentParser(description = 'Generate the configuration file for the ' +
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 'instance of Orthanc to be checked against the integration tests.')
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 parser.add_argument('--target',
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 default = 'IntegrationTestsConfiguration.json',
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 help = 'Configuration file to generate')
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 parser.add_argument('--force',
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 help = 'Overwrite the file even if it already exists',
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 action = 'store_true')
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47
380
b9adc7d06347 update tests following removal of dicom-as-json attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 363
diff changeset
48 parser.add_argument('--compression',
b9adc7d06347 update tests following removal of dicom-as-json attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 363
diff changeset
49 help = 'Enable storage compression',
b9adc7d06347 update tests following removal of dicom-as-json attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 363
diff changeset
50 action = 'store_true')
b9adc7d06347 update tests following removal of dicom-as-json attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 363
diff changeset
51
31
e07deb07289d path to plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 22
diff changeset
52 parser.add_argument('--plugins',
e07deb07289d path to plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 22
diff changeset
53 help = 'Add a path to a folder containing plugins')
e07deb07289d path to plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 22
diff changeset
54
82
91e2ed032f96 fix test
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 73
diff changeset
55 parser.add_argument('--dicom',
91e2ed032f96 fix test
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 73
diff changeset
56 type = int,
91e2ed032f96 fix test
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 73
diff changeset
57 default = 4242,
91e2ed032f96 fix test
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 73
diff changeset
58 help = 'DICOM port of the Orthanc server')
91e2ed032f96 fix test
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 73
diff changeset
59
3
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 args = parser.parse_args()
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 ##
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 ## Check whether the file can be overwritten
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 ##
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 if os.path.exists(args.target) and not args.force:
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 print("""
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 WARNING: The file %s will be overwritten!
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 Are you sure ["yes" to go on]?""" % args.target)
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 if sys.stdin.readline().strip() != 'yes':
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 print('Aborting...')
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 exit(0)
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 ##
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 ## Generate the configuration file
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 ##
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 # Retrieve the IP address of the localhost
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 ip = socket.gethostbyname(socket.gethostname())
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85
101
71bca28a4645 remove the dependency upon installing Orthanc to generate the default configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 100
diff changeset
86
71bca28a4645 remove the dependency upon installing Orthanc to generate the default configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 100
diff changeset
87 # Download the content of the default configuration file
71bca28a4645 remove the dependency upon installing Orthanc to generate the default configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 100
diff changeset
88 with open(args.target, 'w') as f:
319
de6e73e4df60 leaving bitbucket
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 286
diff changeset
89 url = 'https://hg.orthanc-server.com/orthanc/raw-file/default/OrthancServer/Resources/Configuration.json'
de6e73e4df60 leaving bitbucket
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 286
diff changeset
90 #url = 'https://hg.orthanc-server.com/orthanc/raw-file/default/Resources/Configuration.json'
286
b55a7cb5ee02 change url to get configuration.json
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 270
diff changeset
91 #url = 'https://bitbucket.org/sjodogne/orthanc/raw/default/Resources/Configuration.json'
101
71bca28a4645 remove the dependency upon installing Orthanc to generate the default configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 100
diff changeset
92 http = urllib.urlopen(url)
71bca28a4645 remove the dependency upon installing Orthanc to generate the default configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 100
diff changeset
93 if http.getcode() != 200:
71bca28a4645 remove the dependency upon installing Orthanc to generate the default configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 100
diff changeset
94 raise Exception('Cannot download: %s' % url)
71bca28a4645 remove the dependency upon installing Orthanc to generate the default configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 100
diff changeset
95
71bca28a4645 remove the dependency upon installing Orthanc to generate the default configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 100
diff changeset
96 f.write(http.read())
71bca28a4645 remove the dependency upon installing Orthanc to generate the default configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 100
diff changeset
97
3
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 with open(args.target, 'r') as f:
87
4b24faec842b test_reconstruct_json2 + test_private_tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 82
diff changeset
100 # Remove the C++-style comments
4b24faec842b test_reconstruct_json2 + test_private_tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 82
diff changeset
101 nocomment = re.sub('//.*$', '', f.read(), 0, re.MULTILINE)
4b24faec842b test_reconstruct_json2 + test_private_tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 82
diff changeset
102
4b24faec842b test_reconstruct_json2 + test_private_tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 82
diff changeset
103 # Remove the C-style comments
4b24faec842b test_reconstruct_json2 + test_private_tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 82
diff changeset
104 nocomment = re.sub('/\*.*?\*/', '', nocomment, 0, re.DOTALL | re.MULTILINE)
4b24faec842b test_reconstruct_json2 + test_private_tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 82
diff changeset
105
4b24faec842b test_reconstruct_json2 + test_private_tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 82
diff changeset
106 config = json.loads(nocomment)
3
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107
224
f5414254ccaa test_bitbucket_issue_113
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 212
diff changeset
108 config['DefaultEncoding'] = 'Utf8'
95
a807a4699eb4 testing of metadata SopClassUid
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 92
diff changeset
109 config['AllowFindSopClassesInStudy'] = False
87
4b24faec842b test_reconstruct_json2 + test_private_tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 82
diff changeset
110 config['AuthenticationEnabled'] = True
4b24faec842b test_reconstruct_json2 + test_private_tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 82
diff changeset
111 config['DicomAet'] = 'ORTHANC'
4b24faec842b test_reconstruct_json2 + test_private_tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 82
diff changeset
112 config['DicomAssociationCloseDelay'] = 0
188
7d585263808b new test: test_queries_hierarchy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 187
diff changeset
113 config['DicomModalities'] = {
7d585263808b new test: test_queries_hierarchy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 187
diff changeset
114 'orthanctest' : [ 'ORTHANCTEST', ip, 5001 ],
7d585263808b new test: test_queries_hierarchy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 187
diff changeset
115 'self' : [ 'ORTHANC', '127.0.0.1', 4242 ]
7d585263808b new test: test_queries_hierarchy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 187
diff changeset
116 }
87
4b24faec842b test_reconstruct_json2 + test_private_tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 82
diff changeset
117 config['DicomPort'] = args.dicom
4b24faec842b test_reconstruct_json2 + test_private_tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 82
diff changeset
118 config['HttpCompressionEnabled'] = False
139
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 130
diff changeset
119 config['LogExportedResources'] = True
232
f2af7bdc9bf8 tests for transfers accelerator
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 224
diff changeset
120 config['OrthancPeers'] = {
f2af7bdc9bf8 tests for transfers accelerator
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 224
diff changeset
121 'peer' : [ 'http://%s:%d/' % (ip, 5000), 'alice', 'orthanctest' ],
f2af7bdc9bf8 tests for transfers accelerator
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 224
diff changeset
122 'transfers-bidirectional' : {
f2af7bdc9bf8 tests for transfers accelerator
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 224
diff changeset
123 'Url' : 'http://localhost:8042/',
f2af7bdc9bf8 tests for transfers accelerator
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 224
diff changeset
124 'RemoteSelf' : 'transfers-bidirectional',
f2af7bdc9bf8 tests for transfers accelerator
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 224
diff changeset
125 'Username' : 'alice',
f2af7bdc9bf8 tests for transfers accelerator
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 224
diff changeset
126 'Password' : 'orthanctest'
f2af7bdc9bf8 tests for transfers accelerator
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 224
diff changeset
127 },
f2af7bdc9bf8 tests for transfers accelerator
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 224
diff changeset
128 'transfers-simple' : {
f2af7bdc9bf8 tests for transfers accelerator
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 224
diff changeset
129 'Url' : 'http://localhost:8042/',
f2af7bdc9bf8 tests for transfers accelerator
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 224
diff changeset
130 'Username' : 'alice',
f2af7bdc9bf8 tests for transfers accelerator
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 224
diff changeset
131 'Password' : 'orthanctest'
328
8a462f9c5a97 test_store_compressed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 319
diff changeset
132 },
8a462f9c5a97 test_store_compressed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 319
diff changeset
133 'self' : {
329
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 328
diff changeset
134 'Url' : 'http://127.0.0.1:8042/',
328
8a462f9c5a97 test_store_compressed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 319
diff changeset
135 'Username' : 'alice',
8a462f9c5a97 test_store_compressed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 319
diff changeset
136 'Password' : 'orthanctest'
232
f2af7bdc9bf8 tests for transfers accelerator
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 224
diff changeset
137 }
f2af7bdc9bf8 tests for transfers accelerator
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 224
diff changeset
138 }
87
4b24faec842b test_reconstruct_json2 + test_private_tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 82
diff changeset
139 config['RegisteredUsers'] = { 'alice' : 'orthanctest' }
4b24faec842b test_reconstruct_json2 + test_private_tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 82
diff changeset
140 config['RemoteAccessAllowed'] = True
173
ed3db6386587 testing overwrite
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 153
diff changeset
141 config['OverwriteInstances'] = True
180
fcb0c14dadb8 increasing JobsHistorySize
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 173
diff changeset
142 config['JobsHistorySize'] = 1000
185
d4a5e4143d68 fixing value of SynchronousCMove
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 180
diff changeset
143 config['SynchronousCMove'] = False
187
770f6f5aea16 test_async_archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 185
diff changeset
144 config['MediaArchiveSize'] = 1
212
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 205
diff changeset
145 config['SaveJobs'] = False
257
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 235
diff changeset
146 config['ExecuteLuaEnabled'] = True
263
a2719263fd04 test_study_series_find_inconsistency
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 260
diff changeset
147 config['HttpTimeout'] = 2
335
96718de2f29c simplification and fix of test_incoming_findscu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 329
diff changeset
148 config['SyncStorageArea'] = False # For tests to run more quickly
337
ec13ace43bde trying webdav tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 335
diff changeset
149 config['WebDavEnabled'] = True
ec13ace43bde trying webdav tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 335
diff changeset
150 config['WebDavDeleteAllowed'] = True
ec13ace43bde trying webdav tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 335
diff changeset
151 config['WebDavUploadAllowed'] = True
380
b9adc7d06347 update tests following removal of dicom-as-json attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 363
diff changeset
152 config['StorageCompression'] = args.compression
391
227d9a932467 testing revisions in metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
153 config['CheckRevisions'] = True
480
5ac463ebf463 added a test for lua SetHttpTimeout
Alain Mazy <am@osimis.io>
parents: 449
diff changeset
154 config['HttpsCACertificates'] = "/etc/ssl/certs/ca-certificates.crt" # for HTTPS lua tests (note: this path is valid only on linux !)
337
ec13ace43bde trying webdav tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 335
diff changeset
155
409
19154b57d0ae backward compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 395
diff changeset
156 del config['DeidentifyLogsDicomVersion']
205
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
157 del config['KeepAlive']
88
47a3d6c08413 easier dicomweb setup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 87
diff changeset
158
87
4b24faec842b test_reconstruct_json2 + test_private_tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 82
diff changeset
159 config['Dictionary'] = {
90
afbac3eb28a5 integration tests of worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 88
diff changeset
160 '00e1,10c2' : [ 'UI', 'PET-CT Multi Modality Name', 1, 1, 'ELSCINT1' ],
235
9929e4af2b7a test_bitbucket_issue_140
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 232
diff changeset
161 '7053,1003' : [ 'ST', 'Original Image Filename', 1, 1, 'Philips PET Private Group' ],
270
082f35cb4459 test_bitbuck_issue_168
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 263
diff changeset
162 '4321,1012' : [ 'LO', 'RadioButton3', 1, 1, 'RadioLogic' ], # For issue 140
082f35cb4459 test_bitbuck_issue_168
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 263
diff changeset
163 '0009,1001' : [ 'DS', 'Abnormality score', 1, 1, 'Lunit' ], # For issue 168
082f35cb4459 test_bitbuck_issue_168
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 263
diff changeset
164 '0009,0010' : [ 'LO', 'Private data element', 1, 1, 'Lunit' ], # For issue 168
87
4b24faec842b test_reconstruct_json2 + test_private_tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 82
diff changeset
165 }
3
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166
270
082f35cb4459 test_bitbuck_issue_168
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 263
diff changeset
167 config['DefaultPrivateCreator'] = 'Lunit' # For issue 168
082f35cb4459 test_bitbuck_issue_168
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 263
diff changeset
168
88
47a3d6c08413 easier dicomweb setup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 87
diff changeset
169 config['DicomWeb'] = {
90
afbac3eb28a5 integration tests of worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 88
diff changeset
170 'Servers' : {
afbac3eb28a5 integration tests of worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 88
diff changeset
171 'sample' : [
afbac3eb28a5 integration tests of worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 88
diff changeset
172 'http://localhost:8042/dicom-web/',
afbac3eb28a5 integration tests of worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 88
diff changeset
173 'alice',
afbac3eb28a5 integration tests of worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 88
diff changeset
174 'orthanctest'
88
47a3d6c08413 easier dicomweb setup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 87
diff changeset
175 ]
47a3d6c08413 easier dicomweb setup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 87
diff changeset
176 }
47a3d6c08413 easier dicomweb setup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 87
diff changeset
177 }
47a3d6c08413 easier dicomweb setup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 87
diff changeset
178
90
afbac3eb28a5 integration tests of worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 88
diff changeset
179 config['Worklists'] = {
afbac3eb28a5 integration tests of worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 88
diff changeset
180 'Enable': True,
afbac3eb28a5 integration tests of worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 88
diff changeset
181 'Database': os.path.abspath(os.path.join(os.path.dirname(__file__), './Database/Worklists/Working')),
afbac3eb28a5 integration tests of worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 88
diff changeset
182 }
afbac3eb28a5 integration tests of worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 88
diff changeset
183
99
37430f7430e3 config to test the PostgreSQL plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 95
diff changeset
184 config['PostgreSQL'] = {
37430f7430e3 config to test the PostgreSQL plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 95
diff changeset
185 'EnableIndex' : True,
37430f7430e3 config to test the PostgreSQL plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 95
diff changeset
186 'EnableStorage' : True,
37430f7430e3 config to test the PostgreSQL plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 95
diff changeset
187 'Host' : 'localhost',
37430f7430e3 config to test the PostgreSQL plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 95
diff changeset
188 'Port' : 5432,
37430f7430e3 config to test the PostgreSQL plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 95
diff changeset
189 'Database' : 'orthanctest',
37430f7430e3 config to test the PostgreSQL plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 95
diff changeset
190 'Username' : 'postgres',
395
3c15eadd941a added explicit db parameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 391
diff changeset
191 'Password' : 'postgres',
3c15eadd941a added explicit db parameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 391
diff changeset
192 'Lock' : False,
3c15eadd941a added explicit db parameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 391
diff changeset
193 'IndexConnectionsCount' : 5,
3c15eadd941a added explicit db parameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 391
diff changeset
194 'MaximumConnectionRetries' : 7,
99
37430f7430e3 config to test the PostgreSQL plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 95
diff changeset
195 }
37430f7430e3 config to test the PostgreSQL plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 95
diff changeset
196
140
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 139
diff changeset
197 config['MySQL'] = {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 139
diff changeset
198 'EnableIndex' : True,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 139
diff changeset
199 'EnableStorage' : True,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 139
diff changeset
200 'Host' : 'localhost',
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 139
diff changeset
201 'Port' : 3306,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 139
diff changeset
202 'Database' : 'orthanctest',
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 139
diff changeset
203 'Username' : 'root',
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 139
diff changeset
204 'Password' : 'root',
153
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 140
diff changeset
205 'UnixSocket' : '',
395
3c15eadd941a added explicit db parameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 391
diff changeset
206 'Lock' : False,
3c15eadd941a added explicit db parameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 391
diff changeset
207 'IndexConnectionsCount' : 5,
3c15eadd941a added explicit db parameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 391
diff changeset
208 'MaximumConnectionRetries' : 7,
140
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 139
diff changeset
209 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 139
diff changeset
210
430
9430b5728ca0 added ODBC in GenerateConfigurationForTests.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 409
diff changeset
211 config['Odbc'] = {
9430b5728ca0 added ODBC in GenerateConfigurationForTests.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 409
diff changeset
212 'EnableIndex' : True,
9430b5728ca0 added ODBC in GenerateConfigurationForTests.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 409
diff changeset
213 'EnableStorage' : True,
9430b5728ca0 added ODBC in GenerateConfigurationForTests.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 409
diff changeset
214 'IndexConnectionString' : 'DSN=test',
9430b5728ca0 added ODBC in GenerateConfigurationForTests.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 409
diff changeset
215 'StorageConnectionString' : 'DSN=storage',
9430b5728ca0 added ODBC in GenerateConfigurationForTests.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 409
diff changeset
216 'IndexConnectionsCount' : 1,
9430b5728ca0 added ODBC in GenerateConfigurationForTests.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 409
diff changeset
217 'MaximumConnectionRetries' : 7,
9430b5728ca0 added ODBC in GenerateConfigurationForTests.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 409
diff changeset
218 }
9430b5728ca0 added ODBC in GenerateConfigurationForTests.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 409
diff changeset
219
90
afbac3eb28a5 integration tests of worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 88
diff changeset
220
88
47a3d6c08413 easier dicomweb setup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 87
diff changeset
221
13
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 11
diff changeset
222 # Enable case-insensitive PN (the default on versions <= 0.8.6)
87
4b24faec842b test_reconstruct_json2 + test_private_tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 82
diff changeset
223 config['CaseSensitivePN'] = False
82
91e2ed032f96 fix test
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 73
diff changeset
224
31
e07deb07289d path to plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 22
diff changeset
225 if args.plugins != None:
87
4b24faec842b test_reconstruct_json2 + test_private_tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 82
diff changeset
226 config['Plugins'] = [ args.plugins ]
31
e07deb07289d path to plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 22
diff changeset
227
3
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228 with open(args.target, 'wt') as f:
87
4b24faec842b test_reconstruct_json2 + test_private_tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 82
diff changeset
229 f.write(json.dumps(config, indent = True, sort_keys = True))
4b24faec842b test_reconstruct_json2 + test_private_tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 82
diff changeset
230 f.write('\n')