tests: make sure dnsmasq is stopped before starting it again
Avoid conflict on listening port ("Address already in use" error). Send SIGTERM until all instances of dnsmasq exit.
This commit is contained in:
parent
79d4b7162a
commit
14c636469f
@ -141,7 +141,7 @@ class VmNetworkingMixin(object):
|
||||
run_netvm_cmd("iptables -I INPUT -d {} -j ACCEPT --wait".format(
|
||||
self.test_ip))
|
||||
# ignore failure
|
||||
self.run_cmd(self.testnetvm, "pkill dnsmasq")
|
||||
self.run_cmd(self.testnetvm, "while pkill dnsmasq; do sleep 1; done")
|
||||
run_netvm_cmd("dnsmasq -a {ip} -A /{name}/{ip} -i test0 -z".format(
|
||||
ip=self.test_ip, name=self.test_name))
|
||||
run_netvm_cmd("echo nameserver {} > /etc/resolv.conf".format(
|
||||
|
@ -75,7 +75,7 @@ class VmIPv6NetworkingMixin(VmNetworkingMixin):
|
||||
run_netvm_cmd(
|
||||
"ip6tables -I INPUT -d {} -j ACCEPT".format(self.test_ip6))
|
||||
# ignore failure
|
||||
self.run_cmd(self.testnetvm, "pkill dnsmasq")
|
||||
self.run_cmd(self.testnetvm, "while pkill dnsmasq; do sleep 1; done")
|
||||
run_netvm_cmd(
|
||||
"dnsmasq -a {ip} -A /{name}/{ip} -A /{name}/{ip6} -i test0 -z".
|
||||
format(ip=self.test_ip, ip6=self.test_ip6, name=self.test_name))
|
||||
|
Loading…
Reference in New Issue
Block a user