13be292018-02-21Karl Gustav Sterneberg inherit "etc/test/tests/http/WebdavTestBase.pike";
ad307f2018-02-16Henrik Grubbström (Grubba) 
c5d9212018-02-21Karl Gustav Sterneberg private string testdir = "/testdir/"; private string filesystem_dir = "$VARDIR/testsuite/webdav";
ad307f2018-02-16Henrik Grubbström (Grubba) // Expanded filesystem_dir.
c5d9212018-02-21Karl Gustav Sterneberg private string real_dir; string get_testdir() { return testdir; }
ad307f2018-02-16Henrik Grubbström (Grubba) 
30c5062018-02-16Henrik Grubbström (Grubba) int filesystem_check_exists(string path) { string real_path = Stdio.append_path(real_dir, path); return Stdio.is_file(real_path); }
ad307f2018-02-16Henrik Grubbström (Grubba) 
30c5062018-02-16Henrik Grubbström (Grubba) string filesystem_read_file(string path)
ad307f2018-02-16Henrik Grubbström (Grubba) { string real_path = Stdio.append_path(real_dir, path);
30c5062018-02-16Henrik Grubbström (Grubba)  return Stdio.read_bytes(real_path); }
ad307f2018-02-16Henrik Grubbström (Grubba) void setup() {
c5d9212018-02-21Karl Gustav Sterneberg  webdav_mount_point = "webdav/"; basic_auth = "test:test";
ad307f2018-02-16Henrik Grubbström (Grubba)  real_dir = roxen_path(filesystem_dir); report_debug("Webdav real_dir: %O\n", real_dir); Stdio.mkdirhier(real_dir); }