davical/testing/tests/binding/1031-MKTICKET-admin.test
Andrew Ruthven 7c47658bee Make the curl and SQL requests when we see them
This allows us to have more complex test files where an action is taken, then
we test something, then another action is taken, etc.

Changes to test files are required so that URL is defined after all the
required settings are set.

Changes to the result files are either whitespace changes due to above logic
changes, or printing out a SQL Result header before each result. I figured it
was useful.
2024-04-01 22:57:10 +13:00

37 lines
1.1 KiB
Plaintext

#
# MKTICKET request for a read/write ticket on a collection
# - ticket should have no expiry
#
TYPE=MKTICKET
HEADER=User-Agent: Ticket Spec Tests
HEADER=Content-Type: text/xml; charset="UTF-8"
HEAD
AUTH=admin:nimda
BEGINDATA
<?xml version="1.0" encoding="utf-8" ?>
<T:ticketinfo xmlns:D="DAV:" xmlns:T="http://www.xythos.com/namespaces/StorageServer" >
<D:privilege><D:read/><D:write/></D:privilege>
<T:timeout>infinity</T:timeout>
</T:ticketinfo>
ENDDATA
REPLACE=!ETag: "\S+"!ETag: "Some good etag"!
REPLACE=!<T:id>\S{8}</T:id>!<T:id>Good Ticket ID</T:id>!
REPLACE=!Ticket: \S{8}!Ticket:Good Ticket ID!
URL=http://regression.host/caldav.php/user3/home/
QUERY
SELECT access_ticket.dav_owner_id,
date_trunc( 'minute', ('55 seconds' + access_ticket.expires - current_timestamp)::interval(0)) AS timeout,
access_ticket.privileges,
target_collection_id,
target_resource_id,
collection.dav_name
FROM access_ticket
INNER JOIN collection ON (collection_id = target_collection_id)
WHERE collection.dav_name = '/user3/home/'
ENDQUERY
# WHERE target_collection = 161