Child pages
  • Sanity test

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. List all fileID's to and note which files are present in the collection. 

    Code Block
    ./bin/bitmag.sh get-file-ids -c books
  2. Put a file with an allowed fileID which is not already in the collection. 
    1. Wait for the put file operation to finish with success for all pillars. 

      Code Block
      ./bin/bitmag.sh put-file -c books -f logback.xml
  3. List all files
    1. Verify that the file put in 1 is present in the listing and that it is present on all pillars in the collection. 

      Code Block
      ./bin/bitmag.sh get-file-ids -c books | grep logback.xml | cut -d' ' -f1 | grep 3
    2. Trigger a collection of audittrails, and verify that the new file is present in the list of audit trail events. 

      Code Block
      http://localhost:8080/bitrepository-webclient/audit-trail-service.html
    3. Trigger a full integrity check, and verify that the new file is present and consistent. 

      Code Block
      http://localhost:8080/bitrepository-webclient/integrity-service.html
  4. Request a MD5 checksum for the file.
    1. Verify that all pillars deliver the requested checksum, and that all pillars agree on the checksum value. 

      Code Block
      ./bin/bitmag.sh get-checksums -c books -i logback.xml | grep logback.xml | cut -d' ' -f1,3 | grep 3\\s*All
  5. Request a salted checksum request.
    1. Verify that the checksum pillar is unable to perform the operation. 

      Code Block
      ./bin/bitmag.sh get-checksums -c books -i logback.xml -S salt -R md5 -p checksum-pillar | grep logback.xml
    2. Verify that all full pillars deliver and agree on the new calculation. 

      Code Block
      ./bin/bitmag.sh get-checksums -c books -i logback.xml -S salt -R md5  | grep logback.xml | cut -d' ' -f1,3 | grep 2\\s*All
    3. Verify that the salted checksum differs from the non-salted. 

      Code Block
      ./bin/bitmag.sh get-checksums -c books -i logback.xml -R md5 | diff -u - <(sleep 2 && ./bin/bitmag.sh get-checksums -c books -i logback.xml -S salt -R md5)
  6. Get file from pillar
    1. Verify its content is the same as the file that was previously put. 

      Code Block
      md5sum logback.xml | diff -u - <(sleep 2 && ./bin/bitmag.sh get-file -c books -i logback.xml -l logback.tmp.xml > /dev/null && md5sum logback.tmp.xml)
  7. Replace the file with a new file with different content than the original on each pillar. 

    Code Block
    xmllint logback.xml > logback.changed.xml
    bin/bitmag.sh replace-file -c books -i logback.xml -f logback.changed.xml -C $(md5sum logback.xml | cut -d' ' -f1) -p file1-pillar
    bin/bitmag.sh replace-file -c books -i logback.xml -f logback.changed.xml -C $(md5sum logback.xml | cut -d' ' -f1) -p file2-pillar
    bin/bitmag.sh replace-file -c books -i logback.xml -f logback.changed.xml -C $(md5sum logback.xml | cut -d' ' -f1) -p checksum-pillar
    1. Wait for each pillar to complete the operation.
  8. List all files
    1. Verify that the fileID is still present on all pillars. 

      Code Block
      ./bin/bitmag.sh get-file-ids -c books
  9. Calculate checksum for the file.
    1. Verify that all pillars deliver and agree on the checksum. 

      Code Block
      ./bin/bitmag.sh get-checksums -c books -i logback.xml | grep logback.xml | cut -d' ' -f1,3 | grep 3\\s*All
    2. Verify that the checksum differs from the one for the old file. 

      Code Block
      ./bin/bitmag.sh get-checksums -c books -i logback.xml | grep logback.xml | cut -d' ' -f2 | sed 's/\t\+//g' | diff -u - <(md5sum logback.xml | cut -d' ' -f1)
  10. Get file from pillar
    1. Verify that the files content is the same as the file uploaded during the replace action. 

      Code Block
      ./bin/bitmag.sh get-file -c books -i logback.xml -l logback.downloaded.xml > /dev/null && md5sum logback.downloaded.xml | cut -d' ' -f1 | diff -u - <(md5sum logback.changed.xml | cut -d' ' -f1)
  11. Delete the file on all pillars
    1. Wait for the operation(s) to complete with success 

      Code Block
      ./bin/bitmag.sh delete -c books -i logback.xml -C $(md5sum logback.changed.xml | cut -d' ' -f1) -p file1-pillar
      ./bin/bitmag.sh delete -c books -i logback.xml -C $(md5sum logback.changed.xml | cut -d' ' -f1) -p file2-pillar 
      ./bin/bitmag.sh delete -c books -i logback.xml -C $(md5sum logback.changed.xml | cut -d' ' -f1) -p checksum-pillar 
  12. List all files
    1. Verify that the file is no longer present on any pillars. 

      Code Block
      ./bin/bitmag.sh get-file-ids -c books -i logback.xml