From fc3c6f5294a8782693d097e2ad182695597977a7 Mon Sep 17 00:00:00 2001 From: AnthonyLaw Date: Sat, 9 Nov 2024 01:47:12 +0800 Subject: [PATCH] [tools/shoestring]: Added light in create subdirectories method --- tools/shoestring/shoestring/internal/Preparer.py | 4 ++++ tools/shoestring/tests/internal/test_Preparer.py | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/tools/shoestring/shoestring/internal/Preparer.py b/tools/shoestring/shoestring/internal/Preparer.py index 94d7f577a..d1e490100 100644 --- a/tools/shoestring/shoestring/internal/Preparer.py +++ b/tools/shoestring/shoestring/internal/Preparer.py @@ -169,6 +169,10 @@ def create_subdirectories(self): if self.config.node.api_https: directories.append(self.directories.https_proxy) + if NodeFeatures.LIGHT in self.config.node.features: + if self.config.node.api_https: + directories.append(self.directories.https_proxy) + if NodeFeatures.VOTER in self.config.node.features: directories.append(self.directories.voting_keys) diff --git a/tools/shoestring/tests/internal/test_Preparer.py b/tools/shoestring/tests/internal/test_Preparer.py index 438507f2e..f471f7cfc 100644 --- a/tools/shoestring/tests/internal/test_Preparer.py +++ b/tools/shoestring/tests/internal/test_Preparer.py @@ -145,6 +145,17 @@ def test_can_create_subdirectories_api_node_without_https(self): 'data', 'dbdata', 'keys', 'keys/cert', 'logs', 'rest-cache', 'userconfig', 'userconfig/resources' ]) + def test_can_create_subdirectories_light_node_with_https(self): + self._assert_can_create_subdirectories(NodeFeatures.LIGHT, [ + 'data', 'https-proxy', 'keys', 'keys/cert', 'logs', 'userconfig', 'userconfig/resources' + ]) + + def test_can_create_subdirectories_light_node_without_https(self): + config = self._create_configuration(NodeFeatures.LIGHT, api_https=False) + self._assert_can_create_subdirectories_configuration(config, [ + 'data', 'keys', 'keys/cert', 'logs', 'userconfig', 'userconfig/resources' + ]) + def test_can_create_subdirectories_harvester_node(self): self._assert_can_create_subdirectories(NodeFeatures.HARVESTER, [ 'data', 'keys', 'keys/cert', 'logs', 'userconfig', 'userconfig/resources' @@ -160,6 +171,11 @@ def test_can_create_subdirectories_full_node(self): 'data', 'dbdata', 'https-proxy', 'keys', 'keys/cert', 'keys/voting', 'logs', 'rest-cache', 'userconfig', 'userconfig/resources' ]) + def test_can_create_subdirectories_full_light_node(self): + self._assert_can_create_subdirectories(NodeFeatures.LIGHT | NodeFeatures.HARVESTER | NodeFeatures.VOTER, [ + 'data', 'https-proxy', 'keys', 'keys/cert', 'keys/voting', 'logs', 'userconfig', 'userconfig/resources' + ]) + # endregion # region prepare_seed