mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
Merge pull request #894 from pimutils/optimise-test-servers
Move test server dockerfiles out-of-repo
This commit is contained in:
commit
2336076baf
9 changed files with 21 additions and 54 deletions
6
.gitmodules
vendored
6
.gitmodules
vendored
|
|
@ -1,6 +0,0 @@
|
||||||
[submodule "tests/storage/servers/owncloud"]
|
|
||||||
path = tests/storage/servers/owncloud
|
|
||||||
url = https://github.com/vdirsyncer/owncloud-testserver
|
|
||||||
[submodule "tests/storage/servers/nextcloud"]
|
|
||||||
path = tests/storage/servers/nextcloud
|
|
||||||
url = https://github.com/vdirsyncer/nextcloud-testserver
|
|
||||||
3
Makefile
3
Makefile
|
|
@ -63,9 +63,6 @@ all:
|
||||||
install-servers:
|
install-servers:
|
||||||
set -ex; \
|
set -ex; \
|
||||||
for server in $(DAV_SERVER); do \
|
for server in $(DAV_SERVER); do \
|
||||||
if [ ! "$$(ls $(TESTSERVER_BASE)$$server/)" ]; then \
|
|
||||||
git submodule update --init -- "$(TESTSERVER_BASE)$$server"; \
|
|
||||||
fi; \
|
|
||||||
(cd $(TESTSERVER_BASE)$$server && sh install.sh); \
|
(cd $(TESTSERVER_BASE)$$server && sh install.sh); \
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
FROM python:3.8
|
|
||||||
|
|
||||||
RUN pip install radicale
|
|
||||||
|
|
||||||
CMD radicale --storage-filesystem-folder /tmp/dav -H 0.0.0.0:8001 -D
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
# Original file copyright 2017 Jelmer Vernooij
|
|
||||||
|
|
||||||
FROM ubuntu:bionic
|
|
||||||
RUN apt-get update && apt-get -y install xandikos locales
|
|
||||||
EXPOSE 8000
|
|
||||||
|
|
||||||
RUN locale-gen en_US.UTF-8
|
|
||||||
ENV PYTHONIOENCODING=utf-8
|
|
||||||
ENV LANG en_US.UTF-8
|
|
||||||
ENV LANGUAGE en_US:en
|
|
||||||
ENV LC_ALL en_US.UTF-8
|
|
||||||
|
|
||||||
CMD xandikos -d /tmp/dav -l 0.0.0.0 -p 8000 --autocreate
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit a27144ddcf39a3283179a4f7ce1ab22b2e810205
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit bb4fcc6f524467d58c95f1dcec8470fdfcd65adf
|
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
cd $(git rev-parse --show-toplevel)
|
docker run -d -p 8001:8001 whynothugo/vdirsyncer-devkit-radicale
|
||||||
|
|
||||||
docker build -t radicale docker/radicale
|
|
||||||
docker run -d -p 8001:8001 radicale
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
cd $(git rev-parse --show-toplevel)
|
docker run -d -p 8000:8000 whynothugo/vdirsyncer-devkit-xandikos
|
||||||
|
|
||||||
docker build -t xandikos docker/xandikos
|
|
||||||
docker run -d -p 8000:8000 xandikos
|
|
||||||
|
|
|
||||||
|
|
@ -46,38 +46,40 @@ class TestFilesystemStorage(StorageTests):
|
||||||
|
|
||||||
def test_ignore_tmp_files(self, tmpdir):
|
def test_ignore_tmp_files(self, tmpdir):
|
||||||
"""Test that files with .tmp suffix beside .ics files are ignored."""
|
"""Test that files with .tmp suffix beside .ics files are ignored."""
|
||||||
s = self.storage_class(str(tmpdir), '.ics')
|
s = self.storage_class(str(tmpdir), ".ics")
|
||||||
s.upload(Item('UID:xyzxyz'))
|
s.upload(Item("UID:xyzxyz"))
|
||||||
item_file, = tmpdir.listdir()
|
(item_file,) = tmpdir.listdir()
|
||||||
item_file.copy(item_file.new(ext='tmp'))
|
item_file.copy(item_file.new(ext="tmp"))
|
||||||
assert len(tmpdir.listdir()) == 2
|
assert len(tmpdir.listdir()) == 2
|
||||||
assert len(list(s.list())) == 1
|
assert len(list(s.list())) == 1
|
||||||
|
|
||||||
def test_ignore_tmp_files_empty_fileext(self, tmpdir):
|
def test_ignore_tmp_files_empty_fileext(self, tmpdir):
|
||||||
"""Test that files with .tmp suffix are ignored with empty fileext."""
|
"""Test that files with .tmp suffix are ignored with empty fileext."""
|
||||||
s = self.storage_class(str(tmpdir), '')
|
s = self.storage_class(str(tmpdir), "")
|
||||||
s.upload(Item('UID:xyzxyz'))
|
s.upload(Item("UID:xyzxyz"))
|
||||||
item_file, = tmpdir.listdir()
|
(item_file,) = tmpdir.listdir()
|
||||||
item_file.copy(item_file.new(ext='tmp'))
|
item_file.copy(item_file.new(ext="tmp"))
|
||||||
assert len(tmpdir.listdir()) == 2
|
assert len(tmpdir.listdir()) == 2
|
||||||
# assert False, tmpdir.listdir() # enable to see the created filename
|
# assert False, tmpdir.listdir() # enable to see the created filename
|
||||||
assert len(list(s.list())) == 1
|
assert len(list(s.list())) == 1
|
||||||
|
|
||||||
def test_ignore_files_typical_backup(self, tmpdir):
|
def test_ignore_files_typical_backup(self, tmpdir):
|
||||||
"""Test file-name ignorance with typical backup ending ~."""
|
"""Test file-name ignorance with typical backup ending ~."""
|
||||||
ignorext = "~" # without dot
|
ignorext = "~" # without dot
|
||||||
s = self.storage_class(str(tmpdir), '', fileignoreext="~")
|
|
||||||
s.upload(Item('UID:xyzxyz'))
|
storage = self.storage_class(str(tmpdir), "", fileignoreext=ignorext)
|
||||||
item_file, = tmpdir.listdir()
|
storage.upload(Item("UID:xyzxyz"))
|
||||||
item_file.copy(item_file.new(basename=item_file.basename+'~'))
|
(item_file,) = tmpdir.listdir()
|
||||||
|
item_file.copy(item_file.new(basename=item_file.basename + ignorext))
|
||||||
|
|
||||||
assert len(tmpdir.listdir()) == 2
|
assert len(tmpdir.listdir()) == 2
|
||||||
#assert False, tmpdir.listdir() # enable to see the created filename
|
assert len(list(storage.list())) == 1
|
||||||
assert len(list(s.list())) == 1
|
|
||||||
|
|
||||||
def test_too_long_uid(self, tmpdir):
|
def test_too_long_uid(self, tmpdir):
|
||||||
s = self.storage_class(str(tmpdir), ".txt")
|
storage = self.storage_class(str(tmpdir), ".txt")
|
||||||
item = Item("UID:" + "hue" * 600)
|
item = Item("UID:" + "hue" * 600)
|
||||||
href, etag = s.upload(item)
|
|
||||||
|
href, etag = storage.upload(item)
|
||||||
assert item.uid not in href
|
assert item.uid not in href
|
||||||
|
|
||||||
def test_post_hook_inactive(self, tmpdir, monkeypatch):
|
def test_post_hook_inactive(self, tmpdir, monkeypatch):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue