tests: fix race condition in network test

Wait for network configuration being applied before testing it.
This commit is contained in:
Marek Marczykowski-Górecki 2015-12-06 14:34:52 +01:00
parent 2658c9a6e6
commit 3fafc5dc67
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -320,9 +320,11 @@ class VmNetworkingMixin(qubes.tests.SystemTestsMixin):
self.testvm1.start()
self.assertEqual(self.run_cmd(self.testvm1, self.ping_ip), 0)
self.testvm1.run("ip addr flush dev eth0", user="root")
self.testvm1.run("ip addr add 10.137.1.128/24 dev eth0", user="root")
self.testvm1.run("ip route add dev eth0", user="root")
self.testvm1.run("ip addr flush dev eth0", user="root", wait=True)
self.testvm1.run("ip addr add 10.137.1.128/24 dev eth0", user="root",
wait=True)
self.testvm1.run("ip route add default dev eth0", user="root",
wait=True)
self.assertNotEqual(self.run_cmd(self.testvm1, self.ping_ip), 0,
"Spoofed ping should be blocked")