Skip to content

Commit 684d519

Browse files
committed
create a volume for solid server directory
1 parent 631ddb7 commit 684d519

2 files changed

Lines changed: 49 additions & 0 deletions

File tree

src/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ ENV SOLID_SSL_CERT=${SOLID_HOME}/${TEMPORARY_CERT_NAME}.crt
2323
ENV SOLID_PORT=8443
2424
ENV DEBUG=solid:*
2525

26+
VOLUME $SOLID_HOME
27+
2628
ENTRYPOINT ["./entrypoint.sh"]
2729

2830
CMD ["start"]

test/test_volumes.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import docker
2+
import pytest
3+
import time
4+
5+
testinfra_hosts = ['docker://test_container']
6+
7+
@pytest.fixture(scope="module", autouse=True)
8+
def solid_server(client, image):
9+
container = client.containers.run(
10+
image.id,
11+
name="solid_server",
12+
detach=True,
13+
tty=True
14+
)
15+
# give the solid process some seconds to create the directory structure before making assertions
16+
time.sleep(2)
17+
yield container
18+
container.remove(force=True)
19+
20+
@pytest.fixture(scope="module", autouse=True)
21+
def container(client, solid_server):
22+
container = client.containers.run(
23+
'alpine',
24+
name="test_container",
25+
detach=True,
26+
tty=True,
27+
volumes_from=solid_server.id
28+
)
29+
# give the solid process some seconds to create the directory structure before making assertions
30+
time.sleep(2)
31+
yield container
32+
container.remove(force=True)
33+
34+
def test_solid_data_dir_is_mounted(host):
35+
solid_data = host.file("/opt/solid/data/")
36+
assert solid_data.exists
37+
assert solid_data.is_directory
38+
39+
def test_solid_db_dir_is_mounted(host):
40+
solid_db = host.file("/opt/solid/.db/")
41+
assert solid_db.exists
42+
assert solid_db.is_directory
43+
44+
def test_solid_config_dir_is_mounted(host):
45+
solid_config = host.file("/opt/solid/config/")
46+
assert solid_config.exists
47+
assert solid_config.is_directory

0 commit comments

Comments
 (0)