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
Pipeline #38019 failed with stage
in 0 seconds
......@@ -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,19 +139,21 @@ class TestFileServer(SlapOSInstanceTestCase):
self.assertEqual(resp.status_code, requests.codes.unauthorized)
def test_upload_file(self):
resp = requests.put(
urllib.parse.urljoin(self.connection_parameters['upload-url'], 'hello.txt'),
data=io.BytesIO(b'hello'),
verify=self.ca_cert,
)
self.assertEqual(resp.status_code, requests.codes.created)
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'], 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'),
verify=self.ca_cert,
)
self.assertEqual(resp.text, 'hello')
self.assertEqual(resp.status_code, requests.codes.ok)
resp = requests.get(
urllib.parse.urljoin(self.connection_parameters['upload-url'], path),
verify=self.ca_cert,
)
self.assertEqual(resp.text, 'hello')
self.assertEqual(resp.status_code, requests.codes.ok)
def test_renew_certificate(self):
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