mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 09:38:19 +00:00
fixup! Add metadata plugin cluster test
This commit is contained in:
parent
79f181a244
commit
a064dcd10b
6 changed files with 60 additions and 0 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||||
|
received termination signal
|
|
@ -0,0 +1,33 @@
|
||||||
|
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||||
|
0.000000 InitPostScript
|
||||||
|
App::test_event(1) |mdv|=1
|
||||||
|
[id=App::CUSTOM_METADATA_STRING, val=testing string metadata]
|
||||||
|
custom metadata string, [testing string metadata]
|
||||||
|
custom metadata count, []
|
||||||
|
custom metadata table, []
|
||||||
|
App::test_event(2) |mdv|=1
|
||||||
|
[id=App::CUSTOM_METADATA_COUNT, val=42424242]
|
||||||
|
custom metadata string, []
|
||||||
|
custom metadata count, [42424242]
|
||||||
|
custom metadata table, []
|
||||||
|
App::test_event(3) |mdv|=1
|
||||||
|
[id=App::CUSTOM_METADATA_TABLE, val={
|
||||||
|
[key1] = val1
|
||||||
|
}]
|
||||||
|
custom metadata string, []
|
||||||
|
custom metadata count, []
|
||||||
|
custom metadata table, [{
|
||||||
|
[key1] = val1
|
||||||
|
}]
|
||||||
|
App::test_event(4) |mdv|=4
|
||||||
|
[id=App::CUSTOM_METADATA_TABLE, val={
|
||||||
|
[key1] = val1
|
||||||
|
}]
|
||||||
|
[id=App::CUSTOM_METADATA_COUNT, val=41414242]
|
||||||
|
[id=App::CUSTOM_METADATA_STRING, val=testing string metadata]
|
||||||
|
[id=App::CUSTOM_METADATA_STRING, val=more string metadata]
|
||||||
|
custom metadata string, [testing string metadata, more string metadata]
|
||||||
|
custom metadata count, [41414242]
|
||||||
|
custom metadata table, [{
|
||||||
|
[key1] = val1
|
||||||
|
}]
|
|
@ -0,0 +1,4 @@
|
||||||
|
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||||
|
0.000000 InitPostScript
|
||||||
|
0.000000 HookPublishEvent backend=Broker topic=/test/topic event=App::test_event
|
||||||
|
0.000000 HookPublishEvent /test/topic(App::test_event)
|
|
@ -0,0 +1,2 @@
|
||||||
|
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||||
|
received termination signal
|
|
@ -0,0 +1,6 @@
|
||||||
|
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||||
|
0.000000 InitPostScript
|
||||||
|
0.000000 HookPublishEvent backend=Broker topic=topic1 event=App::test_event
|
||||||
|
0.000000 HookPublishEvent backend=Broker topic=topic2 event=App::test_event
|
||||||
|
0.000000 HookPublishEvent backend=Broker topic=topic3 event=App::test_event
|
||||||
|
0.000000 HookPublishEvent backend=Broker topic=topic4 event=App::test_event
|
|
@ -65,6 +65,19 @@ bool Plugin::HookPublishEvent(zeek::cluster::Backend& backend, const std::string
|
||||||
if ( ! event.AddMetadata(table_md, tv) ) {
|
if ( ! event.AddMetadata(table_md, tv) ) {
|
||||||
zeek::reporter->FatalError("Failed to add table metadata");
|
zeek::reporter->FatalError("Failed to add table metadata");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( ! event.AddMetadata(count_md, zeek::val_mgr->Count(41414242)) ) {
|
||||||
|
zeek::reporter->FatalError("Failed to add string metadata");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ! event.AddMetadata(string_md, zeek::make_intrusive<zeek::StringVal>("testing string metadata")) ) {
|
||||||
|
zeek::reporter->FatalError("Failed to add string metadata");
|
||||||
|
}
|
||||||
|
|
||||||
|
// metadata is just a vector, so can have duplicate entries.
|
||||||
|
if ( ! event.AddMetadata(string_md, zeek::make_intrusive<zeek::StringVal>("more string metadata")) ) {
|
||||||
|
zeek::reporter->FatalError("Failed to add string metadata");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
zeek::reporter->FatalError("Unhandled topic %s", topic.c_str());
|
zeek::reporter->FatalError("Unhandled topic %s", topic.c_str());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue