From b83b9dc2c6b6dd62b79a3ebf9ff10c902b3d545d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Wed, 9 Mar 2022 11:28:06 +0100 Subject: [PATCH 1/4] Remove support for running system tests under Valgrind Valgrind support has been scarcely used. (cherry picked from commit 658d62a6f49b0322c02f162d55468a5e7af0869f) --- bin/tests/system/README | 8 -------- bin/tests/system/cleanall.sh | 3 +-- bin/tests/system/start.pl | 18 +++--------------- 3 files changed, 4 insertions(+), 25 deletions(-) diff --git a/bin/tests/system/README b/bin/tests/system/README index 00146be307..58e6048ae0 100644 --- a/bin/tests/system/README +++ b/bin/tests/system/README @@ -710,14 +710,6 @@ or SEQUENTIAL variables. need to edit multiple files to add a test.) -Valgrind ---- -When running system tests, named can be run under Valgrind. The output from -Valgrind are sent to per-process files that can be reviewed after the test has -completed. To enable this, set the USE_VALGRIND environment variable to -"helgrind" to run the Helgrind tool, or any other value to run the Memcheck -tool. To use "helgrind" effectively, build BIND with --disable-atomic. - Developer Notes for pytest runner === diff --git a/bin/tests/system/cleanall.sh b/bin/tests/system/cleanall.sh index 21d1c040b9..a7e48ad7bd 100644 --- a/bin/tests/system/cleanall.sh +++ b/bin/tests/system/cleanall.sh @@ -20,8 +20,7 @@ find . -type f \( \ -name '*~' -o -name 'core' -o -name '*.core' \ -o -name '*.log' -o -name '*.pid' -o -name '*.keyset' \ - -o -name named.run -o -name ans.run \ - -o -name '*-valgrind-*.log' \) -print | xargs rm -f + -o -name named.run -o -name ans.run \) -print | xargs rm -f status=0 diff --git a/bin/tests/system/start.pl b/bin/tests/system/start.pl index 2a2d7809f7..c0163a2a23 100755 --- a/bin/tests/system/start.pl +++ b/bin/tests/system/start.pl @@ -230,22 +230,10 @@ sub construct_ns_command { my $command; - if ($ENV{'USE_VALGRIND'}) { - $command = "valgrind -q --gen-suppressions=all --num-callers=48 --fullpath-after= --log-file=named-$server-valgrind-%p.log "; - - if ($ENV{'USE_VALGRIND'} eq 'helgrind') { - $command .= "--tool=helgrind "; - } else { - $command .= "--tool=memcheck --track-origins=yes --leak-check=full "; - } - - $command .= "$NAMED -m none "; + if ($taskset) { + $command = "taskset $taskset $NAMED "; } else { - if ($taskset) { - $command = "taskset $taskset $NAMED "; - } else { - $command = "$NAMED "; - } + $command = "$NAMED "; } my $args_file = $testdir . "/" . $server . "/" . "named.args"; From 72760c0c2b5b41b465faa0cb33800b5156a979ea Mon Sep 17 00:00:00 2001 From: Michal Nowak Date: Wed, 8 Nov 2023 19:21:30 +0100 Subject: [PATCH 2/4] Add support for recording named runtime with rr The traces of the named process are stored in the directory $system_test/nsX/named-Y/. (cherry picked from commit e088e8a992008ba5e0dc1c540f808a03e69cd619) --- bin/tests/system/README | 8 ++++++++ bin/tests/system/start.pl | 3 +++ 2 files changed, 11 insertions(+) diff --git a/bin/tests/system/README b/bin/tests/system/README index 58e6048ae0..cb9f71b237 100644 --- a/bin/tests/system/README +++ b/bin/tests/system/README @@ -710,6 +710,14 @@ or SEQUENTIAL variables. need to edit multiple files to add a test.) +rr +--- + +When running system tests, named can be run under the rr tool. rr records a +trace to the $system_test/nsX/named-Y/ directory, which can be later used to +replay named. To enable this, execute start.pl with the USE_RR environment +variable set. + Developer Notes for pytest runner === diff --git a/bin/tests/system/start.pl b/bin/tests/system/start.pl index c0163a2a23..904aa9b1e0 100755 --- a/bin/tests/system/start.pl +++ b/bin/tests/system/start.pl @@ -232,6 +232,9 @@ sub construct_ns_command { if ($taskset) { $command = "taskset $taskset $NAMED "; + } elsif ($ENV{'USE_RR'}) { + $ENV{'_RR_TRACE_DIR'} = "."; + $command = "rr record --chaos $NAMED "; } else { $command = "$NAMED "; } From 3bd3dfd187f98b62b6bba5e6baf9075ab8e8a3b4 Mon Sep 17 00:00:00 2001 From: Michal Nowak Date: Wed, 8 Nov 2023 18:46:20 +0100 Subject: [PATCH 3/4] Fix process listing string of rpzextra ns3 server (cherry picked from commit 920af590d155fc110df2c434e90fd0b029a541cb) --- bin/tests/system/rpzextra/ns3/named.args | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/tests/system/rpzextra/ns3/named.args b/bin/tests/system/rpzextra/ns3/named.args index 970fc22639..16e88dd5db 100644 --- a/bin/tests/system/rpzextra/ns3/named.args +++ b/bin/tests/system/rpzextra/ns3/named.args @@ -1 +1 @@ - -m record -c named.conf -d 99 -D rpzextra-ns1 -X named.lock -U 4 -T maxcachesize=2097152 + -m record -c named.conf -d 99 -D rpzextra-ns3 -X named.lock -U 4 -T maxcachesize=2097152 From a195d9b12633e02aafccab1e78b489ae2b29623a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Thu, 16 Nov 2023 13:21:33 +0100 Subject: [PATCH 4/4] Do not daemonize named instances with custom args This enables the "logfileconfig" and "rpzextra" system tests to pass when named is started under the supervision of rr (USE_RR=1). (cherry picked from commit 422286e9c2d459aa455fd907571d75784225d584) --- bin/tests/system/logfileconfig/named1.args | 2 +- bin/tests/system/logfileconfig/named2.args | 2 +- bin/tests/system/rpzextra/ns3/named.args | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/tests/system/logfileconfig/named1.args b/bin/tests/system/logfileconfig/named1.args index 764d4c969e..f35563b04b 100644 --- a/bin/tests/system/logfileconfig/named1.args +++ b/bin/tests/system/logfileconfig/named1.args @@ -1 +1 @@ --c named.conf -m record -T nosyslog -d 99 -D logfileconfig-ns1 -X named.lock -U 4 +-c named.conf -m record -T nosyslog -f -d 99 -D logfileconfig-ns1 -X named.lock -U 4 diff --git a/bin/tests/system/logfileconfig/named2.args b/bin/tests/system/logfileconfig/named2.args index fb9fe57371..ddae5a4eae 100644 --- a/bin/tests/system/logfileconfig/named2.args +++ b/bin/tests/system/logfileconfig/named2.args @@ -1 +1 @@ --c named.conf -m record -T nosyslog -d 99 -D logfileconfig-ns1 -X named.lock -U 4 -L named_deflog +-c named.conf -m record -T nosyslog -f -d 99 -D logfileconfig-ns1 -X named.lock -U 4 -L named_deflog diff --git a/bin/tests/system/rpzextra/ns3/named.args b/bin/tests/system/rpzextra/ns3/named.args index 16e88dd5db..8ec9731d67 100644 --- a/bin/tests/system/rpzextra/ns3/named.args +++ b/bin/tests/system/rpzextra/ns3/named.args @@ -1 +1 @@ - -m record -c named.conf -d 99 -D rpzextra-ns3 -X named.lock -U 4 -T maxcachesize=2097152 + -m record -c named.conf -d 99 -f -D rpzextra-ns3 -X named.lock -U 4 -T maxcachesize=2097152