Signed-off-by: Olivier 'reivilibre <olivier@librepush.net>
This commit is contained in:
parent
761c4f6467
commit
3d7803b0d6
@ -1,6 +1,30 @@
|
|||||||
|
import time
|
||||||
|
from pathlib import Path
|
||||||
|
from random import Random
|
||||||
|
from tempfile import TemporaryDirectory
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
|
|
||||||
|
from helpers import generate_random_dir
|
||||||
|
from helpers.datman_helpers import set_up_simple_datman
|
||||||
|
from helpers.yama_helpers import set_up_simple_yama
|
||||||
|
|
||||||
|
|
||||||
class TestBackupAndExtract(TestCase):
|
class TestBackupAndExtract(TestCase):
|
||||||
def test_backup_one_full(self):
|
def test_backup_one_full(self):
|
||||||
pass
|
td = TemporaryDirectory("test_backup_one_full")
|
||||||
|
tdpath = Path(td.name)
|
||||||
|
|
||||||
|
datman_path = tdpath.joinpath("datman")
|
||||||
|
src_path = datman_path.joinpath("srca")
|
||||||
|
yama_path = datman_path.joinpath("main")
|
||||||
|
|
||||||
|
set_up_simple_datman(datman_path)
|
||||||
|
set_up_simple_yama(yama_path)
|
||||||
|
|
||||||
|
rng = Random()
|
||||||
|
seed = rng.randint(0, 9001)
|
||||||
|
print(f"seed: {seed}")
|
||||||
|
rng.seed(seed)
|
||||||
|
generate_random_dir(rng, src_path, 64)
|
||||||
|
|
||||||
|
time.sleep(600)
|
||||||
|
@ -7,9 +7,10 @@ def get_hostname():
|
|||||||
|
|
||||||
|
|
||||||
def set_up_simple_datman(path: Path):
|
def set_up_simple_datman(path: Path):
|
||||||
|
path.mkdir(exist_ok=True)
|
||||||
subprocess.check_call(("datman", "init"), cwd=path)
|
subprocess.check_call(("datman", "init"), cwd=path)
|
||||||
|
|
||||||
with path.joinpath("").open("a") as file:
|
with path.joinpath("datman.toml").open("a") as file:
|
||||||
file.write(f"""
|
file.write(f"""
|
||||||
[source.srca]
|
[source.srca]
|
||||||
directory = "{path.joinpath("srca")}"
|
directory = "{path.joinpath("srca")}"
|
||||||
|
7
testsuite/helpers/yama_helpers.py
Normal file
7
testsuite/helpers/yama_helpers.py
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import subprocess
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
|
def set_up_simple_yama(path: Path):
|
||||||
|
path.mkdir(exist_ok=True)
|
||||||
|
subprocess.check_call(("yama", "init"), cwd=path)
|
@ -14,7 +14,7 @@ DESCRIPTION = "test suite for yama and datman"
|
|||||||
URL = "https://bics.ga/reivilibre/yama"
|
URL = "https://bics.ga/reivilibre/yama"
|
||||||
EMAIL = "reivi@librepush.net"
|
EMAIL = "reivi@librepush.net"
|
||||||
AUTHOR = "Olivier 'reivilibre'"
|
AUTHOR = "Olivier 'reivilibre'"
|
||||||
REQUIRES_PYTHON = ">=3.8.0"
|
REQUIRES_PYTHON = ">=3.9.0"
|
||||||
VERSION = "0.0.0"
|
VERSION = "0.0.0"
|
||||||
|
|
||||||
# What packages are required for this module to be executed?
|
# What packages are required for this module to be executed?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user