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 @@ ...@@ -15,4 +15,4 @@
[instance.cfg.in] [instance.cfg.in]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = c1c5db680dee5cfe5334cedae4b7fc51 md5sum = 765bb15f322f5566a66d15baa8c68f9a
...@@ -159,7 +159,7 @@ command-line = ...@@ -159,7 +159,7 @@ command-line =
--render-try-index --render-try-index
--allow-all --allow-all
--auth-method basic --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 --auth @/pub
--tls-cert ${dufs-certificate:cert-file} --tls-cert ${dufs-certificate:cert-file}
--tls-key ${dufs-certificate:key-file} --tls-key ${dufs-certificate:key-file}
......
...@@ -139,19 +139,21 @@ class TestFileServer(SlapOSInstanceTestCase): ...@@ -139,19 +139,21 @@ class TestFileServer(SlapOSInstanceTestCase):
self.assertEqual(resp.status_code, requests.codes.unauthorized) self.assertEqual(resp.status_code, requests.codes.unauthorized)
def test_upload_file(self): def test_upload_file(self):
resp = requests.put( for path in 'hello.txt', 'pub/hello.txt', 'create/intermediate/paths':
urllib.parse.urljoin(self.connection_parameters['upload-url'], 'hello.txt'), with self.subTest(path):
data=io.BytesIO(b'hello'), resp = requests.put(
verify=self.ca_cert, urllib.parse.urljoin(self.connection_parameters['upload-url'], path),
) data=io.BytesIO(b'hello'),
self.assertEqual(resp.status_code, requests.codes.created) verify=self.ca_cert,
)
self.assertEqual(resp.status_code, requests.codes.created)
resp = requests.get( 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, verify=self.ca_cert,
) )
self.assertEqual(resp.text, 'hello') self.assertEqual(resp.text, 'hello')
self.assertEqual(resp.status_code, requests.codes.ok) self.assertEqual(resp.status_code, requests.codes.ok)
def test_renew_certificate(self): def test_renew_certificate(self):
def _getpeercert(): def _getpeercert():
......
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