-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test that set_variable_values_ini does not error when keys are …
…not present in promised section Ticket: CFE-3866 Changelog: None
- Loading branch information
1 parent
cf7f750
commit 28d6187
Showing
4 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
...acceptance/lib/files/set_variable_values_ini_no_error_when_keys_in_section_not_present.cf
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,35 @@ | ||
####################################################### | ||
# | ||
# Test bundle set_config_values_ini | ||
# | ||
####################################################### | ||
|
||
body common control | ||
{ | ||
inputs => { '../../default.cf.sub' }; | ||
bundlesequence => { default("$(this.promise_filename)") }; | ||
version => "1.0"; | ||
} | ||
|
||
####################################################### | ||
|
||
|
||
bundle agent test | ||
{ | ||
meta: | ||
"description" -> { "CFE-3866" } | ||
string => "Test that set_variable_values_ini does not error when promised key is not present"; | ||
|
||
} | ||
|
||
####################################################### | ||
|
||
bundle agent check | ||
{ | ||
|
||
methods: | ||
|
||
"Pass/FAIL" | ||
usebundle => dcs_passif_output(".*", ".*error.*", "$(sys.cf_agent) -Kf $(this.promise_filename).sub --define AUTO", $(this.promise_filename)); | ||
|
||
} |
70 changes: 70 additions & 0 deletions
70
...ptance/lib/files/set_variable_values_ini_no_error_when_keys_in_section_not_present.cf.sub
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,70 @@ | ||
####################################################### | ||
# | ||
# Test bundle set_config_values_ini | ||
# | ||
####################################################### | ||
|
||
body common control | ||
{ | ||
inputs => { '../../default.cf.sub' }; | ||
bundlesequence => { default("$(this.promise_filename)") }; | ||
version => "1.0"; | ||
} | ||
|
||
####################################################### | ||
|
||
bundle agent init | ||
{ | ||
files: | ||
|
||
"$(G.testfile).actual" | ||
copy_from => local_cp("$(this.promise_filename).start"); | ||
|
||
|
||
"$(G.testfile).expected" | ||
copy_from => local_cp("$(this.promise_filename).finish"); | ||
|
||
} | ||
|
||
####################################################### | ||
|
||
bundle agent test | ||
{ | ||
meta: | ||
"description" -> { "CFE-3866" } | ||
string => "Test that set_variable_values_ini does not error when promised key is not present"; | ||
|
||
vars: | ||
"config[section 1][present_at_start]" string => "1"; | ||
"config[section 1][absent_at_start]" string => "1"; | ||
"config[section 2][present_at_start]" string => "two"; | ||
"sections" slist => getindices( config ); | ||
|
||
files: | ||
|
||
"$(G.testfile).actual" | ||
edit_line => set_variable_values_ini("test.config", "$(sections)"); | ||
|
||
} | ||
|
||
####################################################### | ||
|
||
bundle agent check | ||
{ | ||
|
||
methods: | ||
|
||
"check" | ||
usebundle => dcs_if_diff( "$(G.testfile).actual", "$(G.testfile).expected", | ||
"pass", "_fail"); | ||
|
||
# Fail the test if any of the files fail. | ||
"fail" | ||
usebundle => dcs_fail( $(this.promise_filename) ), | ||
if => "_fail"; | ||
|
||
pass:: | ||
"pass" | ||
usebundle => dcs_pass( $(this.promise_filename) ); | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
...lib/files/set_variable_values_ini_no_error_when_keys_in_section_not_present.cf.sub.finish
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,5 @@ | ||
[section 1] | ||
present_at_start=1 | ||
absent_at_start=1 | ||
[section 2] | ||
present_at_start=two |
4 changes: 4 additions & 0 deletions
4
.../lib/files/set_variable_values_ini_no_error_when_keys_in_section_not_present.cf.sub.start
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,4 @@ | ||
[section 1] | ||
present_at_start=1 | ||
[section 2] | ||
present_at_start=two |