tests: make sure dnsmasq isn't already running

On Debian when dnsmasq is installed, it is automatically started. Which
prevents starting a second instance.
This commit is contained in:
Marek Marczykowski-Górecki 2016-06-24 04:37:06 +02:00
parent 7eb881c6ba
commit 4123b95866
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -88,6 +88,8 @@ class VmNetworkingMixin(qubes.tests.SystemTestsMixin):
run_netvm_cmd("ip link set test0 up") run_netvm_cmd("ip link set test0 up")
run_netvm_cmd("ip addr add {}/24 dev test0".format(self.test_ip)) run_netvm_cmd("ip addr add {}/24 dev test0".format(self.test_ip))
run_netvm_cmd("iptables -I INPUT -d {} -j ACCEPT".format(self.test_ip)) run_netvm_cmd("iptables -I INPUT -d {} -j ACCEPT".format(self.test_ip))
# ignore failure
self.run_cmd(self.testnetvm, "killall --wait dnsmasq")
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(