Skip to content

Commit

Permalink
Improve orthanc-anon check
Browse files Browse the repository at this point in the history
The existing test script checked the orthanc-anon log for receipt of a DICOM but
this was not catching that the received DICOM was not being stored due problems
during anonymisation.  The new check script queries the orthanc-anon API to make
sure it has received and stored the test DICOMs.
  • Loading branch information
jstutters committed Jan 31, 2024
1 parent 255c23d commit 868418f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 20 deletions.
2 changes: 1 addition & 1 deletion test/run-system-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pixl populate "${PACKAGE_DIR}/test/resources/omop"
pixl start
sleep 65 # need to wait until the DICOM image is "stable" = 60s
./scripts/check_entry_in_pixl_anon.sh
./scripts/check_entry_in_orthanc_anon.sh
./scripts/check_entry_in_orthanc_anon.py
./scripts/check_max_storage_in_orthanc_raw.sh

pixl extract-radiology-reports "${PACKAGE_DIR}/test/resources/omop"
Expand Down
15 changes: 15 additions & 0 deletions test/scripts/check_entry_in_orthanc_anon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env python3

# After pixl has run this script will query the orthanc-anon REST API to check
# that the correct number of instances have been received.

import json
import shlex
import subprocess


instances_cmd = shlex.split('docker exec -it system-test-orthanc-anon-1 curl -u "orthanc_anon_username:orthanc_anon_password" http://orthanc-anon:8042/instances')
instances_output = subprocess.run(instances_cmd, capture_output=True, check=True, text=True)
instances = json.loads(instances_output.stdout)
print("orthanc-anon instances:", instances)
assert len(instances) == 2
19 changes: 0 additions & 19 deletions test/scripts/check_entry_in_orthanc_anon.sh

This file was deleted.

0 comments on commit 868418f

Please sign in to comment.