Commit dc5330c5 authored by Jérome Perrin's avatar Jérome Perrin

software/dufs: fix misconfiguration preventing uploading in /pub

This have been a regression when upgrading to v0.40.0
parent 9e1071da
......@@ -15,4 +15,4 @@
[instance.cfg.in]
filename = instance.cfg.in
md5sum = c1c5db680dee5cfe5334cedae4b7fc51
md5sum = 765bb15f322f5566a66d15baa8c68f9a
......@@ -159,7 +159,7 @@ command-line =
--render-try-index
--allow-all
--auth-method basic
--auth ${admin-password:user}:${admin-password:passwd-sha512-crypt}@/:rw
--auth ${admin-password:user}:${admin-password:passwd-sha512-crypt}@/:rw,/pub:rw
--auth @/pub
--tls-cert ${dufs-certificate:cert-file}
--tls-key ${dufs-certificate:key-file}
......
......@@ -139,15 +139,17 @@ class TestFileServer(SlapOSInstanceTestCase):
self.assertEqual(resp.status_code, requests.codes.unauthorized)
def test_upload_file(self):
for path in 'hello.txt', 'pub/hello.txt', 'create/intermediate/paths':
with self.subTest(path):
resp = requests.put(
urllib.parse.urljoin(self.connection_parameters['upload-url'], 'hello.txt'),
urllib.parse.urljoin(self.connection_parameters['upload-url'], path),
data=io.BytesIO(b'hello'),
verify=self.ca_cert,
)
self.assertEqual(resp.status_code, requests.codes.created)
resp = requests.get(
urllib.parse.urljoin(self.connection_parameters['upload-url'], 'hello.txt'),
urllib.parse.urljoin(self.connection_parameters['upload-url'], path),
verify=self.ca_cert,
)
self.assertEqual(resp.text, 'hello')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment