zeek/testing/btest/scripts/policy/frameworks/software/version-changes.zeek
Robin Sommer 789cb376fd GH-239: Rename bro to zeek, bro-config to zeek-config, and bro-path-dev to zeek-path-dev.
This also installs symlinks from "zeek" and "bro-config" to a wrapper
script that prints a deprecation warning.

The btests pass, but this is still WIP. broctl renaming is still
missing.

#239
2019-05-01 21:43:45 +00:00

40 lines
993 B
Text

# @TEST-EXEC: zeek -b %INPUT
# @TEST-EXEC: btest-diff software.log
# @TEST-EXEC: btest-diff notice.log
@load base/frameworks/software
@load policy/frameworks/software/version-changes
const fake_software_name = "my_fake_software";
redef Software::asset_tracking = ALL_HOSTS;
redef Software::interesting_version_changes += {fake_software_name};
global versions: vector of string = vector("1.0.0", "1.1.0", "1.2.0", "1.0.0");
global version_index = 0;
global c = 0;
event new_software()
{
local v = versions[version_index];
local cid = conn_id($orig_h = 127.0.0.1, $orig_p = 22/tcp,
$resp_h = 127.0.0.1, $resp_p = 22/tcp);
local si = Software::Info($name=fake_software_name,
$unparsed_version=fmt("%s %s",
fake_software_name, v),
$host=127.0.0.1);
Software::found(cid, si);
++version_index;
++c;
if ( version_index >= |versions| )
version_index = 0;
if ( c < 10 )
event new_software();
}
event zeek_init()
{
event new_software();
}