From: dekehn Date: Thu, 21 Nov 2013 05:03:51 +0000 (-0700) Subject: Mock the udevadm in the TunnelTestWithMTU test X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=a98f479da3d3c63b5affbe82a236b7b79f631175;p=openstack-build%2Fneutron-build.git Mock the udevadm in the TunnelTestWithMTU test When running the neutron.tests.unit.openvswitch.test_ovs_tunnel. TunnelTestWithMTU unit test failure occurs because the udevadm is timing out waiting on a mock-ed device. Co-Authored-By: Salvatore Orlando Change-Id: I0e16295be66513c2257831bf62fd6a0c19f3b8a4 Closes-Bug: #1253506 --- diff --git a/neutron/tests/unit/openvswitch/test_ovs_tunnel.py b/neutron/tests/unit/openvswitch/test_ovs_tunnel.py index 5c571322f..76bf08366 100644 --- a/neutron/tests/unit/openvswitch/test_ovs_tunnel.py +++ b/neutron/tests/unit/openvswitch/test_ovs_tunnel.py @@ -214,6 +214,9 @@ class TunnelTest(base.BaseTestCase): self.get_bridges_expected = [ mock.call('sudo') ] + self.execute = mock.patch('neutron.agent.linux.utils.execute').start() + self.execute_expected = [mock.call(['/sbin/udevadm', 'settle', + '--timeout=10'])] def _verify_mock_call(self, mock_obj, expected): mock_obj.assert_has_calls(expected) @@ -233,6 +236,7 @@ class TunnelTest(base.BaseTestCase): self._verify_mock_call(self.get_bridges, self.get_bridges_expected) self._verify_mock_call(self.inta, self.inta_expected) self._verify_mock_call(self.intb, self.intb_expected) + self._verify_mock_call(self.execute, self.execute_expected) def test_construct(self): ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE,