Skip to content

Commit

Permalink
[tools/shoestring]: Added light in create subdirectories method
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyLaw committed Nov 8, 2024
1 parent 51609b6 commit fc3c6f5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/shoestring/shoestring/internal/Preparer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
16 changes: 16 additions & 0 deletions tools/shoestring/tests/internal/test_Preparer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand Down

0 comments on commit fc3c6f5

Please sign in to comment.