Simplify start/stop helper func in system tests
The system test should never attempt to start or stop any other server than those that belong to that system test. Therefore, it is not necessary to specify the system test name in function calls. Additionally, this makes it possible to run the test inside a differently named directory, as its name is automatically detected with the $SYSTESTDIR variable. This enables running the system tests inside a temporary directory. Direct use of stop.pl was replaced with a more systematic approach to use stop_servers helper function.
This commit is contained in:
@@ -73,7 +73,7 @@ stomp () {
|
||||
|
||||
restart () {
|
||||
sleep 1
|
||||
start_server --noclean --restart --port "${PORT}" masterformat ns3
|
||||
start_server --noclean --restart --port "${PORT}" ns3
|
||||
}
|
||||
|
||||
dig_with_opts() {
|
||||
@@ -214,7 +214,7 @@ grep "added text" "dig.out.dynamic1.ns3.test$n" > /dev/null 2>&1 || ret=1
|
||||
dig_with_opts +comm @10.53.0.3 added.dynamic txt > "dig.out.dynamic2.ns3.test$n"
|
||||
grep "NXDOMAIN" "dig.out.dynamic2.ns3.test$n" > /dev/null 2>&1 || ret=1
|
||||
# using "rndc halt" ensures that we don't dump the zone file
|
||||
$PERL ../stop.pl --use-rndc --halt --port ${CONTROLPORT} masterformat ns3
|
||||
stop_server --use-rndc --halt --port ${CONTROLPORT} ns3
|
||||
restart
|
||||
check_added_text() {
|
||||
dig_with_opts @10.53.0.3 newtext.dynamic txt > "dig.out.dynamic3.ns3.test$n" || return 1
|
||||
@@ -239,7 +239,7 @@ END
|
||||
dig_with_opts @10.53.0.3 moretext.dynamic txt > "dig.out.dynamic1.ns3.test$n"
|
||||
grep "more text" "dig.out.dynamic1.ns3.test$n" > /dev/null 2>&1 || ret=1
|
||||
# using "rndc stop" will cause the zone file to flush before shutdown
|
||||
$PERL ../stop.pl --use-rndc --port ${CONTROLPORT} masterformat ns3
|
||||
stop_server --use-rndc --port ${CONTROLPORT} ns3
|
||||
rm ns3/*.jnl
|
||||
restart
|
||||
#shellcheck disable=SC2034
|
||||
|
||||
Reference in New Issue
Block a user