Working cycle, just needs tests

This commit is contained in:
Olivier 'reivilibre' 2021-07-20 10:59:59 +01:00
parent e0841aa24c
commit 0e908aa582
3 changed files with 14 additions and 4 deletions

View File

@ -1,3 +1,4 @@
import subprocess
import time
from pathlib import Path
from random import Random
@ -10,7 +11,7 @@ from helpers.yama_helpers import set_up_simple_yama
class TestBackupAndExtract(TestCase):
def test_backup_one_full(self):
def test_backup_one_full_no_labelling(self):
td = TemporaryDirectory("test_backup_one_full")
tdpath = Path(td.name)
@ -27,4 +28,11 @@ class TestBackupAndExtract(TestCase):
rng.seed(seed)
generate_random_dir(rng, src_path, 64)
time.sleep(600)
print("storing")
subprocess.check_call(("datman", "backup-one", "srca", "main"), cwd=datman_path)
print("extracting")
dest_path = tdpath.joinpath("desta")
subprocess.check_call(("datman", "extract", "--skip-metadata", "--accept-partial", "main", "../desta"), cwd=datman_path)
time.sleep(300)

View File

@ -3,7 +3,7 @@ from pathlib import Path
def get_hostname():
return subprocess.check_output("hostname").strip()
return subprocess.check_output("hostname").strip().decode()
def set_up_simple_datman(path: Path):

View File

@ -1,3 +1,4 @@
import shutil
import subprocess
from pathlib import Path
@ -5,3 +6,4 @@ from pathlib import Path
def set_up_simple_yama(path: Path):
path.mkdir(exist_ok=True)
subprocess.check_call(("yama", "init"), cwd=path)
shutil.copyfile("../example_zstd.dict", path.joinpath("important_zstd.dict"))