Bro plugins should support a patch version (x.y.z)

This commit is contained in:
Jon Zeolla 2018-09-29 23:08:10 -04:00
parent 35d0a4d38e
commit 615ff78282
31 changed files with 99 additions and 24 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -1,3 +1,3 @@
Demo::Foo - <Insert description> (dynamic, version 0.1)
Demo::Foo - <Insert description> (dynamic, version 0.1.0)
===

View file

@ -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")
===

View file

@ -0,0 +1 @@
Testing::NoPatchVersion - Testing a plugin without a specified patch version (dynamic, version 0.1.0)

View file

@ -0,0 +1 @@
Testing::WithPatchVersion - Testing a plugin with a specified patch version (dynamic, version 0.1.4)

View file

@ -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

View file

@ -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)
===

View file

@ -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)
===

View file

@ -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
=============

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View 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

View file

@ -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;
}

View 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

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}