From dedfdf7e11e5f653a5d54c582353214f8ac65f4c Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Mon, 8 Oct 2012 13:15:47 -0500 Subject: [PATCH] Add memory leak unit test for GridFTP. --- testing/btest/core/leaks/gridftp.test | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 testing/btest/core/leaks/gridftp.test diff --git a/testing/btest/core/leaks/gridftp.test b/testing/btest/core/leaks/gridftp.test new file mode 100644 index 0000000000..6364000b0d --- /dev/null +++ b/testing/btest/core/leaks/gridftp.test @@ -0,0 +1,24 @@ +# Needs perftools support. +# +# @TEST-REQUIRES: bro --help 2>&1 | grep -q mem-leaks +# +# @TEST-GROUP: leaks +# +# @TEST-EXEC: HEAP_CHECK_DUMP_DIRECTORY=. HEAPCHECK=local bro -m -r $TRACES/globus-url-copy.trace %INPUT + +@load base/protocols/ftp/gridftp + +module GridFTP; + +redef size_threshold = 2; + +redef enum Notice::Type += { + Data_Channel +}; + +event GridFTP::data_channel_detected(c: connection) + { + local msg = fmt("GridFTP data channel over threshold %d bytes", + size_threshold); + NOTICE([$note=Data_Channel, $msg=msg, $conn=c]); + }