You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by GitBox <gi...@apache.org> on 2022/03/07 19:42:11 UTC

[GitHub] [libcloud] dpeschman commented on a change in pull request #1660: Fix OpenStack authentication regressions

dpeschman commented on a change in pull request #1660:
URL: https://github.com/apache/libcloud/pull/1660#discussion_r821042778



##########
File path: libcloud/test/compute/test_openstack.py
##########
@@ -3989,6 +4076,76 @@ def test_auth_user_info_is_set(self):
         )
 
 
+class OpenStack_AuthVersions_Tests(unittest.TestCase):
+    def setUp(self):
+        # monkeypatch get_endpoint because the base openstack driver doesn't actually
+        # work with old devstack but this class/tests are still used by the rackspace
+        # driver
+        self.originalGetEndpoint = OpenStack_1_1_NodeDriver.connectionCls.get_endpoint
+        self.originalConnectionCls = OpenStack_1_1_NodeDriver.connectionCls
+
+        def get_endpoint(*args, **kwargs):
+            return "https://servers.api.rackspacecloud.com/v1.0/slug"
+
+        OpenStack_1_1_NodeDriver.connectionCls.get_endpoint = get_endpoint
+        OpenStack_1_1_NodeDriver.connectionCls.conn_class = (
+            OpenStack_AllAuthVersions_MockHttp
+        )
+
+        OpenStackMockHttp.type = None
+        OpenStack_1_1_MockHttp.type = None
+        OpenStack_2_0_MockHttp.type = None
+
+    def tearDown(self):
+        OpenStack_1_1_NodeDriver.connectionCls.get_endpoint = self.originalGetEndpoint
+        OpenStack_1_1_NodeDriver.connectionCls.conn_class = self.originalConnectionCls
+
+        OpenStackMockHttp.type = None
+        OpenStack_1_1_MockHttp.type = None
+        OpenStack_2_0_MockHttp.type = None
+
+    def test_ex_force_auth_version_all_possible_values(self):
+        """
+        Test case which verifies that the driver can be correctly instantiated using all the
+        supported API versions.
+        """
+        cls = get_driver(Provider.OPENSTACK)
+
+        for auth_version in AUTH_VERSIONS_WITH_EXPIRES:
+            driver_kwargs = {}
+
+            if auth_version in ["1.1", "3.0"]:
+                # 1.1 is old and deprecated, 3.0 is not exposed directly to the endu ser

Review comment:
       "endu ser" shoudl be "end user".




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org