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(
|
run_netvm_cmd("iptables -I INPUT -d {} -j ACCEPT --wait".format(
|
||||||
self.test_ip))
|
self.test_ip))
|
||||||
# ignore failure
|
# 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(
|
run_netvm_cmd("dnsmasq -a {ip} -A /{name}/{ip} -i test0 -z".format(
|
||||||
ip=self.test_ip, name=self.test_name))
|
ip=self.test_ip, name=self.test_name))
|
||||||
run_netvm_cmd("echo nameserver {} > /etc/resolv.conf".format(
|
run_netvm_cmd("echo nameserver {} > /etc/resolv.conf".format(
|
||||||
|
@ -75,7 +75,7 @@ class VmIPv6NetworkingMixin(VmNetworkingMixin):
|
|||||||
run_netvm_cmd(
|
run_netvm_cmd(
|
||||||
"ip6tables -I INPUT -d {} -j ACCEPT".format(self.test_ip6))
|
"ip6tables -I INPUT -d {} -j ACCEPT".format(self.test_ip6))
|
||||||
# ignore failure
|
# ignore failure
|
||||||
self.run_cmd(self.testnetvm, "pkill dnsmasq")
|
self.run_cmd(self.testnetvm, "while pkill dnsmasq; do sleep 1; done")
|
||||||
run_netvm_cmd(
|
run_netvm_cmd(
|
||||||
"dnsmasq -a {ip} -A /{name}/{ip} -A /{name}/{ip6} -i test0 -z".
|
"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))
|
format(ip=self.test_ip, ip6=self.test_ip6, name=self.test_name))
|
||||||
|
Loading…
Reference in New Issue
Block a user