From e96a9f930906aa11d98a2eca6dc889f59eb29223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jerry=20Lundstr=C3=B6m?= Date: Wed, 11 Apr 2018 15:26:26 +0200 Subject: [PATCH] Backends - Rework structure of files, most Lua code is now installed in `pkgdatadir` and loaded from main script - Add hidden option `--pkgdatadir` to control where to load files from - Add backends - Add configuration option `backend
` - Use `pcapthread` as default input backend - Use `cpool` as default output backend - Add input backends: `fpcap`, `mmpcap` and `pcap` - Add output backend: `udpcli` - Use `client_pool max_clients` to control how many threads to spin up for `udpcli` - Throw error if functionality is used but not supported by backend - Update man-pages - Change version to 1.99.0 as a pre 2.0 alpha release - Output program name, version and issue URL to stderr on startup --- Makefile.am | 2 +- configure.ac | 10 +- debian/changelog | 8 ++ rpm/drool.spec | 7 +- src/Makefile.am | 41 +++---- src/conf.lua | 25 ++++ src/drool.conf.5.in | 78 ++++++++++-- src/drool.conf.example | 7 ++ src/{getopt.lua => drool.in} | 47 ++++++++ src/head.lua.in | 29 ----- src/main.lua | 3 - src/run.lua | 224 ++++++++++++++++++++++++----------- src/test/Makefile.am | 10 +- src/test/test1.sh | 2 +- src/test/test2.sh | 2 +- src/test/test3.sh | 4 +- src/test/test4.sh | 12 +- 17 files changed, 354 insertions(+), 157 deletions(-) rename src/{getopt.lua => drool.in} (68%) delete mode 100644 src/head.lua.in diff --git a/Makefile.am b/Makefile.am index 79c16c0..41857e8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -36,7 +36,7 @@ ACLOCAL_AMFLAGS = -I m4 MAINTAINERCLEANFILES = $(srcdir)/Makefile.in \ - $(srcdir)/configure + $(srcdir)/configure SUBDIRS = src diff --git a/configure.ac b/configure.ac index 2fbe1a2..5d374d3 100644 --- a/configure.ac +++ b/configure.ac @@ -34,7 +34,7 @@ # POSSIBILITY OF SUCH DAMAGE. AC_PREREQ(2.61) -AC_INIT([drool], [2.0.0], [admin@dns-oarc.net], [drool], [https://github.com/DNS-OARC/drool/issues]) +AC_INIT([drool], [1.99.0], [admin@dns-oarc.net], [drool], [https://github.com/DNS-OARC/drool/issues]) AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects]) AC_CONFIG_SRCDIR([src/main.lua]) AC_CONFIG_MACRO_DIR([m4]) @@ -42,13 +42,13 @@ AC_CONFIG_MACRO_DIR([m4]) # Checks for programs. AC_PATH_PROG([DNSJIT],[dnsjit]) if test "x$ac_cv_path_DNSJIT" = "x"; then - AC_MSG_ERROR([dnsjit was not found]) + AC_MSG_ERROR([dnsjit was not found]) fi # Output Makefiles AC_CONFIG_FILES([ - Makefile - src/Makefile - src/test/Makefile + Makefile + src/Makefile + src/test/Makefile ]) AC_OUTPUT diff --git a/debian/changelog b/debian/changelog index 9b66e9b..5e7f817 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +drool (1.99.0-1.~unstable+1) unstable; urgency=low + + * Release 1.99.0 + + Alpha version using dnsjit. + + -- Jerry Lundström Wed, 11 Apr 2018 16:00:14 +0200 + drool (1.1.0-1~unstable+1) unstable; urgency=low * Release 1.1.0 diff --git a/rpm/drool.spec b/rpm/drool.spec index 4231e91..e6ed01a 100644 --- a/rpm/drool.spec +++ b/rpm/drool.spec @@ -1,6 +1,6 @@ Name: drool -Version: 1.1.0 -Release: 1%{?dist} +Version: 1.99.0 +Release: 1.%{?dist} Summary: DNS Replay Tool Group: Productivity/Networking/DNS/Utilities @@ -49,6 +49,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Wed Apr 11 2018 Jerry Lundström 1.99.0-1. +- Release 1.99.0 + * Alpha version using dnsjit * Fri Feb 16 2018 Jerry Lundström 1.1.0-1 - Release 1.1.0 * Rework of the timing code to make it more effective, based on diff --git a/src/Makefile.am b/src/Makefile.am index b142451..57a20ed 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -34,41 +34,38 @@ # POSSIBILITY OF SUCH DAMAGE. MAINTAINERCLEANFILES = $(srcdir)/Makefile.in -CLEANFILES = head.lua drool drool.1 drool.conf.5 +CLEANFILES = drool drool.1 drool.conf.5 SUBDIRS = test -EXTRA_DIST = drool.1.in \ - drool.conf.5.in \ - drool.conf.example \ - head.lua.in conf.lua getopt.lua log.lua run.lua main.lua +EXTRA_DIST = drool.in \ + drool.1.in \ + drool.conf.5.in \ + drool.conf.example bin_SCRIPTS = drool - -SOURCES = head.lua conf.lua getopt.lua log.lua run.lua main.lua +dist_pkgdata_DATA = conf.lua log.lua run.lua main.lua man1_MANS = drool.1 man5_MANS = drool.conf.5 -drool: $(SOURCES) - for file in $(SOURCES); do test -f "$$file" && cat "$$file" || cat "$(srcdir)/$$file"; done > drool - chmod +x drool - -head.lua: head.lua.in Makefile +drool: drool.in Makefile sed -e 's,[@]PACKAGE_NAME[@],$(PACKAGE_NAME),g' \ - -e 's,[@]PACKAGE_VERSION[@],$(PACKAGE_VERSION),g' \ - -e 's,[@]PACKAGE_URL[@],$(PACKAGE_URL),g' \ - -e 's,[@]PACKAGE_BUGREPORT[@],$(PACKAGE_BUGREPORT),g' \ - < "$(srcdir)/head.lua.in" > head.lua + -e 's,[@]PACKAGE_VERSION[@],$(PACKAGE_VERSION),g' \ + -e 's,[@]PACKAGE_URL[@],$(PACKAGE_URL),g' \ + -e 's,[@]PACKAGE_BUGREPORT[@],$(PACKAGE_BUGREPORT),g' \ + -e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \ + < "$(srcdir)/drool.in" > drool + chmod +x drool drool.1: drool.1.in Makefile sed -e 's,[@]PACKAGE_VERSION[@],$(PACKAGE_VERSION),g' \ - -e 's,[@]PACKAGE_URL[@],$(PACKAGE_URL),g' \ - -e 's,[@]PACKAGE_BUGREPORT[@],$(PACKAGE_BUGREPORT),g' \ - < "$(srcdir)/drool.1.in" > drool.1 + -e 's,[@]PACKAGE_URL[@],$(PACKAGE_URL),g' \ + -e 's,[@]PACKAGE_BUGREPORT[@],$(PACKAGE_BUGREPORT),g' \ + < "$(srcdir)/drool.1.in" > drool.1 drool.conf.5: drool.conf.5.in Makefile sed -e 's,[@]PACKAGE_VERSION[@],$(PACKAGE_VERSION),g' \ - -e 's,[@]PACKAGE_URL[@],$(PACKAGE_URL),g' \ - -e 's,[@]PACKAGE_BUGREPORT[@],$(PACKAGE_BUGREPORT),g' \ - < "$(srcdir)/drool.conf.5.in" > drool.conf.5 + -e 's,[@]PACKAGE_URL[@],$(PACKAGE_URL),g' \ + -e 's,[@]PACKAGE_BUGREPORT[@],$(PACKAGE_BUGREPORT),g' \ + < "$(srcdir)/drool.conf.5.in" > drool.conf.5 diff --git a/src/conf.lua b/src/conf.lua index f628ae6..b26e10e 100644 --- a/src/conf.lua +++ b/src/conf.lua @@ -43,3 +43,28 @@ conf:func("client_pool", function(_, option, arg1, arg2) L:fatal("unknown client_pool option: %s", option) end end) +conf:func("backend", function(_, section, module) + if section == "input" then + if module == "pcapthread" then + backend.input = "pcapthread" + elseif module == "fpcap" then + backend.input = "fpcap" + elseif module == "mmpcap" then + backend.input = "mmpcap" + elseif module == "pcap" then + backend.input = "pcap" + else + L:fatal("unknown backend input: %s", module) + end + elseif section == "output" then + if module == "cpool" then + backend.output = "cpool" + elseif module == "udpcli" then + backend.output = "udpcli" + else + L:fatal("unknown backend output: %s", module) + end + else + L:fatal("unknown backend section: %s", section) + end +end) diff --git a/src/drool.conf.5.in b/src/drool.conf.5.in index c6b746a..93faf28 100644 --- a/src/drool.conf.5.in +++ b/src/drool.conf.5.in @@ -74,6 +74,10 @@ given to disable just that. Can be given multiple times and will be processed in the given order. See LOGGING for more information. .TP +\fBbackend\fR SECTION MODULE ; +Set which backend module to use for each section. +See BACKEND for more information. +.TP \fBread\fR " FILE " ; Read packets from PCAP file, can be given multiple times. Each \fBread\fR counts as a context and will use the given configuration @@ -137,6 +141,9 @@ will use a TCP or UDP port depending on the traffic read/captured, The total amount of ports used will be this value * number of \fIread\fR and \fIinput\fR * \fBcontext client_pools\fR and it is advised to keep this within the available ports/file descriptors for the running user. +If used together with backend +.I udpcli +then this will set the number of threads to use and run one client per thread. .TP \fBclient_pool\fR client_ttl SECONDS_AS_FLOAT ; Set the time a client lives for, this is used to timeout clients in case @@ -172,50 +179,97 @@ example: The following logging facilities exists: .TP -\fBcore\fR +.B core Log messages about initializing, configuration and start up. .TP -\fBinput\fR +.B input Log messages about input related tasks. .TP -\fBprocessing\fR +.B processing Log messages about processing related tasks. .TP -\fBnetwork\fR +.B network Log messages about network related tasks. .TP -\fBall\fR +.B all Log messages for all facilities, this is only used to configure logging. .LP The following logging level exists for all facilities: .TP -\fBdebug\fR +.B debug Log messages about the very inner workings, use with caution since it generates a lot of messages. .TP -\fBinfo\fR +.B info Log messages of the informational kind that may not be interesting in normal operation. .TP -\fBnotice\fR +.B notice Log messages of the informational kind that may be interesting in normal operation. .TP -\fBwarning\fR +.B warning Log message of the warning kind that indicates possible disruption in operation. .TP -\fBcritical\fR +.B critical Log messages of the error kind that will most likely result in termination of operation. This log level can not be silenced. .TP -\fBfatal\fR +.B fatal Log messages of the critical kind that indicates termination of operation. This log level can not be silenced. .TP -\fBall\fR +.B all Log messages for all levels, this is only used to configure logging. +.SH BACKEND +Following backend modules exists, note that some modules does not work with +each other and configuration options may not be available or mean different +things. +.SS SECTION: input +.TP +.B pcapthread +Default input that uses pcap-thread helper library to read from interfaces +and PCAP files. +.TP +.B fpcap +Read input from a PCAP file using standard library function +.B fopen() +and parse the PCAP without libpcap. +Following configuration options does not work: +.B filter +and +.BR timing . +.TP +.B mmpcap +Read input from a PCAP file by mapping the whole file to memory using +.B mmap() +and parse the PCAP without libpcap. +Following configuration options does not work: +.B filter +and +.BR timing . +.TP +.B pcap +Read input from an interface or PCAP file using libpcap. +Following configuration options does not work: +.B filter +and +.BR timing . +.SS SECTION: output +.TP +.B cpool +Send queries to a target by emulating clients (a client pool). +.TP +.B udpcli +Simple and dumb UDP DNS client. +Following configuration options does not work: +.B context +and all +.B client_pool +but +.BR max_clients . .SH SEE ALSO drool(1) .SH AUTHORS diff --git a/src/drool.conf.example b/src/drool.conf.example index 9439b63..ffaf121 100644 --- a/src/drool.conf.example +++ b/src/drool.conf.example @@ -1,6 +1,13 @@ log all; nolog network debug; +#backend input pcapthread; +#backend input fpcap; +#backend input mmpcap; +#backend input pcap; +#backend output cpool; +#backend output udpcli; + filter "udp port 53"; timing ignore; diff --git a/src/getopt.lua b/src/drool.in similarity index 68% rename from src/getopt.lua rename to src/drool.in index 81d0d82..1ae7d53 100644 --- a/src/getopt.lua +++ b/src/drool.in @@ -1,3 +1,42 @@ +#!/usr/bin/env dnsjit + +log = require("dnsjit.core.log") +clock = require("dnsjit.lib.clock") +L = log.new("drool") +conf = require("dnsjit.lib.parseconf").new() +getopt = nil + +files = {} +interfaces = {} +bpf = nil +client_pools = nil +host = nil +port = nil +max_clients = nil +client_ttl = nil +skip_reply = nil +max_reuse_clients = nil +sendas = nil +timing_mode = nil +timing_arg = nil +facility_log = { + input = {}, + processing = {}, + network = {}, +} +read_iter = 1 +read_mode = false +program = "@PACKAGE_NAME@" +version = "@PACKAGE_VERSION@" +package_url = "@PACKAGE_URL@" +pkgdatadir = "@pkgdatadir@" +backend = { + input = "pcapthread", + output = "cpool", +} + +io.stderr:write("<< "..program.." v"..version.." "..package_url.." >>\n") + function args() getopt = require("dnsjit.lib.getopt").new({ { "c", nil, "", "", "?+" }, @@ -10,6 +49,7 @@ function args() { "n", nil, "", "", "?" }, { "v", nil, 0, "", "?+" }, { "V", nil, false, "", "?" }, + { nil, "pkgdatadir", pkgdatadir, "", "?" }, }) arg = getopt:parse() @@ -61,3 +101,10 @@ function args() os.exit(0) end end + +args() +assert(loadfile(getopt:val("pkgdatadir").."/conf.lua"))() +assert(loadfile(getopt:val("pkgdatadir").."/log.lua"))() +assert(loadfile(getopt:val("pkgdatadir").."/run.lua"))() +assert(loadfile(getopt:val("pkgdatadir").."/main.lua"))() +main() diff --git a/src/head.lua.in b/src/head.lua.in deleted file mode 100644 index 380182b..0000000 --- a/src/head.lua.in +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env dnsjit - -log = require("dnsjit.core.log") -L = log.new("drool") -conf = require("dnsjit.lib.parseconf").new() -getopt = nil - -files = {} -interfaces = {} -bpf = nil -client_pools = nil -host = nil -port = nil -max_clients = nil -client_ttl = nil -skip_reply = nil -max_reuse_clients = nil -sendas = nil -timing_mode = nil -timing_arg = nil -facility_log = { - input = {}, - processing = {}, - network = {}, -} -read_iter = 1 -read_mode = false -program = "@PACKAGE_NAME@" -version = "@PACKAGE_VERSION@" diff --git a/src/main.lua b/src/main.lua index 34d8d63..a6fd70e 100644 --- a/src/main.lua +++ b/src/main.lua @@ -79,6 +79,3 @@ function main() end end end - -args() -main() diff --git a/src/run.lua b/src/run.lua index 7eefaa6..fd54f48 100644 --- a/src/run.lua +++ b/src/run.lua @@ -1,20 +1,37 @@ function run() - local pcapthread = pcall(function() require("dnsjit.input.pcapthread") end) - if not pcapthread then - pcapthread = require("dnsjit.input.pcap") - else - pcapthread = require("dnsjit.input.pcapthread") + local input + + if backend.input == "pcapthread" then + local pcapthread = pcall(function() require("dnsjit.input.pcapthread") end) + if not pcapthread then + pcapthread = require("dnsjit.input.pcap") + else + pcapthread = require("dnsjit.input.pcapthread") + end + input = pcapthread.new() + input:only_queries(true) + elseif backend.input == "fpcap" then + input = require("dnsjit.input.fpcap").new() + elseif backend.input == "mmpcap" then + input = require("dnsjit.input.mmpcap").new() + elseif backend.input == "pcap" then + input = require("dnsjit.input.pcap").new() end - local input = pcapthread.new() set_log("input", input) - input:only_queries(true) + if backend.input == "fpcap" or backend.input == "mmpcap" then + input:use_shared(true) + end o = getopt:val("f") if o > "" then bpf = f end if bpf and bpf > "" then - input:filter(bpf) + if backend.input == "pcapthread" then + input:filter(bpf) + else + L:fatal("input backend "..backend.input.." can not use BPF") + end end o = getopt:val("i") @@ -26,10 +43,18 @@ function run() end end for k, v in pairs(interfaces) do - input:open(v) + if backend.input == "pcapthread" then + input:open(v) + else + L:fatal("input backend "..backend.input.." can not open interfaces") + end end for k, v in pairs(o) do - input:open(v) + if backend.input == "pcapthread" then + input:open(v) + else + L:fatal("input backend "..backend.input.." can not open interfaces") + end end o = getopt:val("r") @@ -41,32 +66,22 @@ function run() end end for k, v in pairs(files) do - input:open_offline(v) + if backend.input == "pcapthread" or backend.input == "pcap" then + input:open_offline(v) + elseif backend.input == "fpcap" or backend.input == "mmpcap" then + input:open(v) + else + L:fatal("input backend "..backend.input.." can not open offline files") + end end for k, v in pairs(o) do - input:open_offline(v) - end - - function new_output() - local output = require("dnsjit.output.cpool").new(host, port) - set_log("network", output) - if max_clients ~= nil then - output:max_clients(max_clients) - end - if client_ttl ~= nil then - output:client_ttl(client_ttl) - end - if skip_reply ~= nil then - output:skip_reply(skip_reply) - end - if max_reuse_clients ~= nil then - output:max_reuse_clients(max_reuse_clients) - end - if sendas ~= nil then - output:sendas(sendas) + if backend.input == "pcapthread" or backend.input == "pcap" then + input:open_offline(v) + elseif backend.input == "fpcap" or backend.input == "mmpcap" then + input:open(v) + else + L:fatal("input backend "..backend.input.." can not open offline files") end - output:dry_run(getopt:val("n")) - return output end function new_timing() @@ -84,48 +99,116 @@ function run() return timing end - if client_pools == nil or client_pools == 1 then - local output = new_output() - if timing_mode then - local timing = new_timing() - input:receiver(timing) - timing:receiver(output) - else - input:receiver(output) + local start_sec, start_nsec, end_sec, end_nsec, runtime, output_queries + + if backend.output == "cpool" then + local new_output = function() + local output = require("dnsjit.output.cpool").new(host, port) + set_log("network", output) + if max_clients ~= nil then + output:max_clients(max_clients) + end + if client_ttl ~= nil then + output:client_ttl(client_ttl) + end + if skip_reply ~= nil then + output:skip_reply(skip_reply) + end + if max_reuse_clients ~= nil then + output:max_reuse_clients(max_reuse_clients) + end + if sendas ~= nil then + output:sendas(sendas) + end + output:dry_run(getopt:val("n")) + return output end - output:start() - input:run() - output:stop() - else - local n - local outputs = {} - local roundrobin = require("dnsjit.filter.roundrobin").new() - set_log("processing", roundrobin) - for n = 1, client_pools do + + if client_pools == nil or client_pools == 1 then local output = new_output() if timing_mode then local timing = new_timing() - roundrobin:receiver(timing) + input:receiver(timing) timing:receiver(output) else - roundrobin:receiver(output) + input:receiver(output) + end + output:start() + start_sec, start_nsec = clock:monotonic() + input:run() + output:stop() + else + local n + local outputs = {} + local roundrobin = require("dnsjit.filter.split").new() + set_log("processing", roundrobin) + for n = 1, client_pools do + local output = new_output() + if timing_mode then + local timing = new_timing() + roundrobin:receiver(timing) + timing:receiver(output) + else + roundrobin:receiver(output) + end + table.insert(outputs, output) + end + input:receiver(roundrobin) + for _, o in pairs(outputs) do + o:start() + end + start_sec, start_nsec = clock:monotonic() + input:run() + for _, o in pairs(outputs) do + o:stop() end - table.insert(outputs, output) - end - input:receiver(roundrobin) - for _, o in pairs(outputs) do - o:start() end - input:run() - for _, o in pairs(outputs) do - o:stop() + elseif backend.output == "udpcli" then + if max_clients == nil or max_clients == 1 then + local layer = require("dnsjit.filter.layer").new() + set_log("processing", layer) + local output = require("dnsjit.output.udpcli").new(host, port) + set_log("network", output) + + layer:receiver(output) + input:receiver(layer) + start_sec, start_nsec = clock:monotonic() + input:run() + output_queries = output:packets() + else + local layers = {} + local outputs = {} + local thread = require("dnsjit.filter.thread").new() + set_log("processing", thread) + local n + + thread:use_writers(true) + + for n = 1, max_clients do + local layer = require("dnsjit.filter.layer").new() + set_log("processing", layer) + local output = require("dnsjit.output.udpcli").new(host, port) + set_log("network", output) + + layer:receiver(output) + thread:receiver(layer) + table.insert(layers, layer) + table.insert(outputs, output) + end + + input:receiver(thread) + thread:start() + start_sec, start_nsec = clock:monotonic() + input:run() + thread:stop() + output_queries = 0 + for _, output in pairs(outputs) do + output_queries = output_queries + output:packets() + end end end + end_sec, end_nsec = clock:monotonic() - local start_sec, start_nsec, end_sec, end_nsec, runtime - - start_sec, start_nsec = input:start_time() - end_sec, end_nsec = input:end_time() runtime = 0 if end_sec > start_sec then runtime = ((end_sec - start_sec) - 1) + ((1000000000 - start_nsec + end_nsec)/1000000000) @@ -135,8 +218,13 @@ function run() print("runtime", runtime) print("packets", input:packets(), input:packets()/runtime, "/pps") - print("queries", input:queries(), input:queries()/runtime, "/qps") - print("dropped", input:dropped()) - print("ignored", input:ignored()) - print("total", input:queries() + input:dropped() + input:ignored()) + if backend.input == "pcapthread" then + print("queries", input:queries(), input:queries()/runtime, "/qps") + print("dropped", input:dropped()) + print("ignored", input:ignored()) + print("total", input:queries() + input:dropped() + input:ignored()) + end + if output_queries ~= nil then + print("output", output_queries, output_queries/runtime, "/qps") + end end diff --git a/src/test/Makefile.am b/src/test/Makefile.am index c09ff29..f7b0412 100644 --- a/src/test/Makefile.am +++ b/src/test/Makefile.am @@ -36,8 +36,8 @@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in CLEANFILES = test*.log test*.trs \ - *.pcap-dist \ - test4.out test4.out2 + *.pcap-dist \ + test4.out test4.out2 TESTS = test1.sh test2.sh test3.sh test4.sh @@ -49,6 +49,6 @@ test4.sh: dns.pcap-dist 1qtcp.pcap-dist cp "$<" "$@" EXTRA_DIST = $(TESTS) \ - test2.conf \ - dns.pcap 1qtcp.pcap \ - test4.gold + test2.conf \ + dns.pcap 1qtcp.pcap \ + test4.gold diff --git a/src/test/test1.sh b/src/test/test1.sh index 37191b8..914cfc8 100755 --- a/src/test/test1.sh +++ b/src/test/test1.sh @@ -35,4 +35,4 @@ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -! ../drool -h +! ../drool --pkgdatadir "$srcdir/.." -h diff --git a/src/test/test2.sh b/src/test/test2.sh index 52a9dfc..653ad7a 100755 --- a/src/test/test2.sh +++ b/src/test/test2.sh @@ -35,4 +35,4 @@ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -! ../drool -c "$srcdir/test2.conf" +! ../drool --pkgdatadir "$srcdir/.." -c "$srcdir/test2.conf" diff --git a/src/test/test3.sh b/src/test/test3.sh index c140807..928ae69 100755 --- a/src/test/test3.sh +++ b/src/test/test3.sh @@ -35,5 +35,5 @@ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -../drool -c "text:client_pool target \"127.0.0.1\" \"53\"; timing ignore;" -n -r ./dns.pcap-dist -../drool -c "text:client_pool target \"127.0.0.1\" \"53\"; timing ignore;" -n -r ./1qtcp.pcap-dist +../drool --pkgdatadir "$srcdir/.." -c "text:client_pool target \"127.0.0.1\" \"53\"; timing ignore;" -n -r ./dns.pcap-dist +../drool --pkgdatadir "$srcdir/.." -c "text:client_pool target \"127.0.0.1\" \"53\"; timing ignore;" -n -r ./1qtcp.pcap-dist diff --git a/src/test/test4.sh b/src/test/test4.sh index fb2b39e..dcb696f 100755 --- a/src/test/test4.sh +++ b/src/test/test4.sh @@ -38,12 +38,12 @@ if [ -n "$DROOL_TEST_NETWORK" ]; then rm -f test4.out test4.out2 for pcap in ./dns.pcap-dist ./1qtcp.pcap-dist; do - ../drool -c "text:client_pool target \"127.0.0.1\" \"53\"; timing ignore; client_pool skip_reply;" -vv -r "$pcap" >>test4.out - ../drool -c "text:client_pool target \"127.0.0.1\" \"53\"; timing ignore; client_pool skip_reply; client_pool sendas udp;" -vv -r "$pcap" >>test4.out - ../drool -c "text:client_pool target \"127.0.0.1\" \"53\"; timing ignore; client_pool skip_reply; client_pool sendas tcp;" -vv -r "$pcap" >>test4.out - ../drool -c "text:client_pool target \"::1\" \"53\"; timing ignore; client_pool skip_reply;" -vv -r "$pcap" >>test4.out - ../drool -c "text:client_pool target \"::1\" \"53\"; timing ignore; client_pool skip_reply; client_pool sendas udp;" -vv -r "$pcap" >>test4.out - ../drool -c "text:client_pool target \"::1\" \"53\"; timing ignore; client_pool skip_reply; client_pool sendas tcp;" -vv -r "$pcap" >>test4.out + ../drool --pkgdatadir "$srcdir/.." -c "text:client_pool target \"127.0.0.1\" \"53\"; timing ignore; client_pool skip_reply;" -vv -r "$pcap" >>test4.out + ../drool --pkgdatadir "$srcdir/.." -c "text:client_pool target \"127.0.0.1\" \"53\"; timing ignore; client_pool skip_reply; client_pool sendas udp;" -vv -r "$pcap" >>test4.out + ../drool --pkgdatadir "$srcdir/.." -c "text:client_pool target \"127.0.0.1\" \"53\"; timing ignore; client_pool skip_reply; client_pool sendas tcp;" -vv -r "$pcap" >>test4.out + ../drool --pkgdatadir "$srcdir/.." -c "text:client_pool target \"::1\" \"53\"; timing ignore; client_pool skip_reply;" -vv -r "$pcap" >>test4.out + ../drool --pkgdatadir "$srcdir/.." -c "text:client_pool target \"::1\" \"53\"; timing ignore; client_pool skip_reply; client_pool sendas udp;" -vv -r "$pcap" >>test4.out + ../drool --pkgdatadir "$srcdir/.." -c "text:client_pool target \"::1\" \"53\"; timing ignore; client_pool skip_reply; client_pool sendas tcp;" -vv -r "$pcap" >>test4.out done cut -d" " -f 4- test4.out | grep -v runtime | awk '{print $1 " " $2}' > test4.out2 diff test4.out2 "$srcdir/test4.gold"