Integrity Service tests
Describes the tests needed to validate the Integrity Service functionality.
Workflows
Verify existing workflows
- Verify that the following workflows are listed in the
Integrity service configuration
dropdown and theWorkflow
table:CompleteIntegrityCheck
IncrementalIntegrityCheck
RepairMissingFilesWorkflow
SaltedChecksumWorkflow
Manually start workflow
- Start the
CompleteIntegrityCheck
by clicking theStart
button. - Verify that the current state begins to show the different steps of the workflow.
- Verify that the workflow can finish and go to the state 'idle'
- Click on the date for the 'last run' and validate that all of the previously found steps are shown with a duration time.
Test missing file
- Delete a file from one of the pillars (e.g. move it away from the fileDir in the ReferencePillar)
- preferably a file with fileID starting with an alphabetically early letter as the laterRepairMissingFilesWorkflow
will handle files in alphabetical order. - Run the
CompleteIntegrityCheck
by clicking theStart
button - and wait until it is finished. - Verify that no corrupt files have been found anywhere.
- Verify that the given pillar is missing a file (or one more file than before the running of the workflow).
- Look at the list of existing files at the pillar, and verify that the deleted file is not on the list.
- Look at the list of existing files at another pillar, and verify that the deleted file is on the list for that pillar.
- Look at the list of missing files at the pillar, and verify that the deleted file is on the list.
- Verify that the file is not missing at any other pillar
- Verify that an alarm has been sent to the AlarmService about the missing file. All pillars are said in the alarm message to have "<pillarid> is missing X files".
- If files were already missing on the pillar, you may be able to check the newest alarm against the last one and confirm that the count for missing files has been incremented by 1.
Restoring the missing file
- Use the
RepairMissingFilesWorkflow
to restore the missing file - and wait until it is finished. - Run the
CompleteIntegrityCheck
by clicking theStart
button - and wait until it is finished. - Verify that the file is not longer missing at the pillar.
Test corrupt file at single pillar
- Change in the content of a file at one of the pillars (e.g. run replace-file, or add a character to it in the fileDir of the ReferencePillar) - The file must be present at all pillars initially and not have any checksum errors.
- If the file is manually edited the checksum error will not be picked up until the pillar itself recalculates checksums - prefer using replace-file if you're not editing the pillar's recalculation interval.
- Run the
CompleteIntegrityCheck
by clicking theStart
button - and wait until it is finished. - Verify that no pillar is missing the corrupted file.
- Verify that only the pillar, where it has been corrupted, has the given file on their list of 'files with checksum error'.
- Verify that an alarm has been sent to the AlarmService about the corrupt file.
Test corrupt file at multiple pillars
- Choose a collection with more than 3 pillars.
- Upload a file to all pillars
- Run replace-file command with another file for two of the pillars (thus at least two has the original and at least two has the new file)
- Run the
CompleteIntegrityCheck
by clicking theStart
button - and wait until it is finished. - Verify that no pillar is missing the corrupted file.
- Verify that all pillars have the given file on their list of 'Number of inconsistent checksums'.
- Verify that an alarm has been sent to the AlarmService about the corrupt file.
Restoring the corrupt file
- Restore the file by running a
deleteFile
on the pillars with the corrupted files followed by aputFile
with the original file - Run the
CompleteIntegrityCheck
by clicking theStart
button - and wait until it is finished. - Verify that the file is no longer on the list of 'files with checksum error'.
Testing the Integrity Information for collection
- Check the current integrity information about a given collection (i.e. 'Latest ingest', 'Size', and 'Number of files').
- Upload a new file in the current measurement size of the collection information (i.e. if the size is currently measured in MB, then upload a new file of at least 1 MB).
- Run the
CompleteIntegrityCheck
by clicking theStart
button - and wait until it is finished. - Verify that the number of files has increased by 1, and the total file size has increased accordingly with the size of the new file.
Verify that workflow dates are not identical for different collections
- Check whether the workflows have different 'last run' dates for the different collections
- Run the
CompleteIntegrityCheck
for one of the collections by clicking theStart
button - and wait until it is finished. - Verify that a new 'last run' date is updated to the time when the workflow was started.
- Verify that the other workflows, which has not been run, are not updated by this.
Test the salted checksums integrity check
- Run the
SaltedChecksumWorkflow
workflow and wait for its completion - Verify that the workflow was a success and that it has not resulted in sending any alarms.
- NB: the workflow picks a random file in the collection to make a salted checksum for, so if the picked file only exists on a checksum pillar it will fail and throw an alarm - if so, just ignore it and try running the workflow again