Skip to content

Instantly share code, notes, and snippets.

@mjordan
Last active May 26, 2018 22:12
Show Gist options
  • Save mjordan/f26ade27b1a9d0d8a9cc5280d4adf759 to your computer and use it in GitHub Desktop.
Save mjordan/f26ade27b1a9d0d8a9cc5280d4adf759 to your computer and use it in GitHub Desktop.
Testing Checksum Checker

Checking for verification cycle completion

  1. At the very top of function islandora_checksum_checker_send_check_complete_message() , add the line dd("Cycle complete");.
  2. Run checksum checker via either the drupal cron or the drush script enough times that all objects are checked. The number of times you will need to run checksum checker will depend on how many objects are in your repo and how many checksum checker is configured to check per cron run.
  3. Checksum checker will report that the verification cycle has completed. Tail /tmp/drupal_debug.txt to see the message confirmig this.

Checking for a checksum mismatch

  1. In the function islandora_checksum_checker_send_mismatch_notice(), add dd($mismatches, 'Mismatches'); just after the line of code $mismatches = variable_get('islandora_checksum_checker_mismatches', array());.
  2. Find where your OBJ datastreams are located by running find / -name '*OBJ*'. If you are using Islandora Vagrant, datastreams are stored in /usr/local/fedora/data/datastreamStore.
  3. Replace the OBJ datastream with another file to simulate bit-level corruption, e.g. cp foo.txt /usr/local/fedora/data/datastreamStore/cc/info%3Afedora%2Fislandora%3A6%2FOBJ%2FOBJ.0.
  4. Run checksum checker via either the drupal cron or the drush script enough times that this datastream is checked. The number of times you will need to run checksum checker will depend on how many objects are in your repo and how many checksum checker is configured to check per cron run.
  5. Checksum checker (actually, Fedora Commons) will report a checksum mismatch on this datastream. Tail /tmp/drupal_debug.txt to see the reported mismatch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment