diff --git a/node_cli/core/schains.py b/node_cli/core/schains.py index 0d888835..ab646b8f 100644 --- a/node_cli/core/schains.py +++ b/node_cli/core/schains.py @@ -251,7 +251,6 @@ def ensure_schain_volume(schain: str, schain_type: str, env_type: str) -> None: def cleanup_sync_datadir(schain_name: str, base_path: str = SCHAINS_MNT_DIR_SYNC) -> None: base_path = os.path.join(base_path, schain_name) - print('HERE', base_path) regular_folders_pattern = f'{base_path}/[!snapshots]*' logger.info('Removing regular folders') for filepath in glob.glob(regular_folders_pattern): diff --git a/tests/core/core_node_test.py b/tests/core/core_node_test.py index c3c3e11d..5bc02f97 100644 --- a/tests/core/core_node_test.py +++ b/tests/core/core_node_test.py @@ -12,7 +12,7 @@ from node_cli.configs import NODE_DATA_PATH from node_cli.configs.resource_allocation import RESOURCE_ALLOCATION_FILEPATH from node_cli.core.node import BASE_CONTAINERS_AMOUNT, is_base_containers_alive -from node_cli.core.node import init, pack_dir, update, is_update_safe +from node_cli.core.node import init, pack_dir, update, is_update_safe, repair_sync from tests.helper import response_mock, safe_update_api_response, subprocess_run_mock from tests.resources_test import BIG_DISK_SIZE @@ -169,7 +169,9 @@ def test_update_node(mocked_g_config, resource_file): ), mock.patch('node_cli.core.resources.get_disk_size', return_value=BIG_DISK_SIZE), mock.patch( 'node_cli.core.host.init_data_dir' ): - with mock.patch('node_cli.utils.helper.requests.get', return_value=safe_update_api_response()): # noqa + with mock.patch( + 'node_cli.utils.helper.requests.get', return_value=safe_update_api_response() + ): # noqa result = update(env_filepath, pull_config_for_schain=None) assert result is None @@ -183,3 +185,10 @@ def test_is_update_safe(): 'node_cli.utils.helper.requests.get', return_value=safe_update_api_response(safe=False) ): assert not is_update_safe() + + +def test_repair_sync(tmp_sync_datadir, mocked_g_config, resource_file): + with mock.patch('node_cli.core.schains.rm_btrfs_subvolume'), \ + mock.patch('node_cli.utils.docker_utils.stop_container'), \ + mock.patch('node_cli.utils.docker_utils.start_container'): + repair_sync(archive=True, catchup=True, historic_state=True, snapshot_from='127.0.0.1')