From 82167ddca384e54b743446f02392b25c1d1084b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awek=20Kap=C5=82o=C5=84ski?= Date: Mon, 19 Feb 2018 13:28:57 +0100 Subject: [PATCH] [Fullstack] Respawn dhclient process in case of error When dhclient process is started as async process by fake machine resource, it might happen that "None" will be returned as first line of output from this process. This is treated as an error and dhclient is halted immediately. Because of that fake machine don't have configured IP address and test fails. This patch adds "respawn_timeout" value set to 5 seconds for dhclient async process. When dhclient process is restarted it should works fine and IP address should be then configured properly. Change-Id: Ie056578abbe6e18c8415c6e61d755f2248a70541 Closes-Bug: #1728948 (cherry picked from commit 92959238a3e408e810ccd4f3d3d453a35afb5bba) --- neutron/tests/fullstack/resources/machine.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/neutron/tests/fullstack/resources/machine.py b/neutron/tests/fullstack/resources/machine.py index 35fd16953dd..42405f9e783 100644 --- a/neutron/tests/fullstack/resources/machine.py +++ b/neutron/tests/fullstack/resources/machine.py @@ -137,7 +137,8 @@ class FakeFullstackMachine(machine_fixtures.FakeMachineBase): cmd = ["dhclient", '-sf', self.NO_RESOLV_CONF_DHCLIENT_SCRIPT_PATH, '--no-pid', '-d', self.port.name] self.dhclient_async = async_process.AsyncProcess( - cmd, run_as_root=True, namespace=self.namespace) + cmd, run_as_root=True, respawn_interval=5, + namespace=self.namespace) self.dhclient_async.start() def _stop_async_dhclient(self):