Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1605 from jrha/metaconfig_kafka_hnormalise
kafka & hnormalise: Add and fix tests
- Loading branch information
Showing
8 changed files
with
107 additions
and
8 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
40 changes: 40 additions & 0 deletions
40
ncm-metaconfig/src/main/metaconfig/hnormalise/tests/profiles/config.pan
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,40 @@ | ||
object template config; | ||
|
||
include 'metaconfig/hnormalise/config'; | ||
|
||
prefix "/software/components/metaconfig/services/{/etc/hnormalise.yaml}/contents"; | ||
|
||
"logging" = dict( | ||
"frequency", 100000, | ||
); | ||
|
||
"input" = dict( | ||
"zeromq", dict( | ||
"method", "pull", | ||
"host", "lo", | ||
"port", 31338, | ||
), | ||
); | ||
|
||
"output" = dict( | ||
"zeromq", dict( | ||
"success", dict( | ||
"method", "push", | ||
"host", "localhost", | ||
"port", 27001, | ||
), | ||
"failure", dict( | ||
"method", "push", | ||
"host", "localhost", | ||
"port", 27002, | ||
), | ||
), | ||
); | ||
|
||
"fields" = list( | ||
list("@source_host", "hostname"), | ||
list("message", "msg"), | ||
list("syslog_version", "version"), | ||
list("syslog_abspri", "pri"), | ||
list("program", "app_name"), | ||
); |
32 changes: 32 additions & 0 deletions
32
ncm-metaconfig/src/main/metaconfig/hnormalise/tests/regexps/config/base
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 @@ | ||
Base test for config | ||
--- | ||
/etc/hnormalise.yaml | ||
--- | ||
^fields:$ | ||
^- - '@source_host'$ | ||
^ - hostname$ | ||
^- - message$ | ||
^ - msg$ | ||
^- - syslog_version$ | ||
^ - version$ | ||
^- - syslog_abspri$ | ||
^ - pri$ | ||
^- - program$ | ||
^ - app_name$ | ||
^input:$ | ||
^ zeromq:$ | ||
^ host: lo$ | ||
^ method: pull$ | ||
^ port: 31338$ | ||
^logging:$ | ||
^ frequency: 100000$ | ||
^output:$ | ||
^ zeromq:$ | ||
^ failure:$ | ||
^ host: localhost$ | ||
^ method: push$ | ||
^ port: 27002$ | ||
^ success:$ | ||
^ host: localhost$ | ||
^ method: push$ | ||
^ port: 27001$ |
6 changes: 1 addition & 5 deletions
6
ncm-metaconfig/src/main/metaconfig/kafka/tests/profiles/config.pan
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
4 changes: 2 additions & 2 deletions
4
ncm-metaconfig/src/main/metaconfig/kafka/tests/regexps/config/base
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,17 @@ | ||
use Test::Quattor::ProfileCache qw(set_json_typed get_json_typed); | ||
|
||
BEGIN { | ||
set_json_typed() | ||
} | ||
|
||
use Test::More; | ||
use Test::Quattor::TextRender::Metaconfig; | ||
|
||
ok(get_json_typed(), "json_typed enabled for yaml render"); | ||
|
||
my $u = Test::Quattor::TextRender::Metaconfig->new( | ||
service => 'hnormalise', | ||
usett => 0, # uses builtin modules | ||
)->test(); | ||
|
||
done_testing; |
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 @@ | ||
use Test::More; | ||
use Test::Quattor::TextRender::Metaconfig; | ||
|
||
my $u = Test::Quattor::TextRender::Metaconfig->new( | ||
service => 'kafka', | ||
usett => 0, # uses builtin modules | ||
)->test(); | ||
|
||
done_testing; |