Roxen.git
/
server
/
etc
/
test
/
modules
/
TEST.pmod
/
http.pmod
/
WebDAV.pmod
/
TestBase.pike
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/etc/test/modules/TEST.pmod/http.pmod/WebDAV.pmod/TestBase.pike:2344:
webdav_move(src_file, target_file, locks, caseSensitive ? STATUS_CREATED : STATUS_NO_CONTENT); } } } } } } }
+
// Runs only on case insensitive systems.
+
public void test_x_put_copy_move_delete()
+
{
+
if (case_sensitive()) {
+
return;
+
}
+
string mv_dst = Stdio.append_path(this::testcase_dir, "mv_dst");
+
string cp_dst = Stdio.append_path(this::testcase_dir, "cp_dst");
+
foreach (FILENAMES, string filename) {
+
foreach (({"NFC", "NFD"}), string unicode_method_put) {
+
string put_path = make_filenames(this::testcase_dir,
+
filename,
+
unicode_method_put,
+
true)->mc;
+
string ls_name = make_filenames(this::testcase_dir,
+
filename,
+
"NFC",
+
false)->mc;
+
foreach (({"NFC", "NFD"}), string unicode_method_cpmv) {
+
mapping(string:string) path = make_filenames(this::testcase_dir,
+
filename,
+
unicode_method_cpmv,
+
true);
+
foreach (({"lc", "uc"}), string case_) {
+
webdav_put(put_path, "My content", STATUS_CREATED);
+
webdav_ls(this::testcase_dir, ({ this::testcase_dir, ls_name }));
+
+
// Put with wrong case should not change filename.
+
webdav_put(path[case_], "My new content", STATUS_OK);
+
webdav_ls(this::testcase_dir, ({ this::testcase_dir, ls_name }));
+
+
// Copy/Move with wrong case in path.
+
webdav_copy(path[case_], cp_dst, STATUS_CREATED);
+
webdav_move(path[case_], mv_dst, ([]), STATUS_CREATED);
+
webdav_ls(this::testcase_dir, ({ this::testcase_dir, cp_dst, mv_dst }));
+
+
// Cleanup for next round.
+
webdav_delete(cp_dst, ([]), STATUS_NO_CONTENT);
+
webdav_delete(mv_dst, ([]), STATUS_NO_CONTENT);
+
+
// Delete with wrong case in path.
+
webdav_put(put_path, "My content", STATUS_CREATED);
+
webdav_ls(this::testcase_dir, ({ this::testcase_dir, ls_name }));
+
webdav_delete(path[case_], ([]), STATUS_NO_CONTENT);
+
+
// Assert testcase dir is empty.
+
webdav_ls(this::testcase_dir, ({ this::testcase_dir }));
+
}
+
}
+
}
+
}
+
}
+
public void test_x_lock() // Test cannot do mkcol on a locked non existing resource without lock. // Test cannot put on a locked non existing resource without lock. // Test cannot put on locked existing resource without lock. // Test cannot delete locked existing resource without lock. // Test can put on locked existing resource if we have the lock. // Test can delete locked existing resource if we have the lock. // Test lock handling is case insensitive on case insensitive systems. // // We satisfy with taking a lock on a resource with mixed case and later