Mercurial > hg > orthanc-tests
annotate Tests/CheckHttpServerSecurity.py @ 382:a8dd562943a7
added test_peer_store_straight
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 23 Feb 2021 15:13:56 +0100 |
parents | 7eb5b86508b1 |
children | e769bcf2b94f |
rev | line source |
---|---|
370
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 #!/usr/bin/env python |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 # Orthanc - A Lightweight, RESTful DICOM Store |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 # Department, University Hospital of Liege, Belgium |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 # Copyright (C) 2017-2021 Osimis S.A., Belgium |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 # |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 # This program is free software: you can redistribute it and/or |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 # modify it under the terms of the GNU General Public License as |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 # published by the Free Software Foundation, either version 3 of the |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 # License, or (at your option) any later version. |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 # |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 # This program is distributed in the hope that it will be useful, but |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 # WITHOUT ANY WARRANTY; without even the implied warranty of |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 # General Public License for more details. |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 # |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 # You should have received a copy of the GNU General Public License |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 import json |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 import os |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 import subprocess |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 import sys |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 import time |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 import Toolbox |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 if len(sys.argv) != 2: |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 print('Must provide a path to Orthanc binaries') |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 exit(-1) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 TMP = '/tmp/OrthancTest' |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 CONFIG = os.path.join(TMP, 'Configuration.json') |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 if os.path.exists(TMP): |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 print('Temporary path already exists: %s' % TMP) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 exit(-1) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 os.mkdir(TMP) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 ORTHANC = Toolbox.DefineOrthanc(username = 'orthanc', |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 password = 'orthanc') |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 def IsHttpServerSecure(config): |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 with open(CONFIG, 'w') as f: |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 f.write(json.dumps(config)) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 process = subprocess.Popen( |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 [ sys.argv[1], CONFIG ], |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 cwd = TMP, |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 #stdout=subprocess.PIPE, |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 stderr=subprocess.PIPE, |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 #shell=True |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 ) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 time.sleep(1) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 while True: |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 try: |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 system = Toolbox.DoGet(ORTHANC, '/system') |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 break |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 except: |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 time.sleep(0.1) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
69 process.terminate() |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 process.wait() |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
71 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
72 return system['IsHttpServerSecure'] |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
73 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
74 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
75 def Assert(b): |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 if not b: |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
77 raise Exception('Bad result') |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
78 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
79 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
80 print('==== TEST 1 ====') |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
81 Assert(IsHttpServerSecure({ |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
82 'RemoteAccessAllowed': False, |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
83 'RegisteredUsers' : { } |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
84 })) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
85 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
86 print('==== TEST 2 ====') |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
87 Assert(IsHttpServerSecure({ |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
88 'RemoteAccessAllowed': False, |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
89 'AuthenticationEnabled': False, |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
90 'RegisteredUsers' : { } |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
91 })) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
92 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
93 print('==== TEST 3 ====') |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
94 Assert(IsHttpServerSecure({ |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
95 'RemoteAccessAllowed': False, |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
96 'AuthenticationEnabled': True, |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
97 'RegisteredUsers' : { 'orthanc' : 'orthanc' } |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
98 })) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
99 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
100 print('==== TEST 4 ====') |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
101 Assert(not IsHttpServerSecure({ |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
102 'RemoteAccessAllowed': True |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
103 })) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
104 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
105 print('==== TEST 5 (server application scenario) ====') |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
106 Assert(not IsHttpServerSecure({ |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
107 'RemoteAccessAllowed': True, |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
108 'AuthenticationEnabled': False, |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
109 })) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
110 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
111 print('==== TEST 6 ====') |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
112 Assert(IsHttpServerSecure({ |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
113 'RemoteAccessAllowed': True, |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
114 'AuthenticationEnabled': True, |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
115 'RegisteredUsers' : { 'orthanc' : 'orthanc' } |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
116 })) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
117 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
118 print('==== TEST 7 (Docker scenario) ====') |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
119 Assert(not IsHttpServerSecure({ |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
120 'RemoteAccessAllowed': True, |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
121 'AuthenticationEnabled': True |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
122 })) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
123 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
124 print('Success!') |