From aecefee08778e91ae80784a9198126fa16822992 Mon Sep 17 00:00:00 2001
From: Goutham Pacha Ravi <gouthampravi@gmail.com>
Date: Tue, 8 Sep 2020 11:20:41 -0700
Subject: [PATCH] Handle oslo.messaging ping endpoint

We have a test that attempts to emulate a messaging endpoint and
fails if anything other than the endpoint's target property is
inspected. With the addition of the ping endpoint in
I51cf67e060f240e6eb82260e70a057fe599f9063, this now blows up
with the latest oslo.messaging release.

To handle this situation, our fake class just needs to also
check for the oslo_rpc_server_ping attribute.

Change-Id: I485c1724614abf03928b83280c88ffc4cdfdb1c4
Co-Authored-By: Sean McGinnis <sean.mcginnis@gmail.com>
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
---
 manila/tests/test_test.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/manila/tests/test_test.py b/manila/tests/test_test.py
index 5dfffa0a2a..2107da1e14 100644
--- a/manila/tests/test_test.py
+++ b/manila/tests/test_test.py
@@ -37,10 +37,11 @@ class IsolationTestCase(test.TestCase):
         class NeverCalled(object):
 
             def __getattribute__(self, name):
-                if name == 'target':
-                    # oslo.messaging 5.31.0 explicitly looks for 'target'
+                if name == 'target' or name == 'oslo_rpc_server_ping':
+                    # oslo.messaging >=5.31.0 explicitly looks for 'target'
                     # on the endpoint and checks its type, so we can't avoid
-                    # it here.  Just ignore it if that's the case.
+                    # it here. In 12.4.0, the package added a ping endpoint
+                    # Just ignore if either case.
                     return
                 assert False, "I should never get called - name: %s" % name