Add test for config framework

This commit is contained in:
Tim Wojtulewicz 2021-04-08 14:07:40 -07:00
parent 04c201393f
commit e5d3d009fc
3 changed files with 28 additions and 0 deletions

View file

@ -0,0 +1,3 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
warning: Value 'asdf' for source 'thread ../configfile/Input::READER_CONFIG' is not a valid enum.
error: SendEvent for event InputConfig::new_value failed

View file

@ -0,0 +1,5 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
{
Red,
Green
}

View file

@ -0,0 +1,20 @@
# @TEST-EXEC: btest-bg-run zeek zeek -b %INPUT
# @TEST-EXEC: btest-bg-wait 10
# @TEST-EXEC: btest-diff zeek/.stderr
# @TEST-EXEC: btest-diff zeek/.stdout
@TEST-START-FILE configfile
mycolors Red,asdf,Blue
@TEST-END-FILE
@load base/frameworks/config
type Color: enum { Red, Green, Blue, };
option mycolors = set(Red, Green);
event zeek_init()
{ Config::read_config("../configfile"); }
event Input::end_of_data(name: string, source:string)
{ print mycolors; terminate(); }