Child pages
  • PutFile tests
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 16 Next »

Describes the tests needed to validate the PutFile functionality.

The commands presented are just examples of what the actual command to test with could look like.

Basic put

  1. Put a file to all pillars
    1. Run put command on a file which is not present in the collection.
      1. bash bin/bitmag.sh put-file -c integrationtest2 -f conf/logback.xml
    2. Verify that it is now present at all pillars, and that it has the same checksum at all pillars
      1. bash bin/bitmag.sh get-file-ids -c integrationtest2 -i logback.xml
      2. bash bin/bitmag.sh get-checksums -c integrationtest2 -i logback.xml
  2. Put a file with a different file-id to all pillars
    1. Run put command on a file and use the file-id parameter (-i)
      1. bash bin/bitmag.sh put-file -c integrationtest2 -f conf/logback.xml -i putFileTest_2015_02_20
    2. Verify that it is now present at all pillars, and that it has the same checksum at all pillars
      1. bash bin/bitmag.sh get-file-ids -c integrationtest2 -i putFileTest_2015_02_20
      2. bash bin/bitmag.sh get-checksums -c integrationtest2 -i putFileTest_2015_02_20
  3. Put a file by using an URL
    1. Use the URL and Checksum to put a file, already on the webdav server.
      1. bash bin/bitmag.sh put-file -c integrationtest2 -u http://sandkasse-01.kb.dk/dav/test.txt -i putFileTest_2_2015_02_20.txt -C 940a51b250e7aa82d8e8ea31217ff267
    2. Verify that it is now present at al pillars, with the requested checksum
      1. bash bin/bitmag.sh get-file-ids -c integrationtest2 -i putFileTest_2_2015_02_20.txt
      2. bash bin/bitmag.sh get-checksums -c integrationtest2 -i putFileTest_2_2015_02_20.txt

Idempotent test

  1. Attempt to put a file with an fileID that is already present in the collection suppling the same checksum
    1. The putFile request should succeed.
      1. bash bin/bitmag.sh put-file -c integrationtest2 -f conf/logback.xml

Put with returned checksums

  1. Put a file with including the a request of a salted checksum calculated on the pillar, which should be returned.
    1. Use the request-checksum-algorithm and request-checksum-salt arguments (-R and -S):
      1. bash bin/bitmag.sh put-file -c integrationtest2 -u http://sandkasse-01.kb.dk/dav/test.txt -i putFileTest_3_2015_02_20.txt -C 940a51b250e7aa82d8e8ea31217ff267 -S salt -R HMAC_SHA1
    2. Verify that the checksumpillar does not reply with a checksum.
    3. Verify that the checksumpillar and all the other pillars have the file
      1. bash bin/bitmag.sh get-file-ids -c integrationtest2 -i putFileTest_3_2015_02_20.txt

Error scenarios

  1. Attempt to put a file with an fileID that is already present in the collection (ensure that the file has a different checksum from the already archived)
    1. The putFile request should fail informing the user that a file with the given file ID already exists in the collection.
      1. bash bin/bitmag.sh put-file -c integrationtest2 -f conf/RepositorySettings.xml -i putFileTest_2_2015_02_20.txt

  2. Attempt to put a file which does not exist
    1. Client should fail immediately
      1. bash bin/bitmag.sh put-file -c integrationtest2 -f ThisFileDoesNotExist
  3. Attempt to put a file to a non-existing collection
    1. Client should fail immediately
      1. bash bin/bitmag.sh get-checksums -c integrationtest3 -i putFileTest_5_2015_02_20.txt

  4. Attempt to put a file to a non-existing pillar
    1. Client should fail immediately
      1. bash bin/bitmag.sh get-checksums -c integrationtest1 -i putFileTest_5_2015_02_20.txt -p non-existing-pillar

 

Open issues

Key P Summary T Created
Loading...
Refresh

  • No labels