[PATCH]litmus, test LOCK on unmapped url

Henrik Holst henrik at witsbits.com
Mon Sep 29 04:10:15 EDT 2008


It seams like Litmus has fallen off webdav.org so I try to send the
patch to this list since I was unable to find another one.

This patch adds a test for lock on unmapped url which according to
RFC4918 should return with 201. There is no such requirement in RFC2518
so it will only be reported as a warning and not as a failure.

Btw I noticed that the expect100 test is skipped if the server is using
SSL, really there should be no difference in how the server is
responding to expect100 request whether it is SSL or not?

The patch is included both inline and as attachment since I have
historically had problems with Evolution when sending patches, hopefully
the inline should work now though :)


--- src/locks_orig.c	2008-09-29 09:30:10.000000000 +0200
+++ src/locks.c	2008-09-29 10:02:39.000000000 +0200
@@ -545,6 +545,31 @@
     return OK;    
 }
 
+/* lock on unmapped url should return 201 */
+static int unmapped_lock(void)
+{
+    if (gotlock) {
+        ne_lock_destroy(gotlock);
+        gotlock = NULL;
+    }
+    ne_free(res);
+
+    res = ne_concat(i_path, "unmapped_url", NULL);
+
+    ONV(getlock(ne_lockscope_exclusive, NE_DEPTH_ZERO),
+        ("LOCK on %s via %s: %s",
+         coll, res, ne_get_error(i_session)));
+
+    if (STATUS(201)) 
+	t_warning("LOCK on unmapped url returned %d not 201", GETSTATUS);
+
+    unlock();
+    ne_delete(i_session, res);
+
+    return OK;
+}
+
+
 ne_test tests[] = {
     INIT_TESTS,
 
@@ -603,5 +628,8 @@
     T(indirect_refresh),
     T(unlock),
 
+    /* lock on a unmapped url */
+    T(unmapped_lock),
+
     FINISH_TESTS
 };

/Henrik Holst
Witsbits AB
-------------- next part --------------
A non-text attachment was scrubbed...
Name: locks.c.diff
Type: text/x-patch
Size: 890 bytes
Desc: not available
Url : http://lists.manyfish.co.uk/pipermail/neon/attachments/20080929/bbf57997/attachment-0005.bin 


More information about the neon mailing list