You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by an...@apache.org on 2017/07/10 07:45:26 UTC

[08/11] libcloud git commit: add a test for bad versions of authentication versioning

add a test for bad versions of authentication versioning


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/c5a4f37e
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/c5a4f37e
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/c5a4f37e

Branch: refs/heads/trunk
Commit: c5a4f37eeb4f0a7eafb6d724b8af95aa7456e76a
Parents: d5a1d7b
Author: Anthony Shaw <an...@apache.org>
Authored: Fri May 5 15:01:15 2017 +1000
Committer: Anthony Shaw <an...@apache.org>
Committed: Fri May 5 15:01:15 2017 +1000

----------------------------------------------------------------------
 libcloud/test/compute/test_openstack.py | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/c5a4f37e/libcloud/test/compute/test_openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_openstack.py b/libcloud/test/compute/test_openstack.py
index fa09a48..606f7b8 100644
--- a/libcloud/test/compute/test_openstack.py
+++ b/libcloud/test/compute/test_openstack.py
@@ -19,6 +19,7 @@ import os
 import sys
 import unittest
 import datetime
+import pytest
 from libcloud.utils.iso8601 import UTC
 
 try:
@@ -44,7 +45,8 @@ from libcloud.compute.drivers.openstack import (
     OpenStack_1_1_NodeDriver, OpenStackSecurityGroup,
     OpenStackSecurityGroupRule, OpenStack_1_1_FloatingIpPool,
     OpenStack_1_1_FloatingIpAddress, OpenStackKeyPair,
-    OpenStack_1_0_Connection
+    OpenStack_1_0_Connection,
+    OpenStackNodeDriver
 )
 from libcloud.compute.base import Node, NodeImage, NodeSize
 from libcloud.pricing import set_pricing, clear_pricing_data
@@ -58,6 +60,17 @@ from libcloud.test.secrets import OPENSTACK_PARAMS
 BASE_DIR = os.path.abspath(os.path.split(__file__)[0])
 
 
+def test_driver_instantiation_invalid_auth():
+    forced_auth = 'http://x.y.z.y:5000'
+    with pytest.raises(LibcloudError):
+        d = OpenStackNodeDriver(
+            'user', 'correct_password',
+            ex_force_auth_version='5.0',
+            ex_force_auth_url='http://x.y.z.y:5000',
+            ex_tenant_name='admin')
+        d.list_nodes()
+
+
 class OpenStackAuthTests(unittest.TestCase):
     def setUp(self):
         OpenStack_1_0_NodeDriver.connectionCls = OpenStack_1_0_Connection