Skip to content

Commit

Permalink
Add diff-remove-spicy-location canonifier
Browse files Browse the repository at this point in the history
  • Loading branch information
awelzel committed Jan 31, 2024
1 parent 16bc483 commit b3b468d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/analyzer/excessive-label-length.spicy
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

# @TEST-EXEC: spicyc -dj ${DIST}/analyzer/analyzer.spicy -o analyzer.hlto
# @TEST-EXEC-FAIL: spicy-driver analyzer.hlto -f ${TRACES}/excessive-label-lengths.dat >output 2>&1
# @TEST-EXEC: btest-diff output
# @TEST-EXEC: TEST_DIFF_CANONIFIER='diff-remove-abspath | diff-remove-spicy-location' btest-diff output
3 changes: 1 addition & 2 deletions tests/baseline/analyzer.excessive-label-length/output
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
### NOTE: This file has been sorted with diff-sort.
[error] terminating with uncaught exception of type spicy::rt::ParseError: maximum supported label length exceeded (<...>/analyzer.spicy:157:9)
[error] terminating with uncaught exception of type spicy::rt::ParseError: maximum supported label length exceeded (<...>/analyzer.spicy:<location>)
2 changes: 1 addition & 1 deletion tests/btest.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ IgnoreFiles = .DS_Store *.pcap data.* *.dat *.wmv *.der *.tmp *.swp .*.swp #* CM

[environment]
DIST=%(testbase)s/..
PATH=%(testbase)s/../tests/scripts:`spicyz --print-plugin-path`/tests/scripts:%(default_path)s
PATH=%(testbase)s/../tests/scripts:`spicyz --print-plugin-path`/tests/Scripts:%(default_path)s
SCRIPTS=`spicyz --print-plugin-path`/tests/Scripts
ZEEK_SPICY_MODULE_PATH=%(testbase)s/../build/spicy-modules
TEST_DIFF_CANONIFIER=`spicyz --print-plugin-path`/tests/Scripts/canonify-zeek-log-sorted
Expand Down
5 changes: 5 additions & 0 deletions tests/scripts/diff-remove-spicy-location
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#! /usr/bin/env bash
#
# Replace (a/b/c.spicy:1:2-3:4) with (a/b/c.spicy:<location>)

sed -E 's/\((.+)\.spicy:[0-9]+:[0-9]+(-[0-9]+:[0-9]+)?\)/(\1.spicy:<location>)/g'

0 comments on commit b3b468d

Please sign in to comment.