test_list_agent: pop 'alive' from agent dict
As the test class lists agents in resource setup it can happen that the
selected agent from the list is not 'alive', but when test
test_list_agent lists again the agents, it is already up and
'alive'=True.
To avoid such failure, do skip 'alive' field of the comparison.
Change-Id: I0ed012ef59550e853a30e2994a1ab53083d8640c
Closes-Bug: #1953480
diff --git a/neutron_tempest_plugin/api/admin/test_agent_management.py b/neutron_tempest_plugin/api/admin/test_agent_management.py
index f63e81b..399e428 100644
--- a/neutron_tempest_plugin/api/admin/test_agent_management.py
+++ b/neutron_tempest_plugin/api/admin/test_agent_management.py
@@ -38,9 +38,13 @@
# Heartbeats must be excluded from comparison
self.agent.pop('heartbeat_timestamp', None)
self.agent.pop('configurations', None)
+ # Exclude alive as it can happen that when testclass'
+ # resource_setup executed the selected agent is not up
+ self.agent.pop('alive', None)
for agent in agents:
agent.pop('heartbeat_timestamp', None)
agent.pop('configurations', None)
+ agent.pop('alive', None)
self.assertIn(self.agent, agents)
@decorators.idempotent_id('e335be47-b9a1-46fd-be30-0874c0b751e6')