From 1b5f29a3a4cead30c6455d9ecc47850f5e4994e1 Mon Sep 17 00:00:00 2001 From: Takashi Natsume Date: Sun, 3 Jan 2021 21:42:11 +0900 Subject: [PATCH] Fix a functional test for 'nova agent-list' The os-agents APIs have been removed by the following change. I9512f605dd2b3b0e88c951ed086250d57056303d This patch fixes a gate failure. A subsequent patch will make things related to the os-agents APIs deprecated. Change-Id: I9dab95fda5902bf9619393eb2c4a22d9f395d65a Closes-Bug: #1909899 Signed-off-by: Takashi Natsume --- .../tests/functional/v2/legacy/test_readonly_nova.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/novaclient/tests/functional/v2/legacy/test_readonly_nova.py b/novaclient/tests/functional/v2/legacy/test_readonly_nova.py index ed002c50b..a91188b87 100644 --- a/novaclient/tests/functional/v2/legacy/test_readonly_nova.py +++ b/novaclient/tests/functional/v2/legacy/test_readonly_nova.py @@ -86,8 +86,16 @@ class SimpleReadOnlyNovaClientTest(base.ClientTestBase): self.nova('help') def test_agent_list(self): - self.nova('agent-list') - self.nova('agent-list', flags='--debug') + ex = self.assertRaises(exceptions.CommandFailed, + self.nova, 'agent-list') + self.assertIn( + "This resource is no longer available. " + "No forwarding address is given. (HTTP 410)", str(ex)) + ex = self.assertRaises(exceptions.CommandFailed, + self.nova, 'agent-list', flags='--debug') + self.assertIn( + "This resource is no longer available. " + "No forwarding address is given. (HTTP 410)", str(ex)) def test_migration_list(self): self.nova('migration-list')