-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The inih ini_parse_stream function will call the handler multiple times when a value in spread across multiple lines. Previously, this caused the custom handler to override the value - implementing a last one wins method. This has been changed to append the value instead. It now also uses a temporary config for collecting settings from all files and merging it with the previous one. An integration test has also been added. Signed-off-by: Michael Engel <[email protected]>
- Loading branch information
Showing
10 changed files
with
138 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
summary: Test if hirte can properly parse a very long setting value spread across multiple lines, e.g. for the allowed node names |
26 changes: 26 additions & 0 deletions
26
tests/tests/tier0/hirte-long-multiline-config-setting/test_long_multiline_config_setting.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
import pytest | ||
from typing import Dict | ||
|
||
from hirte_test.test import HirteTest | ||
from hirte_test.container import HirteControllerContainer, HirteNodeContainer | ||
from hirte_test.config import HirteControllerConfig | ||
|
||
|
||
def startup_verify(ctrl: HirteControllerContainer, _: Dict[str, HirteNodeContainer]): | ||
result, output = ctrl.exec_run('systemctl is-active hirte') | ||
|
||
assert result == 0 | ||
assert output == 'active' | ||
|
||
|
||
@pytest.mark.timeout(5) | ||
def test_long_multiline_config_setting(hirte_test: HirteTest, hirte_ctrl_default_config: HirteControllerConfig): | ||
config = hirte_ctrl_default_config.deep_copy() | ||
for i in range(150): | ||
config.allowed_node_names.append(f"node-{i}") | ||
|
||
hirte_test.set_hirte_controller_config(hirte_ctrl_default_config) | ||
|
||
hirte_test.run(startup_verify) |