mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Fixed some test canonifiers to read only from stdin
Fixed some test canonifier scripts to read from stdin instead of from a filename specified as a cmd-line argument. This is needed in order to be able to reliably use them in a pipeline with other test canonifiers. Also removed some unused test canonifier scripts.
This commit is contained in:
parent
09904aeb54
commit
6f1e07f6d5
6 changed files with 16 additions and 56 deletions
|
@ -1,10 +0,0 @@
|
||||||
#! /usr/bin/awk -f
|
|
||||||
#
|
|
||||||
# A diff canonifier that removes the priorities in notice_policy.log.
|
|
||||||
|
|
||||||
/^#/ && $2 == "notice_policy" { filter = 1; }
|
|
||||||
|
|
||||||
filter == 1 && /^[^#]/ { sub("^[0-9]*", "X"); }
|
|
||||||
|
|
||||||
{ print; }
|
|
||||||
|
|
|
@ -18,7 +18,6 @@ fi
|
||||||
| `dirname $0`/diff-remove-uids \
|
| `dirname $0`/diff-remove-uids \
|
||||||
| `dirname $0`/diff-remove-file-ids \
|
| `dirname $0`/diff-remove-file-ids \
|
||||||
| `dirname $0`/diff-remove-x509-names \
|
| `dirname $0`/diff-remove-x509-names \
|
||||||
| `dirname $0`/diff-canon-notice-policy \
|
|
||||||
| `dirname $0`/diff-sort \
|
| `dirname $0`/diff-sort \
|
||||||
| eval $addl
|
| eval $addl
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
#! /usr/bin/awk -f
|
#! /usr/bin/env bash
|
||||||
#
|
#
|
||||||
# A diff canonifier that removes all file IDs from files.log
|
# A diff canonifier that removes all file IDs from files.log
|
||||||
|
|
||||||
|
awk '
|
||||||
BEGIN {
|
BEGIN {
|
||||||
FS="\t";
|
FS="\t";
|
||||||
OFS="\t";
|
OFS="\t";
|
||||||
|
@ -28,6 +29,4 @@ process && column1 > 0 && column2 > 0 {
|
||||||
}
|
}
|
||||||
|
|
||||||
{ print }
|
{ print }
|
||||||
|
'
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
#! /usr/bin/awk -f
|
|
||||||
#
|
|
||||||
# A diff canonifier that removes all MIME types because libmagic output
|
|
||||||
# can differ between installations.
|
|
||||||
|
|
||||||
BEGIN { FS="\t"; OFS="\t"; type_col = -1; desc_col = -1 }
|
|
||||||
|
|
||||||
/^#fields/ {
|
|
||||||
for ( i = 2; i < NF; ++i )
|
|
||||||
{
|
|
||||||
if ( $i == "mime_type" )
|
|
||||||
type_col = i-1;
|
|
||||||
if ( $i == "mime_desc" )
|
|
||||||
desc_col = i-1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function remove_mime (n) {
|
|
||||||
if ( n >= 0 && $n != "-" )
|
|
||||||
# Mark that it's set, but ignore content.
|
|
||||||
$n = "+"
|
|
||||||
}
|
|
||||||
|
|
||||||
remove_mime(type_col)
|
|
||||||
remove_mime(desc_col)
|
|
||||||
|
|
||||||
{
|
|
||||||
print;
|
|
||||||
}
|
|
|
@ -1,7 +1,8 @@
|
||||||
#! /usr/bin/awk -f
|
#! /usr/bin/env bash
|
||||||
#
|
#
|
||||||
# A diff canonifier that removes all connection UIDs.
|
# A diff canonifier that removes all connection UIDs.
|
||||||
|
|
||||||
|
awk '
|
||||||
BEGIN { FS="\t"; OFS="\t"; }
|
BEGIN { FS="\t"; OFS="\t"; }
|
||||||
|
|
||||||
column > 0 {
|
column > 0 {
|
||||||
|
@ -16,6 +17,4 @@ column > 0 {
|
||||||
}
|
}
|
||||||
|
|
||||||
{ print }
|
{ print }
|
||||||
|
'
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
#! /usr/bin/awk -f
|
#! /usr/bin/env bash
|
||||||
#
|
#
|
||||||
# A diff canonifier that removes all X.509 Distinguished Name subject fields
|
# A diff canonifier that removes all X.509 Distinguished Name subject fields
|
||||||
# because that output can differ depending on installed OpenSSL version.
|
# because that output can differ depending on installed OpenSSL version.
|
||||||
|
|
||||||
|
awk '
|
||||||
BEGIN { FS="\t"; OFS="\t"; s_col = -1; i_col = -1; is_col = -1; cs_col = -1; ci_col = -1; cert_subj_col = -1; cert_issuer_col = -1 }
|
BEGIN { FS="\t"; OFS="\t"; s_col = -1; i_col = -1; is_col = -1; cs_col = -1; ci_col = -1; cert_subj_col = -1; cert_issuer_col = -1 }
|
||||||
|
|
||||||
/^#fields/ {
|
/^#fields/ {
|
||||||
|
@ -27,46 +28,47 @@ BEGIN { FS="\t"; OFS="\t"; s_col = -1; i_col = -1; is_col = -1; cs_col = -1; ci_
|
||||||
|
|
||||||
s_col >= 0 {
|
s_col >= 0 {
|
||||||
if ( $s_col != "-" )
|
if ( $s_col != "-" )
|
||||||
# Mark that it's set, but ignore content.
|
# Mark that it is set, but ignore content.
|
||||||
$s_col = "+";
|
$s_col = "+";
|
||||||
}
|
}
|
||||||
|
|
||||||
i_col >= 0 {
|
i_col >= 0 {
|
||||||
if ( $i_col != "-" )
|
if ( $i_col != "-" )
|
||||||
# Mark that it's set, but ignore content.
|
# Mark that it is set, but ignore content.
|
||||||
$i_col = "+";
|
$i_col = "+";
|
||||||
}
|
}
|
||||||
|
|
||||||
is_col >= 0 {
|
is_col >= 0 {
|
||||||
if ( $is_col != "-" )
|
if ( $is_col != "-" )
|
||||||
# Mark that it's set, but ignore content.
|
# Mark that it is set, but ignore content.
|
||||||
$is_col = "+";
|
$is_col = "+";
|
||||||
}
|
}
|
||||||
|
|
||||||
cs_col >= 0 {
|
cs_col >= 0 {
|
||||||
if ( $cs_col != "-" )
|
if ( $cs_col != "-" )
|
||||||
# Mark that it's set, but ignore content.
|
# Mark that it is set, but ignore content.
|
||||||
$cs_col = "+";
|
$cs_col = "+";
|
||||||
}
|
}
|
||||||
|
|
||||||
ci_col >= 0 {
|
ci_col >= 0 {
|
||||||
if ( $ci_col != "-" )
|
if ( $ci_col != "-" )
|
||||||
# Mark that it's set, but ignore content.
|
# Mark that it is set, but ignore content.
|
||||||
$ci_col = "+";
|
$ci_col = "+";
|
||||||
}
|
}
|
||||||
|
|
||||||
cert_subj_col >= 0 {
|
cert_subj_col >= 0 {
|
||||||
if ( $cert_subj_col != "-" )
|
if ( $cert_subj_col != "-" )
|
||||||
# Mark that it's set, but ignore content.
|
# Mark that it is set, but ignore content.
|
||||||
$cert_subj_col = "+";
|
$cert_subj_col = "+";
|
||||||
}
|
}
|
||||||
|
|
||||||
cert_issuer_col >= 0 {
|
cert_issuer_col >= 0 {
|
||||||
if ( $cert_issuer_col != "-" )
|
if ( $cert_issuer_col != "-" )
|
||||||
# Mark that it's set, but ignore content.
|
# Mark that it is set, but ignore content.
|
||||||
$cert_issuer_col = "+";
|
$cert_issuer_col = "+";
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
print;
|
print;
|
||||||
}
|
}
|
||||||
|
'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue