forked from infiniflow/infinity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add configuration file unit test (infiniflow#1715)
### What problem does this PR solve? Add test cases to unit tests for configuration files, including: 1. Invalid configuration fields. 2. Invalid value. 3. Out of bound value. 4. Correct value ### Type of change - [x] Test cases --------- Co-authored-by: Jin Hai <[email protected]>
- Loading branch information
Showing
14 changed files
with
754 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
[general] | ||
version = "0.3.0" | ||
time_zone = "utc-8" | ||
|
||
[network] | ||
server_address = "0.0.0.0" | ||
postgres_port = 5432 | ||
http_port = 23820 | ||
client_port = 23817 | ||
connection_pool_size = 128 | ||
|
||
[log] | ||
log_filename = "infinity.log" | ||
log_dir = "/var/infinity/log" | ||
log_to_stdout = false | ||
log_file_max_size = "10GB" | ||
log_file_rotate_count = 10 | ||
|
||
log_level = "info" | ||
|
||
[storage] | ||
data_dir = "/var/infinity/data" | ||
|
||
optimize_interval = "10s" | ||
cleanup_interval = "60s" | ||
compact_interval = "120s" | ||
|
||
mem_index_capacity = 1048576 | ||
|
||
[buffer] | ||
buffer_manager_size = "1TB" # Changed to "1TB" | ||
lru_num = 7 | ||
temp_dir = "/var/infinity/tmp" | ||
|
||
memindex_memory_quota = "1GB" | ||
|
||
[wal] | ||
wal_dir = "/var/infinity/wal" | ||
full_checkpoint_interval = "86400s" | ||
delta_checkpoint_interval = "60s" | ||
wal_compact_threshold = "1GB" | ||
|
||
wal_flush = "only_write" | ||
|
||
[resource] | ||
resource_dir = "/var/infinity/resource" | ||
|
||
[persistence] | ||
persistence_dir = "/var/infinity/persistence" |
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,49 @@ | ||
[general] | ||
version = "0.3.0" | ||
time_zone = "utc-8" | ||
|
||
[network] | ||
server_address = "0.0.0.0" | ||
postgres_port = 5432 | ||
http_port = 23820 | ||
client_port = 23817 | ||
connection_pool_size = 128 | ||
|
||
[log] | ||
log_filename = "infinity.log" | ||
log_dir = "/var/infinity/log" | ||
log_to_stdout = false | ||
log_file_max_size = "10GB" | ||
log_file_rotate_count = 10 | ||
|
||
log_level = "invalid_level" # Changed to "invalid_level" | ||
|
||
[storage] | ||
data_dir = "/var/infinity/data" | ||
|
||
optimize_interval = "10s" | ||
cleanup_interval = "60s" | ||
compact_interval = "120s" | ||
|
||
mem_index_capacity = 1048576 | ||
|
||
[buffer] | ||
buffer_manager_size = "4GB" | ||
lru_num = 7 | ||
temp_dir = "/var/infinity/tmp" | ||
|
||
memindex_memory_quota = "1GB" | ||
|
||
[wal] | ||
wal_dir = "/var/infinity/wal" | ||
full_checkpoint_interval = "86400s" | ||
delta_checkpoint_interval = "60s" | ||
wal_compact_threshold = "1GB" | ||
|
||
wal_flush = "only_write" | ||
|
||
[resource] | ||
resource_dir = "/var/infinity/resource" | ||
|
||
[persistence] | ||
persistence_dir = "/var/infinity/persistence" |
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,41 @@ | ||
# testing invalid items in config | ||
# result should be same as default | ||
[ygenera1] | ||
versi0n = "0.4.0" | ||
time_z0ne = "utc-123" | ||
cpu_1imit = 123 | ||
|
||
# right list name, but arguments all wrong | ||
[network] | ||
5erver_address = "127.wrong.0.0.1" | ||
postgre5_port = 254333 | ||
http_p0rt = 24123 | ||
client_p0rt = 1234 | ||
connection_p00l_size = 144 | ||
|
||
# wrong list name, right arguments | ||
[l0g] | ||
log_filename = "info.logwrong" | ||
log_dir = "/var/infinity/logwrong" | ||
log_to_stdout = true | ||
log_file_max_size = "2GB" | ||
log_file_rotate_count = 101 | ||
log_1evel = "tracewrong" | ||
|
||
[st0rage] | ||
data_dir = "/var/infinity/datawrong" | ||
|
||
[bufferrrr] | ||
buffer_mAnager_size = "50GB" | ||
1ru_num = 100 | ||
temp_dIIIr = "/tmpwrong" | ||
memindex_mem0ry_quota = "1GB" | ||
|
||
[wal] | ||
wa1_dir = "/var/infinity/wawrong" | ||
|
||
[resourCEEe] | ||
resource_dffir = "/var/infinity/resourcewrong" | ||
|
||
[persistence] | ||
persistence_dirrr = "/var/infinity/persistencewrong" |
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,49 @@ | ||
[general] | ||
version = "0.3.0" | ||
time_zone = "utc-8" | ||
|
||
[network] | ||
server_address = "999.999.999.999" # Changed to an invalid IP address | ||
postgres_port = 5432 | ||
http_port = 23820 | ||
client_port = 23817 | ||
connection_pool_size = 128 | ||
|
||
[log] | ||
log_filename = "infinity.log" | ||
log_dir = "/var/infinity/log" | ||
log_to_stdout = false | ||
log_file_max_size = "10GB" | ||
log_file_rotate_count = 10 | ||
|
||
log_level = "info" | ||
|
||
[storage] | ||
data_dir = "/var/infinity/data" | ||
|
||
optimize_interval = "10s" | ||
cleanup_interval = "60s" | ||
compact_interval = "120s" | ||
|
||
mem_index_capacity = 1048576 | ||
|
||
[buffer] | ||
buffer_manager_size = "4GB" | ||
lru_num = 7 | ||
temp_dir = "/var/infinity/tmp" | ||
|
||
memindex_memory_quota = "1GB" | ||
|
||
[wal] | ||
wal_dir = "/var/infinity/wal" | ||
full_checkpoint_interval = "86400s" | ||
delta_checkpoint_interval = "60s" | ||
wal_compact_threshold = "1GB" | ||
|
||
wal_flush = "only_write" | ||
|
||
[resource] | ||
resource_dir = "/var/infinity/resource" | ||
|
||
[persistence] | ||
persistence_dir = "/var/infinity/persistence" |
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,49 @@ | ||
[general] | ||
version = "0.3.0" | ||
time_zone = "utc-8" | ||
|
||
[network] | ||
server_address = "0.0.0.0" | ||
postgres_port = 5432 | ||
http_port = 23820 | ||
client_port = 23817 | ||
connection_pool_size = 128 | ||
|
||
[log] | ||
log_filename = "infinity.log" | ||
log_dir = "/var/infinity/log" | ||
log_to_stdout = false | ||
log_file_max_size = "10GB" | ||
log_file_rotate_count = 10 | ||
|
||
log_level = "info" | ||
|
||
[storage] | ||
data_dir = "/var/infinity/data" | ||
|
||
optimize_interval = "1day" # Changed to "1day" | ||
cleanup_interval = "60s" | ||
compact_interval = "120s" | ||
|
||
mem_index_capacity = 1048576 | ||
|
||
[buffer] | ||
buffer_manager_size = "4GB" | ||
lru_num = 7 | ||
temp_dir = "/var/infinity/tmp" | ||
|
||
memindex_memory_quota = "1GB" | ||
|
||
[wal] | ||
wal_dir = "/var/infinity/wal" | ||
full_checkpoint_interval = "86400s" | ||
delta_checkpoint_interval = "60s" | ||
wal_compact_threshold = "1GB" | ||
|
||
wal_flush = "only_write" | ||
|
||
[resource] | ||
resource_dir = "/var/infinity/resource" | ||
|
||
[persistence] | ||
persistence_dir = "/var/infinity/persistence" |
Oops, something went wrong.