artefactual / automation-tools

Tools to aid automation of Archivematica and AtoM.
GNU Affero General Public License v3.0
46 stars 33 forks source link

Add functions required for AMAUAT black-box tests #97

Closed ross-spencer closed 5 years ago

ross-spencer commented 5 years ago

This PR adds three new capabilities to amclient.py:

Functionality has been integrated with the client, i.e. it isn't just module capability. Tests have been provided, but we might want to improve on those as the Sprints involved in this work progress.

For the reviewer, if there are any nice-to-have's then we might consider a new issue and PR in future as this work seeks to satisfy the initial requirements of the Wellcome AMAUAT work.

Connected to archivematica/issues#478 Connected to archivematica/issues#510 Connected to archivematica/issues#509

Examples of CLI usage below:

Most are based on DemoTransfer in the SampleData repository, UUIDs, passwords, urls, and transfer names need to be replaced appropriately.

Extract file CLI example:

python -m transfers.amclient extract-file \
    test \
    2ad1bf0d-23fa-44e0-a128-9feadfe22c42 \
    amclient-transfer_1-2ad1bf0d-23fa-44e0-a128-9feadfe22c42/data/objects/bird.mp3  \
    --ss-user-name test \
    --ss-url http://127.0.0.1:62081 \
    --saveas-filename myfilename --directory mydirectory

Create package CLI example:

python3 -m transfers.amclient create-package \
    test \
    "/archivematica/archivematica-sampledata/SampleTransfers/DemoTransfer" \
    --am-user-name test \
    --am-url http://127.0.0.1:62080 \
    --transfer-source 6e93c5b8-0ba3-4b54-9648-00ed3187d410 \
    --processing-config automated --transfer-name mytransfername
python3 -m transfers.amclient create-package \
    test \
    "/home/archivematica/archivematica-sampledata/SampleTransfers/DemoTransfer" \
    --am-user-name test \
    --am-url http://127.0.0.1:62080 \
    --processing-config automated \
    --transfer-name mytransfername

Retrieve storage service locations example:

python -m transfers.amclient list-storage-locations \
    --ss-user-name test test
ross-spencer commented 5 years ago

Thx @replaceafill - one step closer in this sprint!