mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-08-04 14:19:23 +00:00
Initial set of tests for LOCK / UNLOCK on collections.
This commit is contained in:
parent
e957cab57a
commit
3352ef4baf
27
testing/tests/regression-suite/810-Spec-LOCK-1.result
Normal file
27
testing/tests/regression-suite/810-Spec-LOCK-1.result
Normal file
@ -0,0 +1,27 @@
|
||||
HTTP/1.1 200 OK
|
||||
Date: Dow, 01 Jan 2000 00:00:00 GMT
|
||||
Lock-Token: <opaquelocktoken:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx>
|
||||
Content-Length: 473
|
||||
Content-Type: text/xml; charset="utf-8"
|
||||
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<prop xmlns="DAV:">
|
||||
<lockdiscovery xmlns="DAV:">
|
||||
<activelock>
|
||||
<locktype>
|
||||
<write/>
|
||||
</locktype>
|
||||
<lockscope>
|
||||
<exclusive/>
|
||||
</lockscope>
|
||||
<depth>0</depth>
|
||||
<owner>
|
||||
<href>http://andrew.mcmillan.net.nz/node/5/</href>
|
||||
</owner>
|
||||
<timeout>Second-8640000</timeout>
|
||||
<locktoken>
|
||||
<href>opaquelocktoken:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</href>
|
||||
</locktoken>
|
||||
</activelock>
|
||||
</lockdiscovery>
|
||||
</prop>
|
||||
24
testing/tests/regression-suite/810-Spec-LOCK-1.test
Normal file
24
testing/tests/regression-suite/810-Spec-LOCK-1.test
Normal file
@ -0,0 +1,24 @@
|
||||
#
|
||||
# Test specification compliance for LOCK request on a collection
|
||||
#
|
||||
TYPE=LOCK
|
||||
URL=http://mycaldav/caldav.php/user1/home/
|
||||
HEADER=Depth: 0
|
||||
HEADER=Timeout: Infinite,Second-4100000000
|
||||
HEADER=Content-type: text/xml; charset="utf-8"
|
||||
HEAD
|
||||
|
||||
#
|
||||
# Include the data in-line
|
||||
#
|
||||
BEGINDATA
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<D:lockinfo xmlns:D='DAV:'>
|
||||
<D:lockscope><D:exclusive/></D:lockscope>
|
||||
<D:locktype><D:write/></D:locktype>
|
||||
<D:owner>
|
||||
<D:href>http://andrew.mcmillan.net.nz/node/5/</D:href>
|
||||
</D:owner>
|
||||
</D:lockinfo>
|
||||
ENDDATA
|
||||
|
||||
27
testing/tests/regression-suite/811-Spec-LOCK-1.result
Normal file
27
testing/tests/regression-suite/811-Spec-LOCK-1.result
Normal file
@ -0,0 +1,27 @@
|
||||
HTTP/1.1 200 OK
|
||||
Date: Dow, 01 Jan 2000 00:00:00 GMT
|
||||
Content-Length: 473
|
||||
Content-Type: text/xml; charset="utf-8"
|
||||
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<prop xmlns="DAV:">
|
||||
<lockdiscovery xmlns="DAV:">
|
||||
<activelock>
|
||||
<locktype>
|
||||
<write/>
|
||||
</locktype>
|
||||
<lockscope>
|
||||
<exclusive/>
|
||||
</lockscope>
|
||||
<depth>0</depth>
|
||||
<owner>
|
||||
<href>http://andrew.mcmillan.net.nz/node/5/</href>
|
||||
</owner>
|
||||
<timeout>Second-8640000</timeout>
|
||||
<locktoken>
|
||||
<href>opaquelocktoken:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</href>
|
||||
</locktoken>
|
||||
</activelock>
|
||||
</lockdiscovery>
|
||||
</prop>
|
||||
Refreshed (should be 1) --- 1
|
||||
29
testing/tests/regression-suite/811-Spec-LOCK-1.test
Normal file
29
testing/tests/regression-suite/811-Spec-LOCK-1.test
Normal file
@ -0,0 +1,29 @@
|
||||
#
|
||||
# Test specification compliance for LOCK request
|
||||
# - Refresh the lock
|
||||
# No data is needed for a refresh
|
||||
#
|
||||
TYPE=LOCK
|
||||
URL=http://mycaldav/caldav.php/user1/home/
|
||||
|
||||
# Save the original lock time for later use
|
||||
GETSQL=oldlocktime
|
||||
SELECT start FROM locks WHERE dav_name = '/user1/home/'
|
||||
ENDSQL
|
||||
|
||||
# Get the lock token from the earlier lock
|
||||
GETSQL=locktoken
|
||||
SELECT opaquelocktoken FROM locks WHERE dav_name = '/user1/home/'
|
||||
ENDSQL
|
||||
|
||||
HEADER=Depth: 0
|
||||
HEADER=Timeout: Infinite,Second-4100000000
|
||||
HEADER=Content-type: text/xml; charset="utf-8"
|
||||
HEADER=Lock-Token: <opaquelocktoken:##locktoken##>
|
||||
HEAD
|
||||
|
||||
#
|
||||
# Do a query after the request
|
||||
QUERY
|
||||
SELECT 'Refreshed (should be 1)', start != '##oldlocktime##'::timestamp AS refresh_success FROM locks WHERE dav_name = '/user1/home/'
|
||||
ENDQUERY
|
||||
12
testing/tests/regression-suite/812-Spec-LOCK-1.result
Normal file
12
testing/tests/regression-suite/812-Spec-LOCK-1.result
Normal file
@ -0,0 +1,12 @@
|
||||
HTTP/1.1 207 Multi-Status
|
||||
Date: Dow, 01 Jan 2000 00:00:00 GMT
|
||||
Content-Length: 183
|
||||
Content-Type: text/xml; charset="utf-8"
|
||||
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<multistatus xmlns="DAV:">
|
||||
<response>
|
||||
<href>/user1/home/</href>
|
||||
<status>HTTP/1.1 423 Resource Locked</status>
|
||||
</response>
|
||||
</multistatus>
|
||||
26
testing/tests/regression-suite/812-Spec-LOCK-1.test
Normal file
26
testing/tests/regression-suite/812-Spec-LOCK-1.test
Normal file
@ -0,0 +1,26 @@
|
||||
#
|
||||
# Test specification compliance for LOCK request
|
||||
# - This is a request for something which is already locked
|
||||
# and should fail.
|
||||
#
|
||||
TYPE=LOCK
|
||||
URL=http://mycaldav/caldav.php/user1/home/
|
||||
HEADER=Depth: 0
|
||||
HEADER=Timeout: Infinite,Second-4100000000
|
||||
HEADER=Content-type: text/xml; charset="utf-8"
|
||||
HEAD
|
||||
|
||||
#
|
||||
# Include the data in-line
|
||||
#
|
||||
BEGINDATA
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<D:lockinfo xmlns:D='DAV:'>
|
||||
<D:lockscope><D:exclusive/></D:lockscope>
|
||||
<D:locktype><D:write/></D:locktype>
|
||||
<D:owner>
|
||||
<D:href>http://andrew.mcmillan.net.nz/node/5/</D:href>
|
||||
</D:owner>
|
||||
</D:lockinfo>
|
||||
ENDDATA
|
||||
|
||||
12
testing/tests/regression-suite/815-Spec-UNLOCK-1.result
Normal file
12
testing/tests/regression-suite/815-Spec-UNLOCK-1.result
Normal file
@ -0,0 +1,12 @@
|
||||
HTTP/1.1 207 Multi-Status
|
||||
Date: Dow, 01 Jan 2000 00:00:00 GMT
|
||||
Content-Length: 183
|
||||
Content-Type: text/xml; charset="utf-8"
|
||||
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<multistatus xmlns="DAV:">
|
||||
<response>
|
||||
<href>/user1/home/</href>
|
||||
<status>HTTP/1.1 423 Resource Locked</status>
|
||||
</response>
|
||||
</multistatus>
|
||||
14
testing/tests/regression-suite/815-Spec-UNLOCK-1.test
Normal file
14
testing/tests/regression-suite/815-Spec-UNLOCK-1.test
Normal file
@ -0,0 +1,14 @@
|
||||
#
|
||||
# Test specification compliance for LOCK/UNLOCK request
|
||||
# - This should fail because we provide an invalid lock token
|
||||
#
|
||||
TYPE=UNLOCK
|
||||
URL=http://mycaldav/caldav.php/user1/home/
|
||||
|
||||
HEADER=Content-type: text/xml; charset="utf-8"
|
||||
HEADER=Lock-Token: <opaquelocktoken:cafefeed-c001-b055-ea75-deadbeef4a11>
|
||||
HEAD
|
||||
|
||||
#
|
||||
# There is no data for an UNLOCK request
|
||||
#
|
||||
16
testing/tests/regression-suite/816-Spec-UNLOCK-1.test
Normal file
16
testing/tests/regression-suite/816-Spec-UNLOCK-1.test
Normal file
@ -0,0 +1,16 @@
|
||||
#
|
||||
# Test specification compliance for LOCK/UNLOCK request
|
||||
#
|
||||
TYPE=UNLOCK
|
||||
URL=http://mycaldav/caldav.php/user1/home/
|
||||
|
||||
# Get the lock token from the earlier lock
|
||||
GETSQL=locktoken
|
||||
SELECT opaquelocktoken FROM locks WHERE dav_name = '/user1/home/'
|
||||
ENDSQL
|
||||
|
||||
HEADER=Lock-Token: <opaquelocktoken:##locktoken##>
|
||||
HEAD
|
||||
|
||||
# There is no data for an UNLOCK request
|
||||
#
|
||||
Loading…
x
Reference in New Issue
Block a user