From 47a2e72693ade41ab7dffa96350a37aee73a6f59 Mon Sep 17 00:00:00 2001 From: Masayuki Igawa Date: Fri, 29 Aug 2014 19:25:48 +0900 Subject: [PATCH] Fix unstable assertion in test_cinder_endpoints In simple_read_only.test_cinder.test_cinder_endpoints, the test case assumes that the first table of 'cinder endpoints' always ['nova', 'Value']. However, it is sometimes wrong. So in this commit, the test verifies that they have 2 or more headers and has a 'Value' header. Change-Id: Idb3f2ebc6b7e05178621ac3701b7c3d02e1d7591 Closes-Bug: #1363018 Closes-Bug: #1362703 --- tempest/cli/simple_read_only/volume/test_cinder.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tempest/cli/simple_read_only/volume/test_cinder.py b/tempest/cli/simple_read_only/volume/test_cinder.py index 3a9a7a6f6b..e44a577148 100644 --- a/tempest/cli/simple_read_only/volume/test_cinder.py +++ b/tempest/cli/simple_read_only/volume/test_cinder.py @@ -121,8 +121,12 @@ class SimpleReadOnlyCinderClientTest(cli.ClientTestBase): self.assertTableStruct(zone_list, ['Name', 'Status']) def test_cinder_endpoints(self): - endpoints = self.parser.listing(self.cinder('endpoints')) - self.assertTableStruct(endpoints, ['nova', 'Value']) + out = self.cinder('endpoints') + tables = self.parser.tables(out) + for table in tables: + headers = table['headers'] + self.assertTrue(2 >= len(headers)) + self.assertEqual('Value', headers[1]) def test_cinder_service_list(self): service_list = self.parser.listing(self.cinder('service-list'))