mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
fix stderr test. ls behaves differently on errors on linux...
This commit is contained in:
parent
08656c976b
commit
f1745ff488
2 changed files with 18 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
||||||
Process finished event
|
Process finished event
|
||||||
input
|
input
|
||||||
1
|
Exit code != 0
|
||||||
Input::EVENT_NEW
|
Input::EVENT_NEW
|
||||||
..:
|
..:
|
||||||
F
|
F
|
||||||
|
@ -14,13 +14,13 @@ Input::EVENT_NEW
|
||||||
stderr.bro
|
stderr.bro
|
||||||
F
|
F
|
||||||
Input::EVENT_NEW
|
Input::EVENT_NEW
|
||||||
ls: ../nonexistant: No such file or directory
|
stderr output contained nonexistant
|
||||||
T
|
T
|
||||||
Input::EVENT_NEW
|
Input::EVENT_NEW
|
||||||
ls: ../nonexistant2: No such file or directory
|
stderr output contained nonexistant
|
||||||
T
|
T
|
||||||
Input::EVENT_NEW
|
Input::EVENT_NEW
|
||||||
ls: ../nonexistant3: No such file or directory
|
stderr output contained nonexistant
|
||||||
T
|
T
|
||||||
done
|
done
|
||||||
End of Data event
|
End of Data event
|
||||||
|
|
|
@ -15,7 +15,18 @@ global outfile: file;
|
||||||
event line(description: Input::EventDescription, tpe: Input::Event, s: string, is_stderr: bool)
|
event line(description: Input::EventDescription, tpe: Input::Event, s: string, is_stderr: bool)
|
||||||
{
|
{
|
||||||
print outfile, tpe;
|
print outfile, tpe;
|
||||||
print outfile, s;
|
if ( is_stderr )
|
||||||
|
{
|
||||||
|
# work around localized error messages. and if some localization does not include the filename... well... that would be bad :)
|
||||||
|
if ( strstr(s, "nonexistant") > 0 )
|
||||||
|
{
|
||||||
|
print outfile, "stderr output contained nonexistant";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print outfile, s;
|
||||||
|
}
|
||||||
print outfile, is_stderr;
|
print outfile, is_stderr;
|
||||||
|
|
||||||
try = try + 1;
|
try = try + 1;
|
||||||
|
@ -38,7 +49,8 @@ event InputRaw::process_finished(name: string, source:string, exit_code:count, s
|
||||||
{
|
{
|
||||||
print outfile, "Process finished event";
|
print outfile, "Process finished event";
|
||||||
print outfile, name;
|
print outfile, name;
|
||||||
print outfile, exit_code;
|
if ( exit_code != 0 )
|
||||||
|
print outfile, "Exit code != 0";
|
||||||
}
|
}
|
||||||
|
|
||||||
event bro_init()
|
event bro_init()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue