Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gtest: list handling of the config parser
Tests if the varios types of config directives correctly read multiple values. Also document the limitations of the CFG_TYPE_STR type: When a CFG_TYPE_STR config directive is used, only the first entry from the last directive is used. All other entry are silently ignored.
- Loading branch information
1 parent
69eb8f0
commit fba1195
Showing
9 changed files
with
320 additions
and
0 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
core/src/tests/configs/bareos-configparser-tests/bareos-dir-CFG_TYPE_ALIST_RES.conf
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,46 @@ | ||
Director { | ||
Name = "bareos-dir" | ||
Password = "secret" | ||
} | ||
|
||
Job { | ||
Name = "job01" | ||
} | ||
|
||
Job { | ||
Name = "job02" | ||
} | ||
|
||
Job { | ||
Name = "job11" | ||
} | ||
|
||
Job { | ||
Name = "job12" | ||
} | ||
|
||
Job { | ||
Name = "job21" | ||
} | ||
|
||
Job { | ||
Name = "job22" | ||
} | ||
|
||
Job { | ||
Name = "job31" | ||
} | ||
|
||
Job { | ||
Name = "job32" | ||
} | ||
|
||
|
||
Job { | ||
Name = "resultjob" | ||
|
||
Base = job01,job02 # 2 entries | ||
Base = job11, job12 # 2 entries | ||
Base = job21, "job22" # 2 entries | ||
Base = "job31", "job32" # 2 entries | ||
} |
32 changes: 32 additions & 0 deletions
32
core/src/tests/configs/bareos-configparser-tests/bareos-dir-CFG_TYPE_ALIST_STR.conf
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,32 @@ | ||
Director { | ||
Name = "bareos-dir" | ||
Password = "secret" | ||
} | ||
|
||
Job { | ||
Name = "job1" | ||
|
||
Run = item01,item02 # 2 entries | ||
Run = item11, item12 # 2 entries | ||
Run = item21, "item22" # 2 entries | ||
Run = "item31", "item32" # 2 entries | ||
} | ||
|
||
JobDefs { | ||
Name = "jobdefs2" | ||
|
||
Run = jobdef01,jobdef02 # 2 entries | ||
Run = jobdef11, jobdef12 # 2 entries | ||
Run = jobdef21, "jobdef22" # 2 entries | ||
Run = "jobdef31", "jobdef32" # 2 entries | ||
} | ||
|
||
Job { | ||
Name = "job2" | ||
JobDefs = "jobdefs2" | ||
|
||
Run = item01,item02 # 2 entries | ||
Run = item11, item12 # 2 entries | ||
Run = item21, "item22" # 2 entries | ||
Run = "item31", "item32" # 2 entries | ||
} |
9 changes: 9 additions & 0 deletions
9
core/src/tests/configs/bareos-configparser-tests/bareos-dir-CFG_TYPE_AUDIT.conf
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,9 @@ | ||
Director { | ||
Name = "bareos-dir" | ||
Password = "secret" | ||
|
||
AuditEvents = item01,item02 # 2 entries | ||
AuditEvents = item11, item12 # 2 entries | ||
AuditEvents = item21, "item22" # 2 entries | ||
AuditEvents = "item31", "item32" # 2 entries | ||
} |
37 changes: 37 additions & 0 deletions
37
core/src/tests/configs/bareos-configparser-tests/bareos-dir-CFG_TYPE_FNAME.conf
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,37 @@ | ||
Director { | ||
Name = "bareos-dir" | ||
Password = "secret" | ||
} | ||
|
||
FileSet { | ||
Name = "fileset1" | ||
Description = "test fileset" | ||
Include { | ||
Options { | ||
Signature = "MD5" | ||
} | ||
File = /tmp/dir1 | ||
File = "/tmp/dir2" | ||
|
||
File = <includefile-server1 | ||
File = "<includefile-server2" | ||
|
||
File = |command-server1 | ||
File = "|command-server2" | ||
|
||
# File = \<includefile-client1 # parse error | ||
# File = \\<includefile-client2 # parse error | ||
# File = "\<includefile-client3" # backslash will be removed | ||
File = "\\<includefile-client4" | ||
|
||
# File = \|command-client1 # parse error | ||
# File = \\|command-client2 # parse error | ||
# File = "\|command-client3" # backslash will be removed | ||
File = "\\|command-client4" | ||
|
||
File = "\<includefile-server1" | ||
File = "\<includefile-server2" | ||
File = "\\\<includefile-client4" | ||
File = "\\|command-client4" | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
core/src/tests/configs/bareos-configparser-tests/bareos-dir-CFG_TYPE_PLUGIN_NAMES.conf
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,11 @@ | ||
Director { | ||
Name = "bareos-dir" | ||
Password = "secret" | ||
|
||
PluginNames = plugin11, plugin12 # 2 entries | ||
PluginNames = "plugin21", "plugin22" # 2 entries | ||
PluginNames = "plugin31:plugin32" # 2 entries | ||
PluginNames = plugin41:plugin42, plugin43, plugin44 # 4 entries | ||
PluginNames = plugin51:plugin52, "plugin53:plugin54", plugin55, plugin56 # 6 entries | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
core/src/tests/configs/bareos-configparser-tests/bareos-dir-CFG_TYPE_STR.conf
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,9 @@ | ||
Director { | ||
Name = "bareos-dir" | ||
Password = "secret" | ||
|
||
Description = item01,item02 # 2 entries | ||
Description = item11, item12 # 2 entries | ||
Description = item21, "item22" # 2 entries | ||
Description = "item31", "item32" # 2 entries | ||
} |
9 changes: 9 additions & 0 deletions
9
core/src/tests/configs/bareos-configparser-tests/bareos-dir-CFG_TYPE_STR_VECTOR.conf
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,9 @@ | ||
Director { | ||
Name = "bareos-dir" | ||
Password = "secret" | ||
|
||
TlsAllowedCn = cn01,cn02 # 2 entries | ||
TlsAllowedCn = cn11, cn12 # 2 entries | ||
TlsAllowedCn = cn21, "cn22" # 2 entries | ||
TlsAllowedCn = "cn31", "cn32" # 2 entries | ||
} |
10 changes: 10 additions & 0 deletions
10
...rc/tests/configs/bareos-configparser-tests/bareos-dir-CFG_TYPE_STR_VECTOR_OF_DIRS.conf.in
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,10 @@ | ||
Director { | ||
Name = "bareos-dir" | ||
Password = "secret" | ||
|
||
BackendDirectory = @PATH_BAREOS_BACKENDDIR@ # default value, 1 entry | ||
BackendDirectory = item01,item02 # 2 entries | ||
BackendDirectory = item11, item12 # 2 entries | ||
BackendDirectory = item21, "item22" # 2 entries | ||
BackendDirectory = "item31", "item32" # 2 entries | ||
} |
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