view scripts/search/tests/create-all-and-test @ 14:be7787c36e58 default tip

new: nofity LGSercies for deleted files
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Mon, 02 Nov 2015 16:41:23 +0100
parents a50cf11e5178
children
line wrap: on
line source

#!/bin/sh
. scripts/search/export-keys
echo "Creating bird and tree dataverses"
scripts/search/populate-bird-dvs1
scripts/search/create-bird-dvs1 > /tmp/bird-dvs1
scripts/search/populate-tree-dvs1
scripts/search/create-tree-dvs1 > /tmp/tree-dvs1
echo "Creating some datasets"
curl -s --insecure --data-binary @scripts/search/tests/data/dataset-trees1.xml -H 'Content-Type: application/atom+xml' -u $SPRUCEKEY: https://localhost:8181/dvn/api/data-deposit/v1.1/swordv2/collection/dataverse/spruce | xmllint -format - >/dev/null
curl -s -X POST -H "Content-type:application/json" -d @scripts/search/tests/data/dataset-finch1.json "http://localhost:8080/api/dataverses/finches/datasets/?key=$FINCHKEY" >/dev/null
echo "Uploading a file"
. scripts/search/assumptions
curl -s --insecure --data-binary @scripts/search/data/binary/trees.zip -H 'Content-Disposition: filename=trees.zip' -H 'Content-Type: application/zip' -H 'Packaging: http://purl.org/net/sword/package/SimpleZip' -u $SPRUCEKEY: https://localhost:8181/dvn/api/data-deposit/v1.1/swordv2/edit-media/study/$FIRST_SPRUCE_DOI >/dev/null
# give the file a little time to ingest
sleep 2
echo "Everything in draft, checking permissions. Silence is golden."
scripts/search/tests/permissions1
echo "Done."
. scripts/search/assumptions
echo "Giving $SPRUCE_USERNAME "admin" on Birds dataverse"
scripts/search/tests/grant-spruce-admin-on-birds
echo Re-testing permissions. Silence is golden
scripts/search/tests/permissions2
echo Done
. scripts/search/assumptions
echo "Revoking that role"
#curl -s -X DELETE "http://localhost:8080/api/dataverses/$BIRDS_DATAVERSE/assignments/$SPRUCE_ADMIN_ON_BIRDS?key=$FINCHKEY" >/dev/null
scripts/search/tests/revoke-spruce-admin-on-birds
echo "Making sure original permissions are back. Silence is golden."
scripts/search/tests/permissions1
echo "Done"