2018-12-18 00:12:19 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
import os
|
2022-10-31 22:32:14 +00:00
|
|
|
import sys
|
2020-10-19 14:31:19 +00:00
|
|
|
from glob import glob
|
2018-12-18 00:12:19 +00:00
|
|
|
|
2019-04-26 14:15:40 +00:00
|
|
|
# conda should still be in /srv/conda
|
|
|
|
# and Python should still be in $NB_PYTHON_PREFIX
|
2019-05-31 09:10:17 +00:00
|
|
|
assert sys.executable == os.path.join(
|
|
|
|
os.environ["NB_PYTHON_PREFIX"], "bin", "python"
|
|
|
|
), sys.executable
|
2019-04-26 14:15:40 +00:00
|
|
|
assert sys.executable.startswith("/srv/conda/"), sys.executable
|
2018-12-18 00:12:19 +00:00
|
|
|
|
|
|
|
# Repo should be in /srv/repo
|
2022-10-09 17:02:23 +00:00
|
|
|
assert os.path.exists("/srv/repo/verify.py")
|
|
|
|
assert os.path.abspath(__file__) == "/srv/repo/verify.py"
|
2019-03-04 16:02:53 +00:00
|
|
|
|
2020-10-20 04:49:09 +00:00
|
|
|
# Repo should be writable
|
|
|
|
assert os.access("/srv/repo", os.W_OK)
|
2020-10-19 14:31:19 +00:00
|
|
|
|
|
|
|
# All files in repo dir should be readable and writeable
|
|
|
|
for path in glob("/src/repo/**/*", recursive=True):
|
|
|
|
assert os.access(path, os.R_OK)
|
|
|
|
assert os.access(path, os.W_OK)
|
|
|
|
|
|
|
|
# Should be able to make a new file
|
|
|
|
with open("/srv/repo/writeable", "w") as fp:
|
|
|
|
fp.write("writeable")
|