Test of the Bitpreservation functionality

Recent issues:



None special.


Prepare Installation

See Setup DK test environment.

Upload a Small Bitarchive

ssh devel@kb-prod-udv-001.kb.dk
scp -r ${HOME}/bitarchive_testdata kb-test-adm-001:
ssh kb-test-adm-001 chmod 755  bitarchive_testdata/upload.sh
#ssh kb-test-adm-001 'source .bash_profile;bitarchive_testdata/upload.sh $TESTX arcfiles'
#ssh kb-test-adm-001 'source .bash_profile;bitarchive_testdata/upload.sh $TESTX warcfiles'
ssh devel@kb-test-adm-001
# If TESTX is not set to TEST3A in your test-system, change the value below
bash bitarchive_testdata/upload.sh $TESTX arcfiles
bitarchive_testdata/upload.sh $TESTX warcfiles

Check Bitpreservation Status

Go to the Bitpreservation section of the GUI and update information for each replica.

Each replica should have the same number of files (25) and there should be no errors.

Delete a File

ssh devel@kb-prod-udv-001.kb.dk
mkdir -p temp_test3a
scp netarkdv@sb-test-bar-001.statsbiblioteket.dk:/netarkiv/0001/netarkdv/${TESTX}/filedir/2-metadata* temp_test3a/
ssh netarkdv@sb-test-bar-001.statsbiblioteket.dk rm /netarkiv/0001/netarkdv/${TESTX}/filedir/2-metadata*

Check that File is Missing in GUI

In the GUI, update the file status for SB. There should be one file missing.

Restore File Manually

Copy the file back:

## as devel@kb-prod-udv-001.kb.dk
scp temp_test3a/2-metadata* netarkdv@sb-test-bar-001.statsbiblioteket.dk:/netarkiv/0001/netarkdv/${TESTX}/filedir/

Now go to the Bitpreservation GUI and and check the box Get info for the "missing" file. The page should now say "There are no more missing files".

Delete the File Again

Delete the file again as in the above procedure.

Restore the File via the GUI

Corrupt a File in the Bitarchive

## as devel@kb-prod-udv-001.kb.dk
ssh netarkdv@sb-test-bar-001.statsbiblioteket.dk ls -l /netarkiv/0001/netarkdv/${TESTX}/filedir/2-metadata*
ssh netarkdv@sb-test-bar-001.statsbiblioteket.dk "echo foobar >> /netarkiv/0001/netarkdv/${TESTX}/filedir/2-metadata*"
ssh netarkdv@sb-test-bar-001.statsbiblioteket.dk ls -l /netarkiv/0001/netarkdv/${TESTX}/filedir/2-metadata*

The file size should have increased by a few bytes.

In the GUI, update the checksums for the replica SBN.

There should now be one file with an error. The file should have status UPLOAD_FAILED for SBN. Remain on this page in the GUI.

The number of files in all the replicas should be equal.

Corrupt the File Further

## as devel@kb-prod-udv-001.kb.dk
ssh netarkdv@sb-test-bar-001.statsbiblioteket.dk "echo barfoo >> /netarkiv/0001/netarkdv/${TESTX}/filedir/2-metadata*"

Try to Correct the File Through the GUI

Try to correct the file through the GUI (the password used should be "examplecredentials") using the button "Replace the file in replica BITARCHIVEReplica (SB) SBN".

It should fail with a message like this: Attempt at restoring 2-metadata-1.arc in replica replica BITARCHIVEReplica (SB) SBN failed

CorrectMessage failed: The RemoveAndGetFileMessage has returned the error: 'Attempt to remove /netarkiv/0001/netarkdv/TEST3A/filedir/2-metadata-1.arc failed due to checksum mismatch: eab093f9a5770785348513b30a2d126a != d284044cf0d07cf2ac86eab21689b36b'. Reply to CorrectMessage with the same error.'

Correct the File Through the GUI

Delete a Checksum Entry

## as devel@kb-prod-udv-001.kb.dk
ssh kb-test-acs-001 "sed -i '/2-metadata/d' ${TESTX}/CS/checksum_CS.md5"

Verify the Deleted Entry

Correct the Deleted Entry

Corrupt a Checksum Entry

## as devel@kb-prod-udv-001.kb.dk
ssh kb-test-acs-001 "sed -i '/2-metadata/s/$/foobar/' ${TESTX}/CS/checksum_CS.md5"

Correct the Corrupted Entry

Stop the Test and Clean-Up

## as devel@kb-prod-udv-001.kb.dk