]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Revive the stress system test
authorTom Krizek <tkrizek@isc.org>
Fri, 14 Oct 2022 14:59:50 +0000 (16:59 +0200)
committerTom Krizek <tkrizek@isc.org>
Wed, 19 Oct 2022 13:32:44 +0000 (15:32 +0200)
Ensure the port numbers are dynamically filled in with copy_setports.

Clarify test fail condition.

Make the stress test part of the default test suite since it doesn't
seem to run too long or interfere with other tests any more (the
original note claiming so is more than 20 years old).

Related !6883

(cherry picked from commit 7495deea3e80fe20dd32dabf1d174d1458ce2b47)

bin/tests/system/Makefile.am
bin/tests/system/conf.sh.common
bin/tests/system/stress/clean.sh
bin/tests/system/stress/ns1/named.conf.in [moved from bin/tests/system/stress/ns1/named.conf with 98% similarity]
bin/tests/system/stress/ns2/named.conf.in [moved from bin/tests/system/stress/ns2/named.conf with 98% similarity]
bin/tests/system/stress/ns3/named.conf.in [moved from bin/tests/system/stress/ns3/named.conf with 91% similarity]
bin/tests/system/stress/ns4/named.conf.in [moved from bin/tests/system/stress/ns4/named.conf with 98% similarity]
bin/tests/system/stress/setup.sh
bin/tests/system/stress/tests.sh

index 15371f57ba80fdac66c839e4434eb441202748e9..f185dd26fb77a9ad57dad43313d274207958b2f3 100644 (file)
@@ -171,11 +171,9 @@ TESTS +=                   \
        xferquota               \
        zonechecks
 
-# The "stress" test is not run by default since it creates enough
-# load on the machine to make it unusable to other users.
 # The "dupsigs" test is not run by default because it takes
 # a very long time to complete.
-# TESTS += dupsigs stress
+# TESTS += dupsigs
 
 if HAVE_LMDB
 TESTS += nzd2nzf
@@ -189,6 +187,7 @@ TESTS +=            \
        nsupdate        \
        resolver        \
        statistics      \
+       stress          \
        upforwd         \
        zero
 
index 726e20f817c95c901061ed4ecce5f7f8fc3ca42d..ff0950f129f76904f08ec273e3564a32bccdc3c8 100644 (file)
@@ -26,8 +26,6 @@ export LANG=C
 #
 # Common lists of system tests to run.
 #
-# The "stress" test is not run by default since it creates enough
-# load on the machine to make it unusable to other users.
 # The "dupsigs" test is not run by default because it takes
 # a very long time to complete.
 #
index 0f8403c83a3a9d1683df55e65b801c4f01868bcf..b365d7cc77e83ec4271171d94804a56ad07244dc 100644 (file)
@@ -17,9 +17,12 @@ rm -f ns?/zones.conf
 rm -f ns?/zone*.bk
 
 rm -f ns1/delegations.db
+rm -f ns1/root.db
 
 rm -f ns2/zone0*.db
 rm -f ns2/zone0*.jnl
 rm -f */named.memstats
 rm -f ns*/named.lock
 rm -f ns*/managed-keys.bind*
+rm -f ns*/named.run
+rm -f ns*/named.conf
similarity index 98%
rename from bin/tests/system/stress/ns1/named.conf
rename to bin/tests/system/stress/ns1/named.conf.in
index a8378d2034c864a5fe035673ae3bfc2707bb46b1..74ad00787b37dc7fccdac80f5aa640ad047d0e70 100644 (file)
@@ -17,7 +17,7 @@ options {
        query-source address 10.53.0.1;
        notify-source 10.53.0.1;
        transfer-source 10.53.0.1;
-       port 5300;
+       port @PORT@;
        pid-file "named.pid";
        listen-on { 10.53.0.1; };
        listen-on-v6 { none; };
similarity index 98%
rename from bin/tests/system/stress/ns2/named.conf
rename to bin/tests/system/stress/ns2/named.conf.in
index f8317823b150343598e8fee177130b91d013511a..5bbea78acaca9bb08bff7f94e80242a5f9ad15b6 100644 (file)
@@ -17,7 +17,7 @@ options {
        query-source address 10.53.0.2;
        notify-source 10.53.0.2;
        transfer-source 10.53.0.2;
-       port 5300;
+       port @PORT@;
        pid-file "named.pid";
        listen-on { 10.53.0.2; };
        listen-on-v6 { none; };
similarity index 91%
rename from bin/tests/system/stress/ns3/named.conf
rename to bin/tests/system/stress/ns3/named.conf.in
index d4f331c4ce218c676854243196e2ee0f44dff25b..036ffdbac2aa9ba829d245a49221f993b73fee91 100644 (file)
@@ -17,7 +17,7 @@ options {
        query-source address 10.53.0.3;
        notify-source 10.53.0.3;
        transfer-source 10.53.0.3;
-       port 5300;
+       port @PORT@;
        pid-file "named.pid";
        listen-on { 10.53.0.3; };
        listen-on-v6 { none; };
@@ -32,7 +32,7 @@ key rndc_key {
 };
 
 controls {
-       inet 10.53.0.3 port 9953 allow { any; } keys { rndc_key; };
+       inet 10.53.0.3 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
 };
 
 zone "." {
similarity index 98%
rename from bin/tests/system/stress/ns4/named.conf
rename to bin/tests/system/stress/ns4/named.conf.in
index e41d1947050784e36273733eb4743d1b35b4ec12..57f7e40fddc6e587605bc8a7003d74b19e744bc0 100644 (file)
@@ -17,7 +17,7 @@ options {
        query-source address 10.53.0.4;
        notify-source 10.53.0.4;
        transfer-source 10.53.0.4;
-       port 5300;
+       port @PORT@;
        pid-file "named.pid";
        listen-on { 10.53.0.4; };
        listen-on-v6 { none; };
index 7d7d8b34a903e93b2bf14bd28f6065b1d4f17b78..cc751d3b7a09b0ba349be70afbd9a780cf78b555 100644 (file)
@@ -19,3 +19,8 @@
 #
 
 $PERL setup.pl
+
+copy_setports ns1/named.conf.in ns1/named.conf
+copy_setports ns2/named.conf.in ns2/named.conf
+copy_setports ns3/named.conf.in ns3/named.conf
+copy_setports ns4/named.conf.in ns4/named.conf
index e0c6ea7466db3f9abe8351e79f87e8ed77913fbf..43e373e09ff77f88e0afe72ce829f52ad41c599d 100644 (file)
@@ -17,7 +17,7 @@ status=0
 
 (
 $SHELL -c "while true
-           do $RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 reload 2>&1 |
+           do $RNDC -c ../common/rndc.conf -s 10.53.0.3 -p $CONTROLPORT reload 2>&1 |
               sed 's/^/I:ns3 /';
           sleep 1
        done" & echo $! >reload.pid
@@ -25,7 +25,7 @@ $SHELL -c "while true
 
 for i in 0 1 2 3 4
 do
-       $PERL update.pl -s 10.53.0.2 -p 5300 zone00000$i.example. &
+       $PERL update.pl -s 10.53.0.2 -p $PORT zone00000$i.example. &
 done
 
 echo_i "waiting for background processes to finish"
@@ -34,5 +34,9 @@ wait
 echo_i "killing reload loop"
 kill `cat reload.pid`
 
+# If the test has run to completion without named crashing, it has succeeded.
+# Otherwise, the crash will be detected by the test framework and the test will
+# fail.
+
 echo_i "exit status: $status"
 [ $status -eq 0 ] || exit 1