From 1fb05da9cd7df317fb758ba24c3b4edb47e5651f Mon Sep 17 00:00:00 2001 From: Bernhard Amann Date: Thu, 7 Mar 2013 20:28:18 -0800 Subject: [PATCH] Fix race-condition in table-event test. Event depended on the input manager receiving all lines from the reader before the first input event was processed by the scripting layer. --- .../out | 168 ------------------ .../base/frameworks/input/tableevent.bro | 1 - 2 files changed, 169 deletions(-) diff --git a/testing/btest/Baseline/scripts.base.frameworks.input.tableevent/out b/testing/btest/Baseline/scripts.base.frameworks.input.tableevent/out index d76c63ef31..54048a86b8 100644 --- a/testing/btest/Baseline/scripts.base.frameworks.input.tableevent/out +++ b/testing/btest/Baseline/scripts.base.frameworks.input.tableevent/out @@ -1,189 +1,21 @@ -[source=../input.log, reader=Input::READER_ASCII, mode=Input::MANUAL, name=input, destination={ -[2] = T, -[4] = F, -[6] = F, -[7] = T, -[1] = T, -[5] = F, -[3] = F -}, idx=, val=, want_record=F, ev=line -{ -print outfile, description; -print outfile, tpe; -print outfile, left; -print outfile, right; -try = try + 1; -if (7 == try) -{ -close(outfile); -terminate(); -} - -}, pred=, config={ - -}] Input::EVENT_NEW [i=1] T -[source=../input.log, reader=Input::READER_ASCII, mode=Input::MANUAL, name=input, destination={ -[2] = T, -[4] = F, -[6] = F, -[7] = T, -[1] = T, -[5] = F, -[3] = F -}, idx=, val=, want_record=F, ev=line -{ -print outfile, description; -print outfile, tpe; -print outfile, left; -print outfile, right; -try = try + 1; -if (7 == try) -{ -close(outfile); -terminate(); -} - -}, pred=, config={ - -}] Input::EVENT_NEW [i=2] T -[source=../input.log, reader=Input::READER_ASCII, mode=Input::MANUAL, name=input, destination={ -[2] = T, -[4] = F, -[6] = F, -[7] = T, -[1] = T, -[5] = F, -[3] = F -}, idx=, val=, want_record=F, ev=line -{ -print outfile, description; -print outfile, tpe; -print outfile, left; -print outfile, right; -try = try + 1; -if (7 == try) -{ -close(outfile); -terminate(); -} - -}, pred=, config={ - -}] Input::EVENT_NEW [i=3] F -[source=../input.log, reader=Input::READER_ASCII, mode=Input::MANUAL, name=input, destination={ -[2] = T, -[4] = F, -[6] = F, -[7] = T, -[1] = T, -[5] = F, -[3] = F -}, idx=, val=, want_record=F, ev=line -{ -print outfile, description; -print outfile, tpe; -print outfile, left; -print outfile, right; -try = try + 1; -if (7 == try) -{ -close(outfile); -terminate(); -} - -}, pred=, config={ - -}] Input::EVENT_NEW [i=4] F -[source=../input.log, reader=Input::READER_ASCII, mode=Input::MANUAL, name=input, destination={ -[2] = T, -[4] = F, -[6] = F, -[7] = T, -[1] = T, -[5] = F, -[3] = F -}, idx=, val=, want_record=F, ev=line -{ -print outfile, description; -print outfile, tpe; -print outfile, left; -print outfile, right; -try = try + 1; -if (7 == try) -{ -close(outfile); -terminate(); -} - -}, pred=, config={ - -}] Input::EVENT_NEW [i=5] F -[source=../input.log, reader=Input::READER_ASCII, mode=Input::MANUAL, name=input, destination={ -[2] = T, -[4] = F, -[6] = F, -[7] = T, -[1] = T, -[5] = F, -[3] = F -}, idx=, val=, want_record=F, ev=line -{ -print outfile, description; -print outfile, tpe; -print outfile, left; -print outfile, right; -try = try + 1; -if (7 == try) -{ -close(outfile); -terminate(); -} - -}, pred=, config={ - -}] Input::EVENT_NEW [i=6] F -[source=../input.log, reader=Input::READER_ASCII, mode=Input::MANUAL, name=input, destination={ -[2] = T, -[4] = F, -[6] = F, -[7] = T, -[1] = T, -[5] = F, -[3] = F -}, idx=, val=, want_record=F, ev=line -{ -print outfile, description; -print outfile, tpe; -print outfile, left; -print outfile, right; -try = try + 1; -if (7 == try) -{ -close(outfile); -terminate(); -} - -}, pred=, config={ - -}] Input::EVENT_NEW [i=7] T diff --git a/testing/btest/scripts/base/frameworks/input/tableevent.bro b/testing/btest/scripts/base/frameworks/input/tableevent.bro index a409803440..c83b1361c1 100644 --- a/testing/btest/scripts/base/frameworks/input/tableevent.bro +++ b/testing/btest/scripts/base/frameworks/input/tableevent.bro @@ -35,7 +35,6 @@ global destination: table[int] of Val = table(); event line(description: Input::TableDescription, tpe: Input::Event, left: Idx, right: bool) { - print outfile, description; print outfile, tpe; print outfile, left; print outfile, right;