test/wsgidav.c

Sat, 24 Jan 2026 13:56:19 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sat, 24 Jan 2026 13:56:19 +0100
branch
dav-2
changeset 902
06fa328989ee
permissions
-rw-r--r--

integrate wsgidav into test suite

902
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1 /*
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
3 *
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
4 * Copyright 2026 Olaf Wintermann. All rights reserved.
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
5 *
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
6 * Redistribution and use in source and binary forms, with or without
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
7 * modification, are permitted provided that the following conditions are met:
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
8 *
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
9 * 1. Redistributions of source code must retain the above copyright
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
10 * notice, this list of conditions and the following disclaimer.
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
11 *
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
12 * 2. Redistributions in binary form must reproduce the above copyright
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
13 * notice, this list of conditions and the following disclaimer in the
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
14 * documentation and/or other materials provided with the distribution.
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
15 *
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
26 * POSSIBILITY OF SUCH DAMAGE.
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
27 */
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
28
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
29 #include "wsgidav.h"
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
30
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
31 #include <stdio.h>
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
32 #include <stdlib.h>
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
33
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
34 //ifndef _WIN32
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
35
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
36 #include <unistd.h>
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
37 #include <sys/fcntl.h>
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
38
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
39 #include <spawn.h>
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
40 #include <sys/wait.h>
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
41 #include <sys/stat.h>
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
42
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
43 #include <cx/string.h>
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
44 #include <cx/buffer.h>
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
45 #include <cx/streams.h>
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
46 #include <cx/printf.h>
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
47
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
48
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
49 // -------------------------- Process Utils --------------------------------
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
50
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
51 typedef struct {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
52 pid_t pid;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
53 int in;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
54 int out;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
55 int err;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
56 } Process;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
57
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
58 static Process process_spawn(const char *exec, char **args) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
59 Process proc = { 0 };
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
60
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
61 int pin[2];
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
62 int pout[2];
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
63 int perr[2];
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
64
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
65 // child process stdin/stdout pipes
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
66 if(pipe(pin)) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
67 perror("pipe");
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
68 return proc;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
69 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
70 if(pipe(pout)) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
71 perror("pipe");
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
72 close(pin[0]);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
73 close(pin[1]);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
74 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
75 if(pipe(perr)) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
76 perror("pipe");
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
77 close(pin[0]);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
78 close(pin[1]);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
79 close(pout[0]);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
80 close(pout[1]);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
81 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
82
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
83 posix_spawn_file_actions_t actions;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
84 posix_spawn_file_actions_init(&actions);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
85 posix_spawn_file_actions_adddup2(&actions, pin[0], 0);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
86 posix_spawn_file_actions_adddup2(&actions, pout[1], 1);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
87 posix_spawn_file_actions_adddup2(&actions, perr[1], 2);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
88
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
89 // child environment variables
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
90 char *path = getenv("PATH");
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
91 if(!path) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
92 path = "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin";
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
93 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
94
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
95 cxmutstr env_path = cx_asprintf("PATH=%s", path);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
96
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
97 char *env[10];
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
98 env[0] = "LC_ALL=C";
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
99 env[1] = env_path.ptr;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
100 env[2] = NULL; // array must be null-terminated
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
101
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
102 // execute posix_spawn to create a child process
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
103 pid_t child;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
104 int ret = posix_spawn(
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
105 &child,
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
106 exec,
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
107 &actions,
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
108 NULL, // attributes
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
109 args,
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
110 env);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
111 posix_spawn_file_actions_destroy(&actions);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
112
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
113 close(pin[0]);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
114 close(pout[1]);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
115 close(perr[1]);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
116
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
117 if(ret) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
118 // posix spawn failed
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
119 perror("posix_spawn");
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
120 // close remaining pipe fds
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
121 close(pin[1]);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
122 close(pout[0]);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
123 close(perr[0]);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
124 } else {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
125 proc.pid = child;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
126 proc.in = pin[1];
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
127 proc.out = pout[0];
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
128 proc.err = perr[0];
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
129 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
130
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
131 return proc;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
132 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
133
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
134 int process_close(Process *p) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
135 if(p->pid == 0) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
136 return -1;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
137 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
138 close(p->in);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
139 close(p->out);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
140 int status = -1;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
141 waitpid(p->pid, &status, 0);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
142 return status;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
143 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
144
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
145 size_t process_read(void *buf, size_t size, size_t n, Process *p) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
146 ssize_t r = read(p->out, buf, size*n);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
147 return r > 0 ? r : 0;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
148 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
149
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
150 size_t process_err_read(void *buf, size_t size, size_t n, Process *p) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
151 ssize_t r = read(p->err, buf, size*n);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
152 return r > 0 ? r : 0;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
153 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
154
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
155 static cxmutstr read_str(Process *p, cx_read_func readf) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
156 if(p->pid == 0) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
157 return CX_NULLSTR;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
158 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
159 CxBuffer buffer;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
160 cxBufferInit(&buffer, NULL, NULL, 1024, CX_BUFFER_AUTO_EXTEND);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
161 cx_stream_copy(p, &buffer, readf, (cx_write_func)cxBufferWrite);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
162 cxBufferTerminate(&buffer);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
163 return cx_mutstrn(buffer.space, buffer.size);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
164 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
165
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
166 cxmutstr process_read_string(Process *p) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
167 return read_str(p, (cx_read_func)process_read);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
168 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
169
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
170 cxmutstr process_err_read_string(Process *p) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
171 return read_str(p, (cx_read_func)process_err_read);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
172 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
173
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
174
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
175 // ------------------------------ wsgidav exec -----------------------------
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
176
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
177 static char *wsgidav_exec_path;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
178 static Process wsgidav_process;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
179 static int runtest_root_dir = 0;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
180
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
181 int wsgidav_is_available(void) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
182 // check if the wsgidava binary is available
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
183 char *args[] = {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
184 "which",
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
185 "wsgidav",
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
186 NULL
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
187 };
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
188 Process p = process_spawn("/usr/bin/which", args);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
189 if(p.pid == 0) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
190 return 0;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
191 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
192
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
193 cxmutstr path = process_read_string(&p);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
194 int status = process_close(&p);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
195 if(status == 0) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
196 wsgidav_exec_path = cx_strdup(cx_strtrim(path)).ptr;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
197 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
198
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
199 free(path.ptr);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
200
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
201 if(status != 0) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
202 return 0;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
203 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
204
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
205 // check if the wsgidav config file is available
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
206 struct stat s;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
207 if(!stat("test/wsgidav/wsgidav.yaml", &s)) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
208 runtest_root_dir = 1; // dav root directory
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
209 } else {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
210 if(!stat("../test/wsgidav/wsgidav.yaml", &s)) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
211 runtest_root_dir = 2; // build directory
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
212 } else {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
213 fprintf(stderr, "Error: wsgidav found, but the config file wsgidav.yaml was not found\nTry running the tests from the dav root directory\n");
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
214 return 0;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
215 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
216 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
217
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
218 if(runtest_root_dir == 1) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
219 if(!stat("build", &s)) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
220 if(!S_ISDIR(s.st_mode)) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
221 fprintf(stderr, "Error: build is not a directory: wsgidav disabled\n");
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
222 return 0;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
223 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
224 } else {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
225 fprintf(stderr, "Error: build directory not found: wsgidav disabled\n");
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
226 return 0;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
227 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
228 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
229
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
230 return 1;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
231 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
232
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
233 int wsgidav_start(void) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
234 if(!wsgidav_exec_path) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
235 return 1; // wsgidav_start called but wsgidav_is_available return 0
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
236 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
237
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
238 if(runtest_root_dir == 1) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
239 if(chdir("build")) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
240 perror("chdir");
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
241 return 1;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
242 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
243 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
244
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
245 // delete previous testrepo directory
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
246 char *args1[] = { "rm", "-Rf", "testrepo", NULL };
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
247 Process p_rm = process_spawn("/bin/rm", args1);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
248 cxmutstr err = process_err_read_string(&p_rm);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
249 if(process_close(&p_rm) != 0) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
250 cxmutstr s = cx_strtrim(err);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
251 fprintf(stderr, "rm failed: %.*s\n", (int)s.length, s.ptr);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
252 return 1;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
253 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
254 free(err.ptr);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
255
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
256 // copy testrepo to the build directory
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
257 char *args2[] = { "cp", "-R", "../test/wsgidav/testrepo", "testrepo", NULL };
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
258 Process p_cp = process_spawn("/bin/cp", args2);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
259 err = process_err_read_string(&p_cp);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
260 if(process_close(&p_cp) != 0) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
261 cxmutstr s = cx_strtrim(err);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
262 fprintf(stderr, "cp failed: %.*s\n", (int)s.length, s.ptr);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
263 return 1;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
264 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
265 free(err.ptr);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
266
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
267 // start wsgidav
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
268 char *args3[] = { "wsgidav", "-c", "../test/wsgidav/wsgidav.yaml", NULL };
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
269 wsgidav_process = process_spawn(wsgidav_exec_path, args3);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
270
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
271 // TODO: parse log or try to connect to localhost
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
272 sleep(1);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
273
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
274 return 0;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
275 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
276
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
277 int wsgidav_stop(void) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
278 if(wsgidav_process.pid == 0) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
279 return 0;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
280 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
281 kill(wsgidav_process.pid, SIGKILL);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
282 (void)process_close(&wsgidav_process);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
283 //if(status > 2) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
284 // printf("wsgidav exit: %d\n", status);
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
285 //}
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
286 return 0;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
287 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
288
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
289 /*
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
290 #else
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
291
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
292 int wsgidav_is_available(void) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
293 return 0;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
294 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
295
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
296 int wsgidav_start(void) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
297 return 1;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
298 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
299
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
300 int wsgidav_stop(void) {
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
301 return 1;
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
302 }
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
303
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
304 #endif
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
305
06fa328989ee integrate wsgidav into test suite
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
306 */

mercurial