From 3fafc5dc67d3f105a314accff91c4cf4be8e516e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sun, 6 Dec 2015 14:34:52 +0100 Subject: [PATCH] tests: fix race condition in network test Wait for network configuration being applied before testing it. --- tests/network.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/network.py b/tests/network.py index fe202b9c..ce93cb9f 100644 --- a/tests/network.py +++ b/tests/network.py @@ -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")