diff -r 499711b2a970 -r c5985d2fc19a src/server/test/webdav.c --- a/src/server/test/webdav.c Sat Jan 18 13:48:59 2020 +0100 +++ b/src/server/test/webdav.c Sat Jan 18 16:31:52 2020 +0100 @@ -975,3 +975,34 @@ UCX_TEST_END; testutil_destroy_session(sn); } + +UCX_TEST(test_webdav_propfind) { + Session *sn = testutil_session(); + Request *rq = testutil_request(sn->pool, "PROPFIND", "/"); + + pblock_nvinsert("path", "/", rq->vars); + pblock_nvinsert("uri", "/", rq->reqpb); + + + TestIOStream *st = testutil_iostream(2048, TRUE); + sn->csd = st; + + testutil_request_body(sn, rq, TEST_PROPFIND1, strlen(TEST_PROPFIND1)); + + UCX_TEST_BEGIN; + + pblock *pb = pblock_create_pool(sn->pool, 4); + + int ret = webdav_propfind(pb, sn, rq); + + UCX_TEST_ASSERT(ret == REQ_PROCEED, "webdav_propfind (1) failed"); + + xmlDoc *doc = xmlReadMemory( + st->buf->space, st->buf->size, NULL, NULL, 0); + UCX_TEST_ASSERT(doc, "response is not valid xml"); + + //printf("\n\n%.*s\n", (int)st->buf->size, st->buf->space); + + UCX_TEST_END; + testutil_destroy_session(sn); +}