Skip to content

Commit

Permalink
Fix (?) test_dicomweb_upload in sytem test
Browse files Browse the repository at this point in the history
  • Loading branch information
milanmlft committed Apr 26, 2024
1 parent 8ff11e1 commit 41b199b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
10 changes: 7 additions & 3 deletions test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ services:
platform: linux/amd64
environment:
ORTHANC_NAME: "dicomweb"
ORTHANC_USERNAME: "orthanc"
ORTHANC_PASSWORD: "orthanc"
ORTHANC_USERNAME: "orthanc_dicomweb"
ORTHANC_PASSWORD: "orthanc_dicomweb"
ORTHANC_AE_TITLE: "DICOMWEB"
RAW_AE_TITLE: ORHTANCRAW
RAW_DICOM_PORT: "4242"
Expand All @@ -64,7 +64,11 @@ services:
networks:
pixl-net:
healthcheck:
test: ["CMD-SHELL", "/probes/test-aliveness.py --user=orthanc --pwd=orthanc"]
test:
[
"CMD-SHELL",
"/probes/test-aliveness.py --user=orthanc_dicomweb --pwd=orthanc_dicomweb",
]
start_period: 10s
retries: 2
interval: 3s
Expand Down
17 changes: 13 additions & 4 deletions test/system_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,17 +181,26 @@ def _check_dcm_tags_from_zip(
@pytest.mark.usefixtures("_setup_pixl_cli_dicomweb")
def test_dicomweb_upload() -> None:
"""Check upload to DICOMweb server was successful"""
# This should point to the orthanc-anon server
ORTHANC_URL = "http://localhost:7003"
ORHANC_ANON_URL = "http://localhost:7003"
DICOMWEB_URL = "http://localhost:8044"

def check_dicomweb_study_present() -> bool:
def check_dicomweb_server_configured() -> bool:
response = requests.get(
ORTHANC_URL + "/dicom-web/studies",
ORHANC_ANON_URL + "/dicom-web/servers",
auth=("orthanc_anon_username", "orthanc_anon_password"),
timeout=30,
)
return "test" in response.json()

def check_dicomweb_study_present() -> bool:
response = requests.get(
DICOMWEB_URL + "/dicom-web/studies",
auth=("orthanc_dicomweb_username", "orthanc_dicomweb_password"),
data={"Uri": "/instances"},
timeout=30,
)
# Taken from https://orthanc.uclouvain.be/hg/orthanc-dicomweb/file/default/Resources/Samples/Python/SendStow.py
return response.status_code == 200 and "00081190" in response.json()[0]

wait_for_condition(check_dicomweb_server_configured)
wait_for_condition(check_dicomweb_study_present)

0 comments on commit 41b199b

Please sign in to comment.