[FT] Reset "AgentCache" singleton in functional tests

Reset "AgentCache" singleton instance after each functional test
execution. That will remove any stored information from the previous
tests.

Related-Bug: #1914754

Change-Id: Ibd8897ec04843a5d6eb8639cc0c6ef0e2b9d2a3b
This commit is contained in:
Rodolfo Alonso Hernandez 2021-02-08 09:18:45 +00:00
parent d452e78687
commit 27da92d634
1 changed files with 5 additions and 0 deletions

View File

@ -41,6 +41,7 @@ from neutron.conf.plugins.ml2.drivers.ovn import ovn_conf
# the SqlFixture
from neutron.db import models # noqa
from neutron import manager
from neutron.plugins.ml2.drivers.ovn.agent import neutron_agent
from neutron.plugins.ml2.drivers.ovn.mech_driver.ovsdb import worker
from neutron.plugins.ml2.drivers import type_geneve # noqa
from neutron import service # noqa
@ -197,6 +198,10 @@ class TestOVNFunctionalBase(test_plugin.Ml2PluginV2TestCase,
self.temp_dir = self.useFixture(fixtures.TempDir()).path
self._start_ovsdb_server_and_idls()
self._start_ovn_northd()
self.addCleanup(self._reset_agent_cache_singleton)
def _reset_agent_cache_singleton(self):
neutron_agent.AgentCache._instance = None
def _get_install_share_path(self):
lookup_paths = set()