# HG changeset patch # User Sebastien Jodogne # Date 1786721237 -7200 # Node ID 4b44c9333ccc91fcd1552141bfd313cc01bc5adb # Parent ae065472bc8f238cd087e9784f7b5697fd8178a1 fix Tests/CheckHttpServerSecurity.py diff -r ae065472bc8f -r 4b44c9333ccc Tests/CheckHttpServerSecurity.py --- a/Tests/CheckHttpServerSecurity.py Thu Aug 13 16:53:31 2026 +0200 +++ b/Tests/CheckHttpServerSecurity.py Fri Aug 14 17:27:17 2026 +0200 @@ -59,22 +59,30 @@ #shell=True ) - time.sleep(1) + success = False - while True: + while process.poll() is None: # Orthanc is still running try: system = Toolbox.DoGet(ORTHANC, '/system') + success = True break except: - time.sleep(0.1) + pass + + time.sleep(0.1) process.terminate() process.wait() - return system['IsHttpServerSecure'] + if success: + return system['IsHttpServerSecure'] + else: + return None # Orthanc has not started def Assert(b): + if b == None: + raise Exception('Bad result') if not b: raise Exception('Bad result') @@ -100,15 +108,15 @@ })) print('==== TEST 4 ====') -Assert(not IsHttpServerSecure({ +Assert(IsHttpServerSecure({ 'RemoteAccessAllowed': True - })) + }) == None) print('==== TEST 5 (server application scenario) ====') -Assert(not IsHttpServerSecure({ +Assert(IsHttpServerSecure({ 'RemoteAccessAllowed': True, 'AuthenticationEnabled': False, - })) + }) == False) print('==== TEST 6 ====') Assert(IsHttpServerSecure({ @@ -118,9 +126,9 @@ })) print('==== TEST 7 (Docker scenario) ====') -Assert(not IsHttpServerSecure({ +Assert(IsHttpServerSecure({ 'RemoteAccessAllowed': True, 'AuthenticationEnabled': True - })) + }) == None) print('Success!')