From 357341c887d230eac14d3beee40da68e10ee74bd Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Tue, 4 Oct 2011 10:51:41 -0500 Subject: [PATCH 1/2] Changing some external testing scripts. - The absolute path canonifier was overzealously canonifying relevant log fields, so it's no longer generally applied to diffing all baselines. I don't think there's any logs that require local filesystem path names that aren't already tested by a unit test, but if any show up in the future, they can be canonified on a case-by-case basis. - Removed some logs from being diff'd in the diff-all script because they're either already covered by a unit test (load_scripts.log) or because of difficulty/maintainenance tradeoff (prof.log). Baselines for the external bro-testing repo still need updating. --- testing/external/scripts/diff-all | 14 ++++++++------ testing/scripts/diff-canonifier-external | 1 - 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/testing/external/scripts/diff-all b/testing/external/scripts/diff-all index e87174fdbd..597c769687 100755 --- a/testing/external/scripts/diff-all +++ b/testing/external/scripts/diff-all @@ -15,12 +15,14 @@ fi rc=0; for i in $@; do - if ! btest-diff $i; then - echo "" >>$diag - echo "#### btest-diff $i" >>$diag - echo "" >>$diag - cat $diag.tmp >>$diag - rc=1 + if [[ "$i" != "loaded_scripts.log" && "$i" != "prof.log" ]]; then + if ! btest-diff $i; then + echo "" >>$diag + echo "#### btest-diff $i" >>$diag + echo "" >>$diag + cat $diag.tmp >>$diag + rc=1 + fi fi done diff --git a/testing/scripts/diff-canonifier-external b/testing/scripts/diff-canonifier-external index 427d172e57..76210cc494 100755 --- a/testing/scripts/diff-canonifier-external +++ b/testing/scripts/diff-canonifier-external @@ -5,4 +5,3 @@ `dirname $0`/diff-remove-timestamps \ | `dirname $0`/diff-remove-uids \ | `dirname $0`/diff-remove-mime-types \ - | `dirname $0`/diff-remove-abspath From c9a540b99292cd7e6f610eb4b5a0adb4afd5b24e Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Tue, 4 Oct 2011 14:27:51 -0500 Subject: [PATCH 2/2] Add check for optional HTTP::Info status_code. --- scripts/base/protocols/http/main.bro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/base/protocols/http/main.bro b/scripts/base/protocols/http/main.bro index 0faefc4274..139531327c 100644 --- a/scripts/base/protocols/http/main.bro +++ b/scripts/base/protocols/http/main.bro @@ -266,7 +266,7 @@ event http_message_done(c: connection, is_orig: bool, stat: http_message_stat) & { # If the response was an informational 1xx, we're still expecting # the real response later, so we'll continue using the same record. - if ( ! code_in_range(c$http$status_code, 100, 199) ) + if ( ! (c$http?$status_code && code_in_range(c$http$status_code, 100, 199)) ) { Log::write(HTTP::LOG, c$http); delete c$http_state$pending[c$http_state$current_response];