tests: avoid starting compute service twice in sriov functional test

SRIOV functional tests that starts two or more guest were able to start
the compute service multiple times with the same hostname, which affected the
correctness of the tests.
This patch will make sure that the compute service is started only once.

Closes-Bug: #1647776
Co-Authored-By: Dan Smith <dansmith@redhat.com>
Change-Id: I8556ce068571d8e496e6fba756c1977c1d2c3ca1
This commit is contained in:
Vladik Romanovsky 2016-12-06 10:37:33 -05:00
parent 624e10ffd2
commit c719e224bc

@ -89,6 +89,8 @@ class SRIOVServersTest(ServersTestBase):
fakelibvirt))
self.useFixture(fakelibvirt.FakeLibvirtFixture())
self.compute_started = False
def _setup_compute_service(self):
pass
@ -111,7 +113,10 @@ class SRIOVServersTest(ServersTestBase):
def _run_build_test(self, flavor_id, filter_mock, end_status='ACTIVE'):
self.compute = self.start_service('compute', host='test_compute0')
if not self.compute_started:
self.compute = self.start_service('compute', host='test_compute0')
self.compute_started = True
fake_network.set_stub_network_methods(self)
# Create server