mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +00:00
Bro plugins should support a patch version (x.y.z)
This commit is contained in:
parent
35d0a4d38e
commit
615ff78282
31 changed files with 99 additions and 24 deletions
|
@ -1,4 +1,4 @@
|
|||
Demo::Foo - <Insert description> (dynamic, version 0.1)
|
||||
Demo::Foo - <Insert description> (dynamic, version 0.1.0)
|
||||
[Function] hello_plugin_world
|
||||
[Event] plugin_event
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Demo::Foo - <Insert description> (dynamic, version 0.1)
|
||||
Demo::Foo - <Insert description> (dynamic, version 0.1.0)
|
||||
[Function] hello_plugin_world
|
||||
[Event] plugin_event
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Demo::Foo - A Foo test analyzer (dynamic, version 1.0)
|
||||
Demo::Foo - A Foo test analyzer (dynamic, version 1.0.0)
|
||||
[File Analyzer] Foo (ANALYZER_FOO)
|
||||
[Event] foo_piece
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
Demo::Foo - <Insert description> (dynamic, version 0.1)
|
||||
Demo::Foo - <Insert description> (dynamic, version 0.1.0)
|
||||
|
||||
===
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Demo::Foo - A Foo packet dumper (dynamic, version 1.0)
|
||||
Demo::Foo - A Foo packet dumper (dynamic, version 1.0.0)
|
||||
[Packet Dumper] FooPktDumper (dumper prefix: "foo")
|
||||
|
||||
===
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Testing::NoPatchVersion - Testing a plugin without a specified patch version (dynamic, version 0.1.0)
|
|
@ -0,0 +1 @@
|
|||
Testing::WithPatchVersion - Testing a plugin with a specified patch version (dynamic, version 0.1.4)
|
|
@ -1,4 +1,4 @@
|
|||
Demo::Foo - A Foo test analyzer (dynamic, version 1.0)
|
||||
Demo::Foo - A Foo test analyzer (dynamic, version 1.0.0)
|
||||
[Analyzer] Foo (ANALYZER_FOO, enabled)
|
||||
[Event] foo_message
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Demo::Foo - A Foo test input reader (dynamic, version 1.0)
|
||||
Demo::Foo - A Foo test input reader (dynamic, version 1.0.0)
|
||||
[Reader] Foo (Input::READER_FOO)
|
||||
|
||||
===
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Demo::Foo - A Foo test logging writer (dynamic, version 1.0)
|
||||
Demo::Foo - A Foo test logging writer (dynamic, version 1.0.0)
|
||||
[Writer] Foo (Log::WRITER_FOO)
|
||||
|
||||
===
|
||||
|
|
|
@ -20,17 +20,17 @@ Significant Subdirectories
|
|||
Packet captures utilized by the various BTest tests.
|
||||
|
||||
* scripts/
|
||||
This hierarchy of tests emulates the hierarchy of the Bro scripts/
|
||||
directory.
|
||||
This hierarchy of tests emulates the hierarchy of the Bro scripts/
|
||||
directory.
|
||||
|
||||
* coverage/
|
||||
This collection of tests relates to checking whether we're covering
|
||||
everything we want to in terms of tests, documentation, and which
|
||||
scripts get loaded in different Bro configurations. These tests are
|
||||
more prone to fail as new Bro scripts are developed and added to the
|
||||
distribution -- checking the individual test's comments is the best
|
||||
place to check for more details on what exactly the test is checking
|
||||
and hints on how to fix it when it fails.
|
||||
This collection of tests relates to checking whether we're covering
|
||||
everything we want to in terms of tests, documentation, and which
|
||||
scripts get loaded in different Bro configurations. These tests are
|
||||
more prone to fail as new Bro scripts are developed and added to the
|
||||
distribution -- checking the individual test's comments is the best
|
||||
place to check for more details on what exactly the test is checking
|
||||
and hints on how to fix it when it fails.
|
||||
|
||||
Running Tests
|
||||
=============
|
||||
|
|
|
@ -16,5 +16,6 @@ plugin::Configuration Plugin::Configure()
|
|||
config.description = "A Foo test analyzer";
|
||||
config.version.major = 1;
|
||||
config.version.minor = 0;
|
||||
config.version.patch = 0;
|
||||
return config;
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ plugin::Configuration Plugin::Configure()
|
|||
config.description = "Exercises all plugin hooks";
|
||||
config.version.major = 1;
|
||||
config.version.minor = 0;
|
||||
config.version.patch = 0;
|
||||
return config;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ plugin::Configuration Plugin::Configure()
|
|||
config.description = "Exercises Log hooks";
|
||||
config.version.major = 1;
|
||||
config.version.minor = 0;
|
||||
config.version.patch = 0;
|
||||
return config;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,5 +16,6 @@ plugin::Configuration Plugin::Configure()
|
|||
config.description = "A Foo packet dumper";
|
||||
config.version.major = 1;
|
||||
config.version.minor = 0;
|
||||
config.version.patch = 0;
|
||||
return config;
|
||||
}
|
||||
|
|
|
@ -16,5 +16,6 @@ plugin::Configuration Plugin::Configure()
|
|||
config.description = "A Foo packet source";
|
||||
config.version.major = 1;
|
||||
config.version.minor = 0;
|
||||
config.version.patch = 0;
|
||||
return config;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
#include "Plugin.h"
|
||||
|
||||
namespace plugin { namespace Testing_NoPatchVersion { Plugin plugin; } }
|
||||
|
||||
using namespace plugin::Testing_NoPatchVersion;
|
||||
|
||||
plugin::Configuration Plugin::Configure()
|
||||
{
|
||||
plugin::Configuration config;
|
||||
config.name = "Testing::NoPatchVersion";
|
||||
config.description = "Testing a plugin without a specified patch version";
|
||||
config.version.major = 0;
|
||||
config.version.minor = 1;
|
||||
return config;
|
||||
}
|
5
testing/btest/plugins/plugin-nopatchversion.bro
Normal file
5
testing/btest/plugins/plugin-nopatchversion.bro
Normal file
|
@ -0,0 +1,5 @@
|
|||
# @TEST-EXEC: ${DIST}/aux/bro-aux/plugin-support/init-plugin -u . Testing NoPatchVersion
|
||||
# @TEST-EXEC: cp -r %DIR/plugin-nopatchversion-plugin/* .
|
||||
# @TEST-EXEC: ./configure --bro-dist=${DIST} && make
|
||||
# @TEST-EXEC: BRO_PLUGIN_PATH=$(pwd) bro -N Testing::NoPatchVersion >> output
|
||||
# @TEST-EXEC: btest-diff output
|
|
@ -0,0 +1,17 @@
|
|||
|
||||
#include "Plugin.h"
|
||||
|
||||
namespace plugin { namespace Testing_WithPatchVersion { Plugin plugin; } }
|
||||
|
||||
using namespace plugin::Testing_WithPatchVersion;
|
||||
|
||||
plugin::Configuration Plugin::Configure()
|
||||
{
|
||||
plugin::Configuration config;
|
||||
config.name = "Testing::WithPatchVersion";
|
||||
config.description = "Testing a plugin with a specified patch version";
|
||||
config.version.major = 0;
|
||||
config.version.minor = 1;
|
||||
config.version.patch = 4;
|
||||
return config;
|
||||
}
|
5
testing/btest/plugins/plugin-withpatchversion.bro
Normal file
5
testing/btest/plugins/plugin-withpatchversion.bro
Normal file
|
@ -0,0 +1,5 @@
|
|||
# @TEST-EXEC: ${DIST}/aux/bro-aux/plugin-support/init-plugin -u . Testing WithPatchVersion
|
||||
# @TEST-EXEC: cp -r %DIR/plugin-withpatchversion-plugin/* .
|
||||
# @TEST-EXEC: ./configure --bro-dist=${DIST} && make
|
||||
# @TEST-EXEC: BRO_PLUGIN_PATH=$(pwd) bro -N Testing::WithPatchVersion >> output
|
||||
# @TEST-EXEC: btest-diff output
|
|
@ -16,5 +16,6 @@ plugin::Configuration Plugin::Configure()
|
|||
config.description = "A Foo test analyzer";
|
||||
config.version.major = 1;
|
||||
config.version.minor = 0;
|
||||
config.version.patch = 0;
|
||||
return config;
|
||||
}
|
||||
|
|
|
@ -15,5 +15,6 @@ plugin::Configuration Plugin::Configure()
|
|||
config.description = "A Foo test input reader";
|
||||
config.version.major = 1;
|
||||
config.version.minor = 0;
|
||||
config.version.patch = 0;
|
||||
return config;
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ plugin::Configuration Plugin::Configure()
|
|||
config.description = "Exercise Reporter Hook";
|
||||
config.version.major = 1;
|
||||
config.version.minor = 0;
|
||||
config.version.patch = 0;
|
||||
return config;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,5 +15,6 @@ plugin::Configuration Plugin::Configure()
|
|||
config.description = "A Foo test logging writer";
|
||||
config.version.major = 1;
|
||||
config.version.minor = 0;
|
||||
config.version.patch = 0;
|
||||
return config;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue