summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2013-01-09 14:57:17 +0100
committerOndrej Holy <oholy@redhat.com>2022-06-08 08:34:05 +0200
commitcde806846bf6afb5979b1d588ea00be2cacb4673 (patch)
tree526bbf56d369fd8b8ce1115e2d936cced8ece76d
parentac82784308f98df281455c25ca88b452f5b2cc84 (diff)
downloadgvfs-wip/oholy/dav-redirect.tar.gz
test: Add test case for Dav not handling redirectionswip/oholy/dav-redirect
Updated to master by Ondrej Holy <oholy@redhat.com>. https://gitlab.gnome.org/GNOME/gvfs/issues/177
-rwxr-xr-xtest/gvfs-test32
1 files changed, 31 insertions, 1 deletions
diff --git a/test/gvfs-test b/test/gvfs-test
index 8beb7266..8839baf2 100755
--- a/test/gvfs-test
+++ b/test/gvfs-test
@@ -1386,7 +1386,7 @@ class Dav(GvfsTestCase):
# some distros have some extra modules which we need to load
modules = ''
- for m in ['authn_core', 'authz_core', 'authz_user', 'auth_basic',
+ for m in ['alias', 'authn_core', 'authz_core', 'authz_user', 'auth_basic',
'authn_file', 'mpm_prefork', 'unixd', 'dav', 'dav_fs', 'ssl']:
if os.path.exists(os.path.join(klass.mod_dir, 'mod_%s.so' % m)):
modules += 'LoadModule %s_module %s/mod_%s.so\n' % (m, klass.mod_dir, m)
@@ -1420,6 +1420,11 @@ DAVLockDB DAVLock
AuthUserFile htpasswd
Require valid-user
</Directory>
+
+Redirect temp /public_tmpredir /public
+Redirect permanent /public_permredir /public
+Redirect temp /secret_tmpredir /secret
+Redirect permanent /secret_permredir /secret
''' % {'mod_dir': klass.mod_dir, 'root': klass.httpd_sandbox, 'modules': modules, 'mydir': my_dir})
# start server
@@ -1489,6 +1494,14 @@ DAVLockDB DAVLock
subprocess.check_call(['gio', 'mount', uri])
self.do_mount_check(uri, 'hello.txt', 'hi\n')
+ def test_http_noauth_redirect(self):
+ '''dav://localhost without credentials and server redirection'''
+
+ for d in ['public_permredir', 'public_tmpredir']:
+ uri = 'dav://localhost:8088/' + d
+ subprocess.check_call(['gio', 'mount', uri])
+ self.do_mount_check(uri, 'hello.txt', 'hi\n')
+
def test_https_noauth(self):
'''davs://localhost without credentials'''
@@ -1527,6 +1540,23 @@ DAVLockDB DAVLock
self.do_mount_check(uri, 'restricted.txt', 'dont tell anyone\n')
+ def test_http_auth_redirect(self):
+ '''dav://localhost with credentials and server redirection'''
+
+ for d in ['secret_tmpredir', 'secret_permredir']:
+ uri = 'dav://localhost:8088/' + d
+
+ mount = subprocess.Popen(['gio', 'mount', uri],
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+
+ (out, err) = mount.communicate(b's3kr1t\n')
+ self.assertEqual(mount.returncode, 0)
+ self.assertEqual(err, b'')
+
+ self.do_mount_check(uri, 'restricted.txt', 'dont tell anyone\n')
+
def test_https_auth(self):
'''davs://localhost with credentials'''